self-compact

by kzarzycki · ★ 1 · updated yesterday

ToastsGuardsPromptTools & agentswarnings

0

Compaction at task boundaries: the model can ask to compact once its turn ends. Above a fill threshold it is asked whether to, after a turn decision-model judges a finished task, or, without decision-model, with each prompt.

install self-compact

Install

/plugin marketplace add kzarzycki/claude-mods
/plugin install self-compact@claude-mods

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.submitturn.complete
API calls
$.clock.sleep$.command.run$.decision.ask$.prompt.read$.prompt.submit$.session.usage$.tool.register$.ui.toast
Can see
every tool callevery prompt
Reach
level 2 of 3 other: $.decision.askother: $.prompt.readdrives Claudedraws

Origin

How it got here
Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
Repository
github.com/kzarzycki/claude-mods
Path in repo
plugins/self-compact
Source commit
bc93977 the exact code the scan read
Author
@kzarzycki
License
A license file GitHub could not identify — read it in the repository 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.

More from kzarzycki/claude-mods

agent-hub

kzarzycki/claude-mods

Agent hub: a pane listing this session's subagents with status, model, turns and tokens, and a box to steer a running one.

★ 1PanesGuardsCommands

auto-effort

kzarzycki/claude-mods

Auto effort: the decision model rates each prompt and the turn it starts runs at that effort.

★ 1Status lineCommandsPrompt

compact-methods

kzarzycki/claude-mods

oh-my-pi compaction methods: shake (move old tool output to files, no model call) and handoff (continue from a handoff document). Use /compact shake or /compact handoff [focus].

★ 1Toasts

decision-model

kzarzycki/claude-mods

A decision model for other mods ($.decision.ask): typed questions about a state, answered by any System One endpoint (Jev by default) or a small Claude model.

★ 1CommandsAutomation

eval-kernel

kzarzycki/claude-mods

A persistent JavaScript kernel the model drives with one eval tool: state survives between cells, and cells call Claude Code tools, models and subagents.

★ 1GuardsCommandsPrompt

resume-on-stop

kzarzycki/claude-mods

Unexpected stops: when a turn ends right after saying it will act, the decision model spots it and one turn resumes the work.

★ 1ToastsPrompt

ttsr-rules

kzarzycki/claude-mods

oh-my-pi TTSR rules: a regex rule denies the tool call that would break it, with the rule as the reason; a question rule is judged after each turn.

★ 1ToastsGuardsCommands