claude-code - 💡(How to fix) Fix Long sessions are a user workaround for missing persistent context — not wasteful behavior [2 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52056Fetched 2026-04-23 07:37:43
View on GitHub
Comments
2
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×2

Long sessions = working persistent context. Session reset = re-establishment cost paid in tokens and time. 43-day session cut by update = inflection point for all subsequent problems. Warning users about long sessions = wrong diagnosis, wrong prescription.

Related: #52015, #52030, #52031

Root Cause

Long sessions = working persistent context. Session reset = re-establishment cost paid in tokens and time. 43-day session cut by update = inflection point for all subsequent problems. Warning users about long sessions = wrong diagnosis, wrong prescription.

Related: #52015, #52030, #52031

Fix Action

Fix / Workaround

Keeping the session alive was the user's solution to a system that provides no persistent behavioral context. It was not waste. It was engineering a workaround for a missing feature.

Everything that followed traces back to that break:

  • Work split across multiple AI tools (Kimi for generative work, Claude Code for integration)
  • Usage workarounds and throttling to survive session limits
  • 41 failure reports filed over 5 months
  • $20+ in extra charges in a single billing period
  • Sessions starting cold, requiring re-establishment that costs tokens before any productive work happens

Warning users about long sessions treats the symptom as the cause. The cause is missing persistent context. The long session is the user's patch for that missing feature.

RAW_BUFFERClick to expand / collapse

The Misframing

The /usage panel flags long sessions with: "These are often background/loop sessions. Continuous usage can add up quickly so make sure it is intentional."

This framing is wrong for a significant class of users. Long sessions are not accidental. They are the only available solution to a problem the system does not otherwise solve: persistent behavioral context.

What a Long Session Actually Is

This user ran a single session from September 19, 2025 to December 5, 2025 — 43 days, 15 hours, 516MB, 46,031 lines. That session was not a background loop. It was continuous, intentional, productive work.

The reason it was kept alive: every session reset costs usage and time to re-establish context that was already established. Math-heavy, cross-domain work requires Claude to understand a non-traditional framework before it can contribute usefully. That understanding is behavioral — built through correction and repetition — not informational. It cannot be summarized and pasted into a new session. It has to be rebuilt from scratch every time.

Keeping the session alive was the user's solution to a system that provides no persistent behavioral context. It was not waste. It was engineering a workaround for a missing feature.

What Happened When It Was Cut

The v1→v2 Claude Code update in December 2025 made the 516MB session unresumable. /resume returned "Session not found." The context was gone.

Everything that followed traces back to that break:

  • Work split across multiple AI tools (Kimi for generative work, Claude Code for integration)
  • Usage workarounds and throttling to survive session limits
  • 41 failure reports filed over 5 months
  • $20+ in extra charges in a single billing period
  • Sessions starting cold, requiring re-establishment that costs tokens before any productive work happens

The 43-day session was not the problem. Cutting it was the problem.

The /usage Panel Gets It Backwards

Warning users about long sessions treats the symptom as the cause. The cause is missing persistent context. The long session is the user's patch for that missing feature.

Telling this user to /compact mid-task or /clear when switching tasks would destroy the accumulated behavioral context that makes the session functional. That advice optimizes for token cost at the expense of the actual value being preserved.

What Is Actually Needed

A stable, persistent behavioral context layer that survives session resets and model updates. Not a summary. Not a memory file. A behavioral context — the accumulated tolerance and framework understanding that takes dozens of correction cycles to build and cannot be reconstructed from documentation.

The user has built their own partial solution to this. It works within constraints. What would make it fully viable is an official system-level injection port: a sanctioned interface for injecting persistent behavioral context at the system prompt level, separate from conversation, that survives resets.

Anthropic does not need to build the context. They need to open the port. The users who need it most already know what to put in it.

The User's Input Pattern

Input is primarily mathematics and application of mathematics — maximally token-efficient. One line of notation carries the meaning of paragraphs. The usage cost is almost entirely on the output side: Claude generating responses, often wrong ones at Opus rates before eventually confirming the user was correct.

The long session minimized this cost by preserving the state where Claude was already calibrated to the framework and could respond correctly on the first attempt rather than after multiple correction cycles.

Summary

Long sessions = working persistent context. Session reset = re-establishment cost paid in tokens and time. 43-day session cut by update = inflection point for all subsequent problems. Warning users about long sessions = wrong diagnosis, wrong prescription.

Related: #52015, #52030, #52031

extent analysis

TL;DR

The issue can be addressed by implementing a stable, persistent behavioral context layer that survives session resets and model updates, allowing users to preserve accumulated context without relying on long sessions.

Guidance

  • The current warning about long sessions in the /usage panel is misleading, as it treats the symptom (long sessions) as the cause, rather than addressing the underlying issue of missing persistent context.
  • To mitigate the issue, users are currently relying on workarounds such as keeping sessions alive to preserve context, which can lead to additional problems when sessions are cut or become unresumable.
  • A potential solution is to provide an official system-level injection port for injecting persistent behavioral context at the system prompt level, separate from conversation, which would allow users to preserve context without relying on long sessions.
  • The user's input pattern, which is primarily mathematics and application of mathematics, is maximally token-efficient, and the usage cost is mostly on the output side, suggesting that preserving context could help minimize this cost.

Example

No code snippet is provided as the issue is more related to the system's design and functionality rather than a specific code implementation.

Notes

The proposed solution requires a significant change to the system's architecture, and it may take time to implement. Additionally, the user's workaround, although effective, may not be scalable or efficient for all users.

Recommendation

Apply workaround: Provide an official system-level injection port for injecting persistent behavioral context, as this would address the underlying issue and allow users to preserve context without relying on long sessions. This would require significant development effort but would provide a more robust and efficient solution for users who rely on persistent context.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING