Issue · 2026-11-09 · Claude Code · Releases · Workflows · Security
Claude Code 2.1.318 Fixes and a Compaction Tuning Workflow
I spent part of this week reading release notes so you can skip the 80-line ones. This issue covers a big Claude Code point release, a way to control when your context gets compacted, and a small verifier for the "exit code 0, nothing happened" problem. There is also one setting worth checking in Codex today.
What changed
Claude Code v2.1.318 is mostly fixes, and a few matter if you run claude -p in scripts or cron.
- Added:
claude auth statusnow shows when your stored claude.ai sign-in ends (loginExpiresAt),claude -pJSON results includecredential_expires_at, andclaude -ptext output prints a one-line stderr warning starting 10 days before it ends. - Fixed:
claude -pand Agent SDK sessions reporting success when an API error cut off a reply while a mod hookedturn.step. - Fixed: custom slash commands that fail, or that only Claude can invoke, printing nothing in
claude -pand SDK sessions. - Fixed: non-interactive launches silently replacing a
~/.claude.jsonthat isn't valid JSON with defaults. The start now fails and tells you how to restore the file. - Changed: background subagents now move a shell command to the background after 3 minutes on all providers, so the prompt cache doesn't expire while it runs.
What to do about it: update, then run claude auth status on any machine that runs unattended jobs. A sign-in that expires quietly is the kind of failure you find at 2am. If you wrap claude -p in scripts, grep your logs for the new stderr warning. I have not tested these fixes myself; this is straight from the changelog.
Workflow of the week: tune when Claude Code compacts
A r/ClaudeCode thread is making the rounds. Its title claims two lines of compaction settings let the poster work through three 5-hour usage windows without running out. I could not open the post to check the details, so treat the claim as unverified. The underlying idea is testable, though, and there is a built-in way to do it.
According to this write-up on autoCompactWindow (a third-party guide, not Anthropic docs), the setting controls how full the context can get before Claude Code summarizes the conversation on its own.
- Run
/autocompactin a session. It shows the current value and where it comes from, for examplefrom settings. - Set a window. The command accepts values like
200000,500k, or1M, and rejects anything outside 100K to 1M:/autocompact 300k - Work normally for a day on one long task and note when compaction fires and whether the agent loses decisions you made earlier.
- To revert, run
/autocompact auto. That resets only the current model.
Gotchas from the same write-up: the real threshold is the smaller of your window and the model's maximum context. The environment variable CLAUDE_CODE_AUTO_COMPACT_WINDOW wins over everything else, so if /autocompact seems to do nothing, check your shell. Since v2.1.288 the command saves per model under modelSettings.<model>.autoCompactWindow. And lowering the window is not a guaranteed token saving: Claude Code itself warns that overriding auto "may result in high token usage, especially when resuming long sessions." Measure before you believe anyone's numbers, mine included.
Copy this: a verifier for "exit code 0" tool calls
Balanov/verdict is a small local classifier (the README says 197 KB, CPU only, no Python dependencies, Apache-2.0). It reads a CLI command, its exit code, stdout and stderr, and returns success, failure, blocked or unknown. The pitch is that pytest exiting 0 after "collected 0 items" is not a pass.
Install and try it:
git clone https://github.com/Balanov/verdict.git
cd verdict
python -m pip install .
printf 'collected 0 items\nno tests ran\n' | verdict --command 'pytest tests/' --exit-code 0
Caveats, all from the README: it is a research preview and advisory only. The 93.2% accuracy figure is on 192 held-out synthetic examples, not real agent traces. The README does not cover Claude Code hooks, so wiring it into a PostToolUse hook is your own script, and I have not built one. My plan is to log its labels for a week without blocking anything, and see how often it says unknown. Keep your real test runs as the source of truth.
Worth your time
- OpenAI seems to be silently re-enabling model training on Codex chats: one user's report, with other commenters describing the same, and no statement from OpenAI on the page. Check your own data-sharing setting in Codex today if your code is sensitive.
- Best Agent Memory MCP: a CC0 comparison of 25 memory MCP servers. The maintainer ranks their own product first and most benchmark numbers are self-reported, so use it as a catalog, not a verdict.
- Message threads in the Messages API: public beta, send the conversation once and then only new messages. It cuts time to first token (a reported 35% median drop at 500k to 1M tokens), not token usage. Relevant if you build your own agents, not if you use Claude Code.
- If in doubt, delete the uv.lock file: Simon Willison's fix for confusing dependency errors on Python 3.15, where a stale lock pinned a package with no 3.15 wheel. Cheap thing to tell your agent when a build fails for no clear reason.
Reply and tell me
Do you let your coding agent auto-compact, or do you compact by hand? Reply with what you do and what went wrong the last time context got summarized at the wrong moment.