[BUG] Auto Mode sends unsupported "afk-mode-2026-01-31" beta header causing API 400 error
Resolved 💬 3 comments Opened Mar 13, 2026 by kato-yura Closed Mar 13, 2026
Bug Description
When Auto Mode is active in the VS Code extension, Claude Code sends the afk-mode-2026-01-31 value in the anthropic-beta header, which the API rejects with a 400 error.
Error Message
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Unexpected value(s) afk-mode-2026-01-31 for the anthropic-beta header. Please consult our documentation at docs.claude.com or try again without the header."},"request_id":"req_011CYzK2HKC3cUKSrnQbCxX5"}
Root Cause
In cli.js, the afk-mode-2026-01-31 header is conditionally added when isAutoModeActive() returns true, but this value is not in the supported beta set and is rejected by the API.
Environment
- Claude Code version: 2.1.74 (both CLI and VS Code extension)
- OS: macOS (Darwin 24.4.0)
- Node.js: v22.14.0
- ANTHROPIC_BASE_URL: https://api.anthropic.com (direct, no proxy)
Steps to Reproduce
- Open Claude Code in VS Code
- Activate Auto Mode
- Send a message
- Observe API 400 error
Expected Behavior
Auto Mode should work without sending unsupported beta headers.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗