Context Cycling¶
The reviewer runs in its own AI context window. On long sessions, that window fills up. Context cycling automatically resets the reviewer's context before it degrades, preserving continuity through a handoff summary.
How it works¶
- The reviewer's accumulated input tokens are tracked against its model's context limit.
- When token usage crosses the
threshold_pctthreshold, a cycle is triggered. - The current reviewer writes a handoff summary — a compressed account of what it's seen and any ongoing concerns.
- A new reviewer session starts with the handoff summary plus a tail of recent events.
- The old session is deleted.
This is transparent to the client and the agent. The reviewer continues monitoring with the same profile and configuration — only its memory is refreshed.
Configuration¶
| Key | Type | Description |
|---|---|---|
threshold_pct |
float | Fraction of context window usage that triggers a cycle (e.g., 0.15 = 15%). Lower values cycle more aggressively. |
tail_depth |
integer | Number of recent messages carried over into the fresh context after a cycle. |
If omitted, server defaults apply.
Manual cycling¶
You can force a context reset at any time:
This triggers the same handoff process — the reviewer writes a summary, a new session starts, and monitoring continues with a fresh context window.
When to adjust¶
- Lower
threshold_pctif the reviewer seems to lose track of context on long sessions — it means the context is filling too much before cycling. - Higher
threshold_pctif you want the reviewer to retain more history before cycling — useful for sessions where long-range context matters. - Higher
tail_depthif the reviewer seems disoriented after a cycle — carrying more recent events helps it pick up faster.
Tip
You can check the reviewer's current state with /z spy. If the reviewer's responses seem stale or repetitive, a manual /z cycle can help.