Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By joeblackwaslikeMITIn 1 marketplace
Intercepts /compact and generates a structured session handoff instead of lossy compaction
You run one by typing its /name in Claude Code.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Keep the part that mattered.
A Claude Code plugin that intercepts /compact and generates a structured session handoff instead of letting Claude discard your context.
[!NOTE] Backed by Anthropic's own guidance on context: models are trained to track and use their remaining context precisely — but response quality degrades well before that budget runs out. See context awareness in Claude's prompting best practices and Effective harnesses for long-running agents.

Install · Usage · How It Works
Claude Code's /compact command frees up context window space by summarizing your session and discarding the rest. It fires automatically once your context fills up (~83.5% by default) — no warning, no confirmation. The summary is lossy: exact file paths, the reasoning behind a decision, the fix you already found for a tricky bug — all of it can vanish into a paragraph of prose.
You've felt this: deep into a debugging session, root cause finally identified, fix half-written — then /compact fires. The new summary knows that you were debugging auth, but not the one-line fix you'd already found. You re-derive it from scratch.
anti-compact intercepts Claude Code's PreCompact hook, generates a structured handoff through an isolated claude -p call, and either blocks the lossy compaction or lets it proceed — depending on which mode you've enabled.
See docs/how-it-works.md for the full technical breakdown — transcript parsing, token estimation, subprocess isolation, and fallback behavior.
Auto-interception — /compact fires mid-session, anti-compact catches it, blocks it, and hands you a structured continuation prompt instead:
$ # ...three hours into a migration...
⚠ context window at 83.5% — anti-compact intercepted /compact
# [anti-compact] Pre-Compact Handoff
...
On-demand handoff — before a natural break, generate a handoff without waiting for auto-compact:
/anti-compact:handoff
Resume in a new session — paste the handoff into a fresh session and continue with full context, no re-deriving anything:
$ claude
> [paste the handoff prompt]
Want to see the difference yourself? case-study.md walks through a reproducible before/after in under 5 minutes — no special setup beyond Claude Code itself.
Inside a Claude Code session:
/plugin marketplace add joeblackwaslike/agent-marketplace
/plugin install anti-compact@agent-marketplace
Or from a shell:
claude plugin marketplace add joeblackwaslike/agent-marketplace
claude plugin install anti-compact@agent-marketplace
Restart your session for the plugin to take effect.
/anti-compact:handoff
Generates a handoff for the current session and displays it in a fenced block ready to paste.
/anti-compact:handoff auto
or
/anti-compact:handoff on
From now on, every /compact call is intercepted — a handoff is generated and compaction is blocked.
/anti-compact:handoff off
/compact returns to normal behavior.
claude available in PATH (used to generate the handoff)By default, Claude Code auto-compacts at ~83.5% context — well past where response quality starts to degrade. CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=65 is a reasonable starting point that leaves real working room while triggering before quality drops. See docs/how-it-works.md#tuning-when-it-fires for the full rationale and how to set it.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
anti-compact@agent-marketplace is listed by joeblackwaslike/agent-marketplace — review the source before installing
npx claudepluginhub joeblackwaslike/agent-marketplace --plugin anti-compactPlugins from other owners that cover similar ground