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 zach-sourcev1.3.0MITIn 1 marketplace
Refuses prompts on a stale session whose prompt cache has lapsed, and keeps MCP server config unshadowed
Run automatically on Claude Code events. Claude doesn't decide.
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.
Keeps long sessions from quietly getting expensive.
| Event | Script | What it does |
|---|---|---|
| UserPromptSubmit | session-staleness.py | Blocks (exit 2) the prompt when a resumed session's prompt cache has lapsed and the context is big enough for the miss to hurt, forcing a /compact first |
No hook output can trigger compaction directly, so refusing the submission is the closest available behaviour.
| Env var | Default | Meaning |
|---|---|---|
CLAUDE_STALE_BLOCK | 1 | 0 = warn instead of block |
CLAUDE_CACHE_TTL_SECONDS | 300 | Raise to 3600 if you have extended cache TTL |
CLAUDE_STALE_MIN_TOKENS | 200000 | Below this, never block |
CLAUDE_STALE_SETTLE_SECONDS | 3 | Re-read delay, to let an in-flight /compact land |
At the 300s default any five-minute pause on a large session refuses the next prompt. Set the TTL to the cache you actually have.
python3 test-session-staleness.py drives the whole herdr compact-and-resend path against a
synthetic stale transcript with a fake hc (Herdr app, HC_TERMINAL_ID) or herdr (herdr
TUI, HERDR_PANE_ID) on PATH. It asserts that the prompt is refused (exit 2). Then it
asserts that ctrl+c (to clear the refused prompt, which Claude Code puts back in the input
box), /compact and the refused prompt are dispatched, in that order. The app wins when
both env vars are set. The dispatch is detached and sleeps before typing, so the test polls rather
than assuming it has run by the time the hook exits.
No pytest needed — it runs standalone, and nix flake check runs it.
scripts/sync-mcp-servers.sh strips mcpServers out of ~/.claude.json, where it shadows
~/.claude/mcp_servers.json. Not wired as a hook — run it by hand or drop it on PATH.
python3, jq.
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.
npx claudepluginhub zach-source/claude-marketplace --plugin session-hygienePlugins from other owners that cover similar ground