Prompt Engineering Mastery/Reasoning Techniques
Lesson 4 / 7 · 25 min · 0 / 3 exercises
Course contents
Walkthrough · 3 hands-on exercises

Run an Effort Sweep

Measure quality, tokens and latency at three effort levels on your own test cases, then ship the lowest level that holds.

Effort levels aren't interchangeable between models, and Anthropic says so with each release: Sonnet 5.5's levels are “recalibrated,” Opus 5.5's level names “don't correspond to the same amount of thinking” as on Opus 5, and for Fable 5.2 you should “rerun your effort sweep rather than carrying over a setting.” The only way to know which level your task needs is to measure it. An effort sweep runs the same test cases at several levels and records quality, tokens and latency side by side. First, see why the token column matters.

Explore: Thinking tokens are output tokensExercise 1 of 3
ModelPer monthRelative cost
Claude Opus 5.5$2,100
Claude Sonnet 5.5$1,050
GPT-6 Astra$5,250
Grok 4.7 (prompts under 200K)$750

30 days × 2,500 requests. List prices per million tokens as of November 2026; check the vendor's pricing page before you budget.

Move output tokens per request to see what a higher effort level can do to the bill. Thinking is generated output, billed even when you don't display it.

Move the controls and watch what changes.

Quick checkExercise 2 of 3

Move output from 1,000 to 4,000 tokens per request, the kind of jump a higher effort level can cause on hard tasks. What happens to Claude Opus 5.5's monthly bill?

What to record

MeasureWhy it matters
Pass rate on your test casesThe quality bar each level has to clear
Output tokens per request, thinking includedMost of the cost difference between levels
Time to first token and total timeWhat users feel; Anthropic notes that higher effort means a longer wait before the reply starts
Runs that hit max_tokensTruncated answers. Anthropic says to treat them as failures even when the text holds valid JSON
Cost per completed taskA cheaper level that needs retries isn't cheaper
Fill the blanksExercise 3 of 3

Complete the request settings for the low-effort run of your sweep on Claude.

"output_config": {"effort": ""}, "max_tokens": ,
Effort and length are separate dials
Anthropic notes that on Fable 5.2, effort “has little effect on the length” of replies. If answers are too long or too short, fix that in the prompt. Use effort for depth, cost and latency.
Steps · 0 / 6 done
  1. Freeze a test slice

    Pick 20 cases from your golden set, including at least five hard ones, each with a pass rule you can check without debate. The Testing Prompts Like Code lesson shows how to build that set. Freeze the slice so every level sees exactly the same inputs.

    prompt
    sweep-slice.json   (20 cases, frozen 2026-11-12)
    - 15 typical cases from last month's traffic
    - 5 hard cases: two past failures, one multi-step calculation,
      one ambiguous request, one long input
    - each case: { id, input, pass_rule }
    VerifyYou have 20 cases, five of them hard, and you can say for each one what counts as a pass.
  2. Strip the reasoning incantations

    Remove “think step by step”, scratchpad sections, reasoning fields and any line telling the model to think less. They muddy the comparison, and on current Claude models some of them can trigger reasoning-extraction declines. Keep the task, the context and the output contract.

    prompt
    Delete:  "Think step by step."
    Delete:  "Write your reasoning in <scratchpad> tags first."
    Delete:  "reasoning": "..."  (from the JSON schema)
    Keep:    the task, the context, the success criteria, the output contract
    VerifyNothing in the prompt mentions thinking or reasoning, and the output contract is unchanged.
  3. Set effort explicitly and leave headroom

    Name the level on every request so no default decides your result, and set max_tokens high enough for thinking plus the reply. The request below is Claude's shape. With OpenAI, set reasoning.effort; with Gemini, thinkingLevel; with Grok, reasoning_effort.

    json
    {
      "model": "claude-opus-5-5",
      "max_tokens": 32000,
      "thinking": {"type": "adaptive", "display": "summarized"},
      "output_config": {"effort": "low"},
      "messages": [{"role": "user", "content": "{test_case_input}"}]
    }
    VerifyEach logged request shows its effort level, and no response ends with stop_reason: "max_tokens".
  4. Run three levels, several times each

    Run the slice at three adjacent levels, such as low, medium and high, three times per case. Outputs vary from run to run, so a case passes only if it passes every run. Record the five measures from the table above.

    prompt
    level   | pass (all 3 runs) | mean output tokens | p50 first token | p50 total | hit max_tokens
    low     | 16 / 20           | 1,150              | 1.4 s           | 6 s       | 0
    medium  | 19 / 20           | 2,300              | 2.9 s           | 11 s      | 0
    high    | 19 / 20           | 4,700              | 5.8 s           | 21 s      | 0
    (illustrative numbers: record your own)
    VerifyYou have a filled-in table with one row per level, measured on the same 20 cases.
  5. Read the summaries of the failures

    For every failed case, read the thinking summary. A model that misread the task needs a prompt fix, and more effort won't help it. A model that understood the task but reasoned shallowly is the case effort exists for. Fix misreads first, then rerun.

    prompt
    Case t14 at low: summary shows the model treated "net" as "gross"
      -> prompt fix: define net in the task statement; rerun the slice
    Case t17 at low and medium: summary stops after one scenario
      -> depth problem: route this kind of case to high
    VerifyEvery failure is labeled either a prompt problem or a depth problem, and the prompt problems are fixed before you choose a level.
  6. Ship the lowest level that holds, and schedule a rerun

    Choose the lowest level whose pass rate meets your bar. If one kind of case needs more, route that kind higher instead of raising the level for everything. Write the result down with the model ID and date, and rerun the sweep whenever the model changes.

    prompt
    # effort decision: invoice-analysis route
    # model: claude-opus-5-5   swept: 2026-11-12   slice: sweep-slice.json
    # chosen: medium (19/20; high adds no passes at twice the tokens)
    # exception: multi-scenario forecasts route to high
    # rerun: on any model change, or monthly
    VerifyYour route has a documented effort level, an exception rule if you need one, and a date for the next sweep.
Check your understanding
Q1. Your sweep on 20 cases: low passes 17, medium 19, high 19. Medium uses half of high's output tokens. What do you ship?
Q2. You tuned effort on Claude Opus 5 last spring. Why rerun the sweep after moving to Opus 5.5?
Q3. At medium effort, four tricky cases fail. The thinking summaries show the model misread what the task asked. What's the better next move?
· Tick off the 6 step(s) above.
· Work through the 3 remaining exercises above (stuck? each one can show you the answer).
· Score 100% on the quiz.
Vocabulary in this lesson

Plain-English definitions from the AI Coding Dictionary.