Claude Code tags gateway requests by class and agent

Claude Code 2.1.273, released on September 15, can attach five headers to the requests it sends through an LLM gateway: x-claude-code-request-class, x-claude-code-agent-type, x-claude-code-prev-tool-durations, x-claude-code-compaction and x-claude-code-context-compacted. They are off by default. To turn them on, set CLAUDE_CODE_GATEWAY_HINT_HEADERS=1.
The headers are the first item in the release notes on GitHub, which list several dozen changes. Most of the others are fixes, including auto-compact firing at about half the real context window, two gaps in the permission checker, and errors on Bedrock, Vertex and Foundry that told people to run /login.
What the gateway gets
An LLM gateway is a proxy an organization runs between Claude Code and the model provider. Claude Code signs in to the gateway with a credential the organization issues, in place of a personal claude.ai login, Anthropic’s documentation explains. Administrators can push the gateway address and credential out through managed settings, device management or an apiKeyHelper, and Claude Code reads them at startup.
Routing to a gateway takes one variable. With ANTHROPIC_BASE_URL set, every request the CLI makes goes to that URL, including agentic sub-loops and background calls. ANTHROPIC_AUTH_TOKEN is sent as the Bearer token in the Authorization header, and ANTHROPIC_API_KEY is sent as x-api-key.
According to the release notes, the new headers carry the request’s class, the type of agent that sent it, how long the previous tools took to run, and the state of compaction (the step where Claude Code summarizes the conversation to free up context).
Model discovery through a gateway is also off by default. CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 makes the client query the gateway’s /v1/models endpoint at startup and add the models it finds to the /model picker. It is off by default so that gateways behind a shared API key don’t show every model the key can reach.
Two other changes in the release affect usage and diagnostic reporting. With OTEL_LOG_TOOL_DETAILS=1, cost and token metrics now include the real names of agents, skills, plugins and MCP servers. /bug and /feedback reports now take only the model-behavior parameters (model, system prompt, tools) from the last API request and leave out request metadata and any CLAUDE_CODE_EXTRA_BODY fields. In 2.1.268, Claude Code made /cost match the gateway’s rates.
Context and cache
The context meter and auto-compact counted advisor-tool turns at roughly twice their real context size. As a result, auto-compact fired at about half the real window.
/login, /upgrade and /extra-usage discarded earlier thinking from the conversation, so the next request had to rewrite the whole prompt cache. That is fixed. Long sessions should also respond faster, because hook progress and sub-agent activity no longer reprocess the whole conversation on every update.
Two fixes deal with agents whose results went missing. Sub-agents and background agents were reported as failed, and their results were never delivered, when the final streamed reply had no token usage or no model id. Separately, SDK and --output-format stream-json output dropped a subagent’s remaining messages and final report if it was moved to the background mid-run, for example by CLAUDE_AUTO_BACKGROUND_TASKS.
Permission checker
Under permissions.blockReadsOutsideWorkingDirectories, Bash commands the permission checker could not fully analyze skipped the prompt. In bypass mode, a subshell could hide a dangerous rm. Both are fixed. With the same setting on, a memory directory chosen by a repository’s settings is no longer loaded into the prompt, recalled, indexed or used by memory extraction.
One change from 2.1.268 has been reverted. That release checked Read and Edit deny rules on Bash lines the checker can’t analyze, such as eval or env -C. Commands like time -p make build now prompt again instead of being denied.
Administrators get two fixes. allowManagedMcpServersOnly, deniedMcpServers and disableClaudeAiConnectors were ignored when set through MDM or managed-settings.json if server-managed settings were also present. And skills synced from claude.ai stayed available after an organization turned Skills off. They now go to the recoverable trash. On macOS, Read no longer refuses a dragged-in screenshot, or any file the system reports under a second path, with “symlink resolution changed after permission was checked”.
Remote Control, MCP and smaller fixes
A session started with claude --remote-control or /remote-control can now be forked from the Claude app, and the fork runs as a background session on your computer. If an MCP server disconnects mid-session and automatic reconnection gives up, a notification now says so and points to /mcp. If an MCP server’s sign-in expires, the error now says how to re-authenticate.
Other changes in the list:
- Scheduled tasks saved in
.claude/scheduled_tasks.jsonno longer run in the wrong session after the file is copied into another folder, such as a new worktree. - Artifact database updates can remove a single field instead of rewriting the whole document. A publish whose connection drops after it reaches claude.ai is now re-sent safely, without failing or creating a duplicate version.
- Code Review no longer ignores a whole REVIEW.md because of an @-mention, a code span wrapped across lines or a backticked HTML tag. Only lines linking to changed files are withheld.
- After a GitHub error, a retry of
/ultrareview --postposts the findings comment exactly once, and the comment names the reviewed commit. - In Slack, Claude Tag now starts watching related public channels on its own, such as an incident channel a conversation depends on. Replying in an older thread while Claude is mid-task no longer sometimes restarts the work and loses changes that had not been pushed.
- Signing in with a Claude account now also requests access to your claude.ai plugins.
- In VS Code on Windows, the red “Claude Code process exited with code 4294967295” banner no longer appears after completed turns.
Bedrock, Vertex and Foundry
On these three platforms, 401 and 403 errors, along with 403s from the Claude apps gateway, used to tell you to run /login. The message now names the credential to refresh or points you to your gateway administrator. In-session SSL certificate and proxy errors now give the error code and what to fix, such as NODE_EXTRA_CA_CERTS for an untrusted corporate CA.
Auto mode on Bedrock, Vertex and Foundry now uses the local classifier by default, “for now” in the words of the release notes. To use the platform’s server-side classifier, set CLAUDE_CODE_AUTO_MODE_SERVER=1.
Up next
Leaked Claude Code Hub lists local and cloud sessions, Video
Per TestingCatalog on Threads, Claude Desktop may gain a Claude Code Hub that lists local and cloud sessions in one view, each with its own model, effort and permission mode. Anthropic hasn’t announced it.
Related stories
- Claude Code 2.1.269 grades plugins with a scored eval run
- Claude Code 2.1.274 warns before memory turns critical
- Claude Code opens network hosts one command at a time
- Claude Code 2.1.318: login expiry warning, runner log change
- Claude Code 2.1.312 stops overwriting big CLAUDE.md files
- Claude Code 2.1.311 compacts past 200K instead of stopping
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

