Skip to main content
The Reasoning Backbone unifies how ChatCLI asks “think harder” across different providers. Anthropic exposes extended thinking with thinking_budget in tokens; OpenAI o-series exposes reasoning effort as the low/medium/high enum. The pipeline abstracts this into SkillEffort and auto-attaches it to ctx before each LLM call from reasoning-heavy agents.
The cross-provider abstraction is pre-existing in llm/client/skill_hints.go. What the pipeline adds is: auto-attach policy (auto for listed agents), session override via /thinking, and exposure in /config quality.

The existing abstraction (pre-pipeline)

llm/client/skill_hints.go:
Providers read from ctx via client.EffortFromContext(ctx) inside their SendPrompt, translate to the native field, and send.

Auto-attach: what the pipeline adds

applyAutoReasoning(ctx, cfg ReasoningConfig, agent WorkerAgent) context.Context:
EffortForBudget translates cfg.Budget (tokens) to the nearest SkillEffort tier:
Default CHATCLI_QUALITY_REASONING_BUDGET=8000EffortHigh (8000 thinking tokens on Claude, reasoning.effort=high on OpenAI).

Three modes

Effort hint is attached only for agents in AutoAgents. Mechanical agents (formatter, shell) don’t pay for pricier thinking.

Resolution priority

For an LLM call inside a worker, the effort hint resolves in this order (later wins):
1

Skill frontmatter

If the turn activated a skill with effort: high, that hint is already on ctx before the dispatcher.
2

Agent default

PlannerAgent has embedded effort="high"; dispatcher attaches via WithEffortHint.
3

CHATCLI_QUALITY_REASONING_*

applyAutoReasoning only attaches if (1) mode isn’t off and (2) ctx doesn’t already have an effort hint.
4

/thinking session override

In chat (cli_llm.go) and the orchestrator turn (agent_mode.go), cli.applyThinkingOverride(skillEffort) wins over everything above for that turn.
This means /thinking off can force zero thinking even if the agent has high default. Useful for turns where speed matters more than quality.

/thinking — the slash

The override lives in cli.thinkingOverride:

Providers that support it

Why two Anthropic rows: starting with Opus 4.7, Anthropic dropped budgeted extended thinking and only accepts thinking:{type:"adaptive"} — sending budget_tokens to 4.7 / 4.8 returns HTTP 400. ChatCLI dispatches by reading the catalog’s adaptive_thinking capability flag, so the same effort: high hint gets translated to the right shape per model automatically. Adding new adaptive-only models in the future is a catalog-only change.
CHATCLI_QUALITY_REASONING_MODE=on with a provider that doesn’t support it is a no-op — ctx has the hint, provider doesn’t use it, zero failures. You only pay for real capability.

Environment variables

Per-agent override

Each agent also has its own default via BuiltinAgentMeta:
The flow: dispatcher reads agent.Effort() → if non-empty, attaches via WithEffortHint. This wins over applyAutoReasoning (see priority step 2).

Interaction with skill effort hints

Skills can declare effort in frontmatter:
When the skill is activated (auto or via /skill), skillEffortHint is set and propagated. The order becomes:
Skills and reasoning backbone are orthogonal and composable. Skill says “the whole task needs high effort”; quality says “these specific agents always think”; the user can override with /thinking.

Observability

/config quality shows the state:
In worker logs, each LLM call with active effort shows up as:

Cost

Thinking tokens are billed separately on Anthropic (output-priced). An 8000-token budget adds ~$0.12/call with Sonnet. Reasoning effort on OpenAI also increases output tokens.
Recommended budget strategy:

Troubleshooting

  1. Check /config quality — confirm CHATCLI_QUALITY_REASONING_MODE != off
  2. Check CHATCLI_QUALITY_REASONING_AUTO_AGENTS includes the running agent
  3. Check provider logs — thinking_budget should appear in the request body
  4. For Anthropic via OAuth: needs beta header interleaved-thinking-2025-05-14 (already on in claude_client.go:46)
Correct! /thinking on is valid for the next turn — the flag stays until cleared with /thinking auto or /thinking off. Each /thinking replaces the previous one.
The default budget (8000) is calibrated for Sonnet. For Opus or GPT-5, consider lowering: CHATCLI_QUALITY_REASONING_BUDGET=4000. Or use mode=off and trigger manually with /thinking only when it makes a difference.

See also

Multi-Agent Orchestration

How effort hints flow from the dispatcher into parallel workers.

Skills and Registry

How skills declare effort: in frontmatter.

OpenAI Responses API

Official docs for reasoning.effort.

Anthropic Extended Thinking

Official docs for thinking_budget.