Claude Code 2.1.30x opens its system prompt with "You are a Claude agent, built on Anthropic's Claude Agent SDK.". AutoClaw's gateways answer 406 to "Claude Agent SDK" anywhere in a system prompt. The author confirmed it on both CN (managed) and overseas (autoglm-api.autoglm.ai). FLAGGED now rewrites the identity line to "You are a coding assistant.", and any other mention, along with the "the " or "Anthropic's " before it, to "the agent framework". Only system and developer messages are rewritten. User, tool and assistant text, and identifiers like @anthropic-ai/claude-agent-sdk, ClaudeAgentSDK and claude_agent_sdk, are left as they are. The CN path's refusals other than 401/403 now go through explained(), so a 406 there carries REFUSED_HINT, which now lists Claude Agent SDK.
Run at the reviewed head a9bd38b1451b745d91019bf168e72f7d3c724779:
- bun test packages/autoclaw: 25 pass.
- index.mjs reverted to main: both new tests fail. index.mjs at 4ca51de: the exact-output test fails (it catches the "assistant.." double period). Restored: green.
- Probe of unflagged()/unflag() on the identity line, "running on" and "the" variants, upper and lower case, code identifiers, and every message role: output as described above.
- Full bun test in a temp HOME under $TMPDIR: 1855 pass, 0 fail. bun scripts/check.mjs: ok.