self-compact

by StevenLi-phoenix · ★ 0 · updated 22 days ago

Status lineGuardsPromptTools & agentswarnings

0

Gives Claude a compact_context tool: it decides when to compact, the mod compacts once the turn ends, only past the idle-compaction size, reminds it past 300k tokens, carries on with the work it names, and a Stop hook such as /goal cannot hold it back

install self-compact

Install

git clone https://github.com/StevenLi-phoenix/claude-code-self-compact-plugin
claude --plugin-dir ./claude-code-self-compact-plugin

Then run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.

View source on GitHub

What it hooks into

From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.

Events
session.starttool.callprompt.submitclassic.Stopturn.startturn.complete
API calls
$.clock.after$.env.get$.prompt.submit$.session.compact$.session.usage$.tool.register$.ui.log$.ui.status$.ui.toast
Can see
mcp__self-compact__compact_context callsevery promptevery tool callclassic hooks
Reach
level 2 of 3 drives Claudereads env varsdraws

Origin

How it got here
Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
Repository
github.com/StevenLi-phoenix/claude-code-self-compact-plugin
Path in repo
repository root
Source commit
bfa8c97 the exact code the scan read
Author
@StevenLi-phoenix
License
No license declared — ask the author before reusing code.
First published
Last pushed
First listed here

Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.

Other mods in Status line, close to this one by stars.