Agent support · Hooks & Lifecycle

Observe compaction window

Hooks that fire before and after context window compaction — preserve critical state, log what gets summarized, or block compaction

Baseline Newly available Fully supported by every tracked agent since May 2026, when Codex added it. Widely available from Nov 2026. Based on web.dev's Baseline
Observation Hooks Hooks & Lifecycle
Supported
Partial
No
Unknown
Not released
Claude Code Current · Oct 2026
Codex Current · Oct 2026
GitHub Copilot Current · Oct 2026
Cursor Current · Oct 2026
OpenCode Current · Oct 2026
1.0.48 - 2.1.311
0.131.0 - 0.164.0
1.0.5 - 1.0.103
2.4 - 3.27
1.0.165 - 1.19.4
0.2.31 - 1.0.47
0.2.0 - 0.130.0
0.0.374 - 1.0.4
1.7 - 2.0
0.7.2 - 1.0.137
—
—
—
0.45 - 1.3
0.1.30 - 0.3.127

Supported by all 5 agents.

HoverTap any cell for version details.

Agent event mapping

  • claude-code PreCompact, PostCompact
  • codex PreCompact, PostCompact
  • copilot preCompact
  • cursor preCompact
  • opencode experimental.session.compacting, session.compacted

Sub-capabilities

  • PreCompact: save state or block compaction if in a critical section
  • PostCompact: reinject lost context or verify information survived
  • Claude Code: PreCompact can block via exit code 2; PostCompact fires after completion
  • Cursor: preCompact is observational (non-blocking)