CertSafari
    Databricks Certified Context Engineer Associate· Lessons

    Domain 1 · Lesson 6/45

    Thinking Token Budgets and Context Window Impact for Databricks Agents

    Given a Databricks agent task and its performance requirements, select the appropriate reasoning mode (standard, extended thinking, or reduced thinking) and justify the selection based on token budget constraints and context window impact.

    6 min read
    2.29% of exam
    3 sources
    Published 3 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Size budget_tokens and max_tokens so that extended thinking fits within a request's output limit
    • Explain how reasoning tokens from earlier turns count against the input context of a multi-turn Claude Sonnet 4.5 agent, and when to leave them out
    • Choose standard, extended or reduced thinking for an agent step based on its latency, accuracy and cost requirements, and justify the choice

    1.Thinking spends the output budget

    Reasoning tokens are not free extras on top of the answer. They come out of the same output limit. The documented extended-thinking request for databricks-claude-sonnet-4-5 gives thinking a budget of 10,240 tokens inside an overall max_tokens of 20,480:

    Extended thinking on a hybrid Claude model: budget_tokens sits inside max_tokenspython
    response = client.chat.completions.create(
        model="system.ai.claude-sonnet-4-5",
        messages=[{"role": "user", "content": "Why is the sky blue?"}],
        max_tokens=20480,
        extra_body={
            "thinking": {
                "type": "enabled",
                "budget_tokens": 10240
            }
        }
    )

    Two hard rules come with this. First, budget_tokens must be less than max_tokens. A thinking budget at or above the output limit is invalid, so the predict above describes a request you need to fix. Second, bigger budgets give diminishing and less predictable returns: "Higher budgets can improve quality for complex tasks, but usage above 32K may vary." The Responses API states the same accounting directly. Its max_output_tokens is an upper bound on generated tokens "including visible output tokens and reasoning tokens". Every token you give to thinking is a token the final answer can no longer use.

    Checkpoint 1 of 3· Check yourself

    An agent step on databricks-claude-sonnet-4-6 must return a long structured answer and also reason carefully. Which configuration is valid and leaves room for the answer?

    Sources12

    2.Reasoning tokens in a multi-turn context window

    In an agent loop, the question changes from "how much does this call cost?" to "what does this call leave behind in the context?" For databricks-claude-sonnet-4-5 the documentation answers it ("This section is specific to the databricks-claude-sonnet-4-5 model."): only the reasoning blocks associated with the last assistant turn or tool-use session are visible to the model and counted as input tokens. Thinking from earlier turns does not keep piling up as input. The most recent turn's reasoning does, so a large extended-thinking budget on the latest turn makes the next request's input larger.

    You can also choose not to send that reasoning back. If the next step does not need the model to reason over its previous steps, you can omit the reasoning block entirely. That keeps those tokens out of the input context. Don't assume other models behave the same way. The documentation scopes this rule to Sonnet 4.5.

    Checkpoint 2 of 3· Check yourself

    A ten-turn tool-calling agent on databricks-claude-sonnet-4-5 uses extended thinking on every turn. Which reasoning tokens count as input on turn eleven?

    Sources1

    3.Choosing and justifying a mode for an agent task

    A sound justification has three parts: what the task needs, what setting delivers it, and what that setting costs in tokens and context. Hybrid Sonnet models are aimed at work that needs "a balance of practical throughput and advanced thinking such as customer-facing agents". In practice that means fast replies by default and thinking only on the hard steps. Claude Fable 5.1, built for long-running work, "supports per-turn effort controls and thinking updates between tool calls for sustained, complex workflows", so effort can change from step to step instead of being fixed for the whole agent.

    Matching agent requirements to a reasoning mode, with the token reasoning that justifies it
    Agent requirementMode and settingToken / context justification
    Lowest latency on a simple step (Gemini 3)Standard: reasoning_effort "minimal"Requests that use "minimal" return no reasoning tokens
    Fast routine replies on a reasoning-only model (Opus 5.5)Reduced: output_config.effort lowThinking cannot be disabled, so low is the cheapest setting
    Long-context, cost-sensitive analysis (Opus 5)Reduced: low or medium effortNear-top quality without spending output tokens on maximum reasoning
    Hard multi-step reasoning on a hybrid Claude modelExtended: thinking budget_tokens below max_tokensBudget comes out of output; above 32K, usage may vary
    Multi-turn agent on databricks-claude-sonnet-4-5Extended thinking, reasoning block omitted when not neededLast turn's reasoning counts as input tokens

    Checkpoint 3 of 3· Check yourself

    A customer-facing triage step on databricks-gemini-3-1-pro must respond as fast as possible and does not need multi-step reasoning. Which setting best fits, and why?

    Sources31

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.budget_tokens is a separate allowance on top of max_tokens, so you can set it as high as you like.Why is that wrong?

      Thinking uses up the output allowance. budget_tokens must be strictly less than max_tokens, and budgets above 32K behave less predictably.

      Covered in Thinking spends the output budget

    2. 2.With extended thinking, reasoning from every earlier turn piles up in the input context of a multi-turn agent.Why is that wrong?

      For databricks-claude-sonnet-4-5, only the last assistant turn's or tool-use session's reasoning counts as input, and you can leave even that out.

      Covered in Reasoning tokens in a multi-turn context window

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “budget_tokens must be less than max_tokens.”
      ↩︎ Thinking spends the output budget
      “This section is specific to the databricks-claude-sonnet-4-5 model.”
      ↩︎ Reasoning tokens in a multi-turn context window
      “only the reasoning blocks associated with the last assistant turn or tool-use session are visible to the model and counted as input tokens”
      ↩︎ Reasoning tokens in a multi-turn context window
      “Use "minimal" to skip reasoning for the fastest, lowest-latency responses.”
      ↩︎ Choosing and justifying a mode for an agent task
      “Higher budgets can improve quality for complex tasks, but usage above 32K may vary.”
      ↩︎ Exam trap 1
      “you can omit the reasoning block entirely”
      ↩︎ Exam trap 2
      “Requests that use "minimal" return no reasoning tokens.”
      ↩︎ Checkpoint
    2. 3.
      “specializes in applications that require a balance of practical throughput and advanced thinking such as customer-facing agents”
      ↩︎ Choosing and justifying a mode for an agent task
      “supports per-turn effort controls and thinking updates between tool calls for sustained, complex workflows”
      ↩︎ Choosing and justifying a mode for an agent task
      “it delivers near-top quality at low and medium reasoning effort, making it well suited for long-context, cost-sensitive enterprise workflows”
      ↩︎ Prediction

    Ready to test yourself?

    Practise Databricks Certified Context Engineer Associate in quiz mode.

    Spotted a mistake, or was something unclear? Tell us.