Feature request: auto-checkpoint and context refresh at configurable threshold

Resolved 💬 3 comments Opened May 5, 2026 by ns-jisorce Closed Jun 25, 2026

Problem

When working on long multi-step tasks (especially with subagents that inflate context quickly), the conversation quality degrades as context fills up. Today the only option is:

  1. The agent manually notices it's near the limit
  2. The agent writes a checkpoint file
  3. The user manually types /clear
  4. The user manually pastes "Resume from <checkpoint-path>"

Steps 3 and 4 require user intervention for what should be an automatic process. The agent can miss the threshold (as it did for me today), and the user shouldn't need to babysit context management.

Proposed Solution

A configurable setting that triggers automatic context management:

{
  "contextManagement": {
    "autoCheckpointThreshold": 0.6,
    "checkpointDir": "~/.cache/claude/states/",
    "autoResume": true
  }
}

When context remaining hits the threshold:

  1. System automatically runs a checkpoint protocol (saves session state to a file)
  2. System performs compaction or clear
  3. System resumes from the checkpoint — transparently to the user

Alternatively, expose a hook event like context_threshold_reached that users could wire up to custom behavior.

Workaround Today

A memory rule that tells the agent to proactively #save and suggest /clear — but this relies on the agent remembering to check, which is unreliable especially after large subagent returns that rapidly inflate context.

Context

Working on a large Chromium/GStreamer codebase with frequent subagent delegations (planner, coder agents). A single planner agent return can add 80k+ tokens to context, blowing past any threshold the agent was supposed to monitor.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗