Repository navigation
Description
[BUG] Context silently truncated on session resume despite autoCompactEnabled: false — 1,232 messages / 2 days of active work dropped from context
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
1,232 messages spanning 2 days of active work are silently excluded from the context window on session resume. Context dropped from ~500k tokens to ~120k tokens. Claude cannot reference or recall any of the excluded content.
The data is intact in the session JSONL file. This is a resume-time loading bug, not data loss.
This occurs despite autoCompactEnabled: false being explicitly set in ~/.claude.json.
Root Cause
The session JSONL stores messages as a linked list via parentUuid → uuid. On resume after an SSH drop, a duplicate user message was appended to the end of the file with the same uuid as a message already present earlier in the file. This creates a fork:
Line 287 (assistant, uuid=e46c07fb)
├─ Line 288 (assistant) → Line 290 (user) → ... → 2,000+ lines of real work
├─ Line 289 (user, uuid=ca566d54) ← original, leads to real work chain
└─ Line 2372 (user, uuid=ca566d54) ← DUPLICATE appended on resume
└─ Line 2373 (assistant, "No response requested.") ← synthetic placeholder
└─ Line 2374+ → what the loader actually follows
Lines 289 and 2372 share the same uuid (ca566d54). The loader appears to deduplicate by uuid using last-write-wins, lands on the duplicate at line 2372, follows it to a synthetic "No response requested." placeholder (line 2373, which has isApiErrorMessage in its keys), and continues from there. The entire branch through line 288 — containing all 1,232 messages of real work — is orphaned.
How This Happened
The session was run over SSH without tmux/screen. The laptop sleeping caused SSH drops, killing the Claude Code process. Each gap was followed by claude --continue to resume. There are 8 such drops within the affected range.
| Gap | Duration | Period |
|---|---|---|
| 1 | 6.4 hr | Thu 2:49 PM → Thu 9:10 PM |
| 2 | 11.1 hr | Thu 11:29 PM → Fri 10:36 AM |
| 3 | 2.8 hr | Fri 11:56 AM → Fri 2:44 PM |
| 4 | 1.2 hr | Fri 2:44 PM → Fri 3:55 PM |
| 5 | 2.6 hr | Fri 5:03 PM → Fri 7:37 PM |
| 6 | 2.4 hr | Fri 8:01 PM → Fri 10:22 PM |
| 7 | 9.3 hr | Fri 11:20 PM → Sat 8:38 AM |
| 8 | 6.8 hr | Sat 8:38 AM → Sat 3:26 PM |
Suggested Fix
Two separate issues need addressing:
-
Resume should not append duplicate messages. If a user message with a given
uuidalready exists in the session JSONL,--continueshould not write a second copy. This prevents the fork from being created in the first place. -
The linked list walker should prefer the branch with more descendants (or the one with real assistant responses, not synthetic
isApiErrorMessageplaceholders). Even if a fork exists, the loader should follow the branch containing 1,232 messages of real work, not the branch containing a single synthetic "No response requested."
Possible Contributing Factor
An undocumented feature flag in cachedGrowthBookFeatures in ~/.claude.json may also be involved:
"tengu_slate_heron": {
"enabled": true,
"gapThresholdMinutes": 70,
"keepRecent": 5
}
This was delivered server-side via Statsig/GrowthBook with no documented opt-out. All 8 SSH-drop gaps exceed 70 minutes. I do not have access to source code to confirm what this flag does, but the parameter names are suggestive. The Anthropic team can confirm or deny whether this flag interacts with the resume/fork behavior.
Workaround (Untested)
Deleting lines 2372 and 2373 from the session JSONL should eliminate the duplicate fork point. The loader would then follow line 288 → 289 → ... through the real work chain. I haven't tested this yet.
Steps to Reproduce
- Start a session over SSH without tmux
- Build up significant context (~500k tokens)
- Allow SSH to drop (laptop sleep) — Claude Code process is killed mid-session
- Resume with
claude --continue - Repeat steps 3–4 multiple times
- Eventually, context drops and earlier work disappears from the conversation
- Inspect the session JSONL — look for duplicate
uuidentries creating a fork in theparentUuidchain
Expected Behavior
--continueafter unclean termination should never append duplicate messages- If forks exist in the linked list, the loader should follow the branch with real content
- When
autoCompactEnabled: falseis set, no context should be silently dropped under any circumstances - If context cannot be fully loaded, a visible indicator should be shown
Environment
- Claude Code version: 2.1.87
- Platform: Linux
- Install method: native (
~/.local/bin/claude) - Model: claude-opus-4-6 (1M context)
autoCompactEnabled: false (set viaclaude config set -g)tengu_slate_heron.enabled: true (server-assigned, undocumented, no opt-out)- Session run over SSH without tmux (repeated unclean process terminations)
Related Issues
- [BUG] Resume conversation doesn't display previous messages in terminal #8937 — Resume conversation doesn't display previous messages in terminal
- Chat history loss after PC restart, /resume recovers only 20-40% of context #23800 — Chat history loss after PC restart, /resume recovers only 20-40% of context
- [FEATURE] Add --no-auto-compact command switch to Disable the auto-compaction #6689 — Feature request: --no-auto-compact command switch
- [FEATURE] Add claudeCode.autoCompact settings to control context compaction behavior #10691 — Feature request: configurable autoCompact settings
Note
The session referenced in this report involves proprietary work on a private project. I'm happy to provide the session JSONL to Anthropic engineers privately for debugging, but please do not request that it be shared publicly. The session ID and timestamps above should be sufficient to reproduce the loading behavior independently.
Activity
github-actions commentedon Mar 29, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
github-actions commentedon Apr 1, 2026
This issue has been automatically closed as a duplicate of #40319.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
privitera commentedon Apr 6, 2026
This is not a duplicate.
github-actions commentedon Apr 14, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.