Skip to content

Context budget: conversation history replay is expensive in long sessions #452

Description

@JustAGhosT

Problem

Long sessions involving debugging, code archaeology, implementation, and follow-up accumulate expensive conversation history. Claude Code compresses automatically near context limits, but by that point the session is already degraded:

  • Responses slow down as context grows
  • Earlier context gets compressed/lost at the worst time
  • Cost per turn increases linearly with history

Proposed Solutions

  1. Session segmentation guidance — retort docs should recommend session boundaries (e.g., "start a new session after completing a feature, not mid-debug"). The /handoff command already exists but isn't enforced.
  2. Context usage indicator — retort healthcheck or a session hook could warn when estimated context usage exceeds 50% of the window ("Consider starting a fresh session").
  3. Subagent offloading patterns — document when to use Agent tool to offload expensive research to subagents (isolated context) vs doing it inline. retort's agent team specs could include guidance on this.
  4. History-aware /handoff — enhance handoff to produce a minimal continuation prompt that captures decisions + state without replaying the full conversation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions