Claude Code /config Key=Value: Runtime Settings Without JSON Editing

Claude Code 2.1.181 introduces /config key=value syntax for changing any setting mid-conversation—no JSON files, no restarts. For teams routing Claude through a gateway, this changes how model selection, thinking mode, and managed settings are enforced at runtime.

TheRouter Newsroomvia Anthropic
Terminal-style illustration showing /config model=opus and /config thinking=false commands transforming into settings changes in real time, representing Claude Code runtime configuration without JSON editing

What happened

Claude Code 2.1.181 shipped on June 21 with a small syntax change that has outsized implications for how teams manage model selection, thinking mode, and effort levels: /config key=value. You can now type /config thinking=false mid-conversation and it takes effect immediately — no JSON editing, no config file reload, no session restart. The syntax works in interactive mode, print mode (-p), and Remote Control sessions.

This ships alongside a dozen fixes that matter for gateway-routed deployments: prompt caching now works correctly on custom ANTHROPIC_BASE_URL and Microsoft Foundry endpoints, foreground subagents now respect the same five-level nesting cap as background agents, auto-retry now handles mid-thinking API connection drops, and a startup regression that added ~120ms to every fresh launch has been resolved.

Why it matters for AI engineering teams

Every team running Claude Code through a managed deployment knows the friction: you want to switch models or toggle thinking mode, but settings.json is under managed control. Changing it means a PR, a review, a deploy — or telling every developer to edit a local file and hope it doesn't get clobbered by the next sync.

/config key=value removes that gate. A developer can type /config effort=xhigh when a task warrants it, or /config thinking=false when reasoning overhead isn't needed. The change applies to the current session immediately and persists in the session's settings — but critically, it doesn't bypass managed-settings enforcement. If your org has locked model or effort in managed settings, those locks still hold.

For platform teams, this means shifting from "block everything, approve exceptions" to "set safe defaults, let /config handle the rest." It also opens a new integration path: Remote Control sessions can now receive /config commands programmatically, enabling automated setting adjustments from CI pipelines or notification webhooks.

The router/operator angle

For teams routing Claude Code through an AI gateway like TheRouter, the /config key=value syntax intersects with three operational concerns.

1. Model selection at the prompt level. If your gateway exposes multiple Claude models — Opus 4.8, Sonnet 4.6, Haiku — developers can now switch with /config model=sonnet without touching ANTHROPIC_DEFAULT_MODEL or managed settings. This means gateway-side model routing policies (like automatic fallback or cost-based tier selection) can coexist with developer overrides without conflict.

2. Thinking mode as a cost lever. /config thinking=false is effectively a cost-control command. On Opus 4.8, thinking tokens are billed at output rates — disabling thinking mid-session can cut token spend by 20–40% for tasks that don't need deep reasoning. Operators should track this: if /config thinking=false usage spikes during a billing period, it may signal that your default thinking setting is too aggressive for typical workloads.

3. Prompt caching fix on custom gateways. The 2.1.181 release fixed a bug where prompt caching silently failed on custom ANTHROPIC_BASE_URL endpoints. Every team routing through a gateway was paying full price for cached tokens without knowing it. If you noticed a cost bump in May–June after upgrading Claude Code, this was likely the cause. Verify with claude --debug that your gateway returns anthropic-* cache headers correctly.

What TheRouter users should watch or try

  • Audit your prompt cache hit rate on gateway-routed Claude Code sessions. The 2.1.181 fix may reveal that cache was broken silently. Check your gateway logs for X-Accel-Buffering or Transfer-Encoding: chunked headers that could have interfered with Anthropic's per-request attestation token.

  • Review managed-settings policies in light of /config key=value. If every developer has been locked out of model/effort/thinking changes, consider whether loosening those locks and trusting /config overrides would reduce friction without adding risk.

  • Test Remote Control /config integration. If you use webhook-triggered Claude Code sessions, you can now inject /config model=opus /config effort=xhigh at session start to automatically tune model selection for specific task types — no managed-settings JSON changes required.

Help & contact