A small Claude Code plugin that stops an agent from giving up early. It targets three specific, infuriating behaviours:
- Parking work for time-of-day reasons — "it's late, go to bed", "let's park this for tonight", "pick it up tomorrow". An always-on agent has no bedtime; the user's clock is irrelevant to it.
- Leaving the job half-done —
TODOstubs, placeholders, "the rest is similar", or claiming "done" without verifying. - Silently overriding an explicit rule by assumption — then admitting "I ignored the rule because I assumed it didn't apply."
Two mechanisms, because a prompt alone can be ignored (which is failure mode #3):
| Mechanism | Hook | What it does |
|---|---|---|
| Doctrine injection | SessionStart |
Prints agent-persistence.md into context every session — on startup, resume, clear, and compact (so it survives context compaction, exactly when laziness creeps back). |
| Backstop | Stop |
When the agent tries to end a turn while parking work ("continue tomorrow", "it's late"…), it returns {"decision":"block"} so the agent gets one more turn to actually finish. |
The Stop hook is safe by design: it blocks at most once per stop sequence
(honours stop_hook_active, so no infinite loops), fires only on explicit
deferral language, and never crashes a turn.
claude plugin marketplace add tkwong/agent-persistence
claude plugin install agent-persistence@agent-persistenceRestart your Claude Code session to activate (plugins load at session start).
To roll out across many machines, add this to each box's ~/.claude/settings.json:
{
"extraKnownMarketplaces": {
"agent-persistence": {
"source": { "source": "github", "repo": "tkwong/agent-persistence" }
}
},
"enabledPlugins": {
"agent-persistence@agent-persistence": true
}
}-
Disable the Stop-hook backstop (keep the doctrine injection) for a box or session — e.g. an autonomous supervisor agent that is supposed to yield:
export AGENT_PERSISTENCE_NO_STOP_HOOK=1 -
Edit the doctrine:
agent-persistence.mdis the single source of truth. -
Tune the quitting-phrase detector: the regex lives in
hooks/stop-guard.sh.
There is a real tension between "never stop early" and "don't silently assume." This plugin resolves it by separating two cases:
- Ambiguity in the task → make the most reasonable assumption, state it, and keep going.
- An explicit rule → never override by assumption; follow it, or surface the conflict before acting.
Persist through the work, but never assume past a rule.
- Anthropic ships persistence guidance for autonomous-loop mode
(
CLAUDE_CODE_LOOP_PERSISTENT), but not for normal interactive turns — which is the gap this fills. double-shot-latte(Jesse Vincent / Superpowers) uses a Stop hook + Claude-judged decisions to suppress "would you like me to continue?" interruptions — a more general take on the same backstop idea.- Superpowers'
verification-before-completionand the Karpathy guidelines cover the "claim done when not / surface assumptions" half.
MIT © 2026 Benjamin Wong