Agent Shipped

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.

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.

  1. Run /autocompact in a session. It shows the current value and where it comes from, for example from settings.
  2. Set a window. The command accepts values like 200000, 500k, or 1M, and rejects anything outside 100K to 1M: /autocompact 300k
  3. Work normally for a day on one long task and note when compaction fires and whether the agent loses decisions you made earlier.
  4. 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

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.

Get the field guide

Join builders who use coding agents every day. Free, twice a week, unsubscribe in one click.

No spam. The CLAUDE.md starter pack comes in your confirmation email. Not seeing it? Check spam or Promotions.

Related guides