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 RyanKim17920v0.2.0MITIn 1 marketplace
Gives every compaction, automatic ones included, a standing focus; keeps each summary as a brief on disk; and asks a subagent for a handoff when compaction stops paying (main keeps compacting in place) (/focus-compact).
Code that runs inside Claude Code on every session, as you, unsandboxed.
Claude Code asks for these when you enable the plugin. Sensitive values are stored in your system keychain.
Standing focusfocus
What every compaction summary is told to keep. Text typed after /compact is added after it.
stringdefault Focus the summary on: (1) what we are b…
Brief folderbriefDir
Absolute folder (or one under ~/) the compaction briefs are written under, as <briefDir>/<sessionId>/<agent-or-main>-<n>.md. Empty means compact-briefs in Claude's config folder: $CLAUDE_CONFIG_DIR/compact-briefs, else ~/.claude/compact-briefs.
1 critical to review before installing
JavaScript or TypeScript that runs inside Claude Code as you, unsandboxed. Read from its source, it sees, changes or blocks tool calls; runs programs; writes files; reads files; reads environment variables (CLAUDE_CONFIG_DIR, HOME).
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.
stringdefault
Briefs kept per conversationkeepBriefs
After each brief is written, only the newest this many of that conversation's briefs are kept. 0 keeps them all.
numberdefault 30
Show toastsshowToasts
Toast when compaction stops paying. Display only: counting, briefs and the subagent's handoff note run the same either way.
booleandefault true
Hand off afterhandoffAfter
The number of compactions of one subagent's conversation at which it is asked for a handoff. Main is never asked: it compacts as often as it needs.
numberdefault 3
Poor shrink ratiominShrinkRatio
A compaction that leaves more than this share of the tokens (after / before) asks a subagent for a handoff, and toasts for main.
numberdefault 0.6
Remove briefs older than (days)briefMaxAgeDays
Once per load, at the first recorded compaction, other sessions' briefs older than this are removed, and each folder left empty with them. 0 keeps them all.
numberdefault 30
Smallest conversation the ratio judgesminTokensForRatio
The poor-shrink rule applies only when the conversation held at least this many tokens before compaction. The count rule is unaffected.
numberdefault 50000
Gives every compaction (automatic, manual and precomputed) a standing focus, keeps each summary as a brief on disk, and notices when compaction stops paying.
focus text goes first in every compaction's instructions. Text typed after /compact goes after it and takes precedence.<briefDir>/<sessionId>/<main-or-agentId>-<n>.md. An existing file is never overwritten.handoffAfter-th compaction, or when a compaction of at least minTokensForRatio tokens keeps more than minShrinkRatio of them. Main is never asked: it compacts in place as often as it needs, and a poor shrink only toasts./focus-compact shows each conversation's count, last shrink and last brief.After adding the marketplace (see Install in the main README):
claude plugin install focus-compact@ryk-claude-mods
Or add the marketplace and install in one step:
claude plugin install focus-compact --marketplace RyanKim17920/ryk-claude-mods
A bad value (not a number, or out of range) falls back to the default.
| Option | Default | What it does |
|---|---|---|
focus | the five-point focus in plugin.json | Put first in every compaction's instructions. Empty sends none. |
briefDir | empty | Absolute folder (or one under ~/) for the briefs. Empty means compact-briefs in Claude's config folder: $CLAUDE_CONFIG_DIR/compact-briefs when that variable is set, else ~/.claude/compact-briefs. A relative path or one with .. falls back to that default. |
handoffAfter | 3 | A subagent's compaction count at which it is asked to hand off (at least 1). |
minShrinkRatio | 0.6 | A compaction keeping more than this share (over 0, up to 1) is poor. |
minTokensForRatio | 50000 | Only conversations at least this large are judged on their ratio. |
keepBriefs | 30 | Newest briefs kept per conversation. 0 keeps all. |
briefMaxAgeDays | 30 | Remove other sessions' briefs older than this. 0 keeps all. |
showToasts | true | Show toasts. Display only: counting, briefs and notes run the same. |
<briefDir>/<sessionId>/<conversation>-<n>.md.keepBriefs. Once per load it also removes other sessions' briefs older than briefMaxAgeDays, and runs rmdir on each folder it emptied. It only looks in folders named like a session id (a uuid), and only removes files named <conversation>-<n>.md whose content starts with the brief header # Compaction brief: (with /bin/rm), never any other file. So a briefDir pointed at a folder of other notes leaves them alone.$.store, a JSON file under the Claude config folder's plugins/store/): one key per session, session:<id>, so concurrent sessions never overwrite each other. Sessions not written for 14 days are dropped, the store keeps at most 50 sessions, and each session keeps at most 200 conversations. The 0.1.0 key sessions is still read for a session that has no key of its own yet. It is removed once every session in it is stale.claude plugin disable focus-compact@ryk-claude-mods
# from your clone of this repository
claude plugin test focus-compact
claude plugin validate focus-compact
The tests stand in for the engine (compaction, store, disk) and touch no real file.
npx claudepluginhub ryankim17920/ryk-claude-mods --plugin focus-compactBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground