[BUG] Context Loss Bug in v2.1.3/2.1.4
Status Fixed / completed
Reported on v2.1.4
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 6 comments · opened Jan 11, 2026 · closed Jan 18, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
After a few prompts, Claude Code loses ALL context data. All memory files, agents, and rules show 0 tokens in /context output, causing API requests to fail.
What Should Happen?
Context should remain loaded during entire session. Memory files, agents, and rules should show their actual token counts (typically hundreds to thousands of tokens each, not 0).
Error Messages/Logs
/context output showing complete context loss:
❯ /context
⎿ Context Usage
⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ claude-opus-4-5-20251101 · 0k/200k tokens (0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Skills: 53 tokens (0.0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Free space: 155k (77.5%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ Autocompact buffer: 45.0k tokens (22.5%)
Custom agents · /agents
Project
└ mariadb: 0 tokens
└ mailer: 0 tokens
└ javascript: 0 tokens
└ model: 0 tokens
└ browser: 0 tokens
└ coder: 0 tokens
└ docs: 0 tokens
└ critical: 0 tokens
└ views: 0 tokens
└ style: 0 tokens
└ analysis: 0 tokens
Memory files · /memory
└ /srv/CLAUDE.md: 0 tokens
└ CLAUDE.md: 0 tokens
└ .claude/rules/architecture.md: 0 tokens
└ .claude/rules/basics.md: 0 tokens
└ .claude/rules/css.md: 0 tokens
└ .claude/rules/projektleiter.md: 0 tokens
Skills · /skills
Project
└ todo: 29 tokens
└ doit: 13 tokens
└ status: 11 tokens
All memory files, agents, and rules show 0 tokens - complete context data loss.
API requests fail because no context is loaded.
Steps to Reproduce
- Use Claude Code 2.1.4 normally
- Wait until API requests start failing
- Run /context
- Observe: All memory files and agents show 0 tokens
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.58
Claude Code Version
2.1.4
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
Workaround:/clear temporarily fixes by reloading context, but only for few more prompts.
Permanent Fix:
Downgrading to version 2.0.58 resolves the issue completely. Related to Issue #17453 (lag problem in 2.1.3). Both issues resolve by downgrading to 2.0.58.
6 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is NOT a duplicate!
vs #17453:
vs #15076: API returns 500 errors after cumulative context threshold - this is a SERVER-side error
This issue: LOCAL memory corruption where Claude Code loses all context data in memory BEFORE making API calls
Evidence:
#15076 is API/server issue. This is Claude Code client memory bug.
This bug is unique:
Complete context data loss in Claude Code's memory management.
/contextshows ALL files with 0 tokens:This is memory corruption in version 2.1.3/2.1.4, NOT performance degradation or API errors.
Please keep open - this needs separate investigation.
Hey @konian71
The same is still in 2.1.5. There is small detail that I never overflow the context -> its not needed to be compacted because I am not even reaching 150k/200k when my issues appears. The rest looks similar so I would keep your issue as a root one.
My personal input for the bug context:
What's Wrong?
During normal usage, after sending a message (especially with higher token counts ~70-80k+), Claude Code displays a "connection failed" error suggesting internet issues (internet is working fine). After pressing Esc to cancel, running /context shows the token count dropped from ~79k to ~2k - the entire conversation context is lost.
Debug logs show:
What Should Happen?
When a connection error occurs and the user cancels, the existing conversation context should be preserved. The error recovery path should not wipe the context.
Error Messages/Logs
Steps to Reproduce
Note: Intermittent - seems related to WSL2 networking or API timeouts
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
I Don't know when EXACTLY this started. 1 month ago is the safest bet, but maybe even in January
Claude Code Version
2.1.5
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Hi @KindEmily
Thanks for the detailed debug logs and for confirming this is still happening in 2.1.5!
Your observation about the "Summarizing all X messages (~0 tokens)" entries is really interesting - it proves the context is already wiped BEFORE the summarization even runs. That's a key detail for the devs.
I downgraded to 2.0.58 and have been running stable ever since - no more context loss, no more random connection errors. Not ideal, but at least a working workaround until Anthropic fixes this.
Which version are you currently using? Did you also downgrade or are you still on 2.1.5?
Update: v2.1.12 seems to have fixed this issue. Can confirm it's working stable now.
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.