[Feature Request]: Auto-clear / context-checkpoint hook for long agent-loop runs

Open 💬 2 comments Opened Jun 13, 2026 by julesbibonimana

Problem

When running multi-step agent loops, the main orchestration thread accumulates context and eventually triggers the "Tip: Use /clear to start fresh when switching topics and free up context" notice. There is currently no way to automate a context reset or checkpoint without manual intervention — the user has to be present to act on the tip.

Use case

Long autonomous runs (e.g. scraping all 39 Rhode Island municipalities across multiple pipeline phases) where the user steps away and no one is watching to act on the tip. The sub-agents each get a clean context window, but the orchestrator thread still grows unbounded.

Request

Add one or both of:

  • (a) A hook event that fires when context reaches a configurable threshold (e.g. ContextNearLimit), so a hook can trigger /clear or a custom shell command automatically.
  • (b) A setting to auto-clear or auto-compress the orchestration context between agent-loop iterations (e.g. agentLoop.autoCheckpointContext: true).

Expected behavior

The agent loop continues running unattended without context accumulation stalling or degrading the run, with no manual /clear needed.

View original on GitHub ↗

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