Autocompact fires once then never again on opus[1m]; never fires for agent-team teammates (200K haiku teammates compact fine)

Status Open
Reported on v2.1.258
Maintainer reply None cached
Activity 0 comments · opened Sep 4, 2026

Environment

  • Claude Code 2.1.258/2.1.260 (native arm64), macOS, cmux + agent teams
  • settings.json: CLAUDE_AUTOCOMPACT_PCT_OVERRIDE: "80", autoCompactEnabled: true, CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: "1", teammateMode in-process
  • Models: leader + teammates on claude-opus-5[1m] (1M window); one teammate on claude-haiku-4-5 (200K window)

What happened

Long-running coding project via agent teams (1 leader + named teammates in split panes, ~16h, 400+ turns each).

| Session | Model | Peak context | Compactions |
|---|---|---|---|
| Leader | opus-5[1m] | 823K (82%) | 1 — fired at ~796K once; afterwards grew back to 823K over 5+ turns with no further compaction, no error/system entry |
| Teammate be-arch | opus-5[1m] | 931K (93%) | 0 — no compact_boundary, no <synthetic> error |
| Teammate fe-dev | opus-5[1m] | 742K | 0 (below 80%, consistent) |
| Teammate devops | haiku-4-5 (200K) | ~196K | 2 — compacted as expected |

Expected

  • Autocompact triggers repeatedly whenever context crosses the threshold (80% × window), not once per session.
  • Teammates with independent context windows should autocompact too.

Evidence (session transcripts)

  • Leader ~/.claude/projects/<slug>/2f7ebc34-*.jsonl: 541 turns; single system subtype: compact_boundary at 09-02T09:58; last turns at 817K/819K/821K/822K/823K with no compaction; no API errors in between (only unrelated session-limit synthetics hours earlier).
  • Teammate a00ee4b1-*.jsonl: 400 turns, 931K peak, zero compact_boundary / zero errors.
  • Teammate ceda62f5-*.jsonl (haiku): two compact_boundary entries at ~196K.

Notes

  • Docs say CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is a plain percentage with no once-only semantics; the 1M autocompact threshold is only documented for Sonnet 5 [1m] (967K, v2.1.257) — nothing for Opus 5 [1m] or teammates.
  • Risk: the 931K teammate hits "prompt is too long" with no warning; manual /compact in the teammate pane is the only recovery.
  • Question: is teammate autocompact expected to work in agent teams? If not, should it be documented?

Happy to attach trimmed jsonl excerpts if useful.

View original on GitHub ↗