Skip to content

tkwong/agent-persistence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agent-persistence

A small Claude Code plugin that stops an agent from giving up early. It targets three specific, infuriating behaviours:

  1. 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.
  2. Leaving the job half-doneTODO stubs, placeholders, "the rest is similar", or claiming "done" without verifying.
  3. Silently overriding an explicit rule by assumption — then admitting "I ignored the rule because I assumed it didn't apply."

How it works

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.

Install

claude plugin marketplace add tkwong/agent-persistence
claude plugin install agent-persistence@agent-persistence

Restart your Claude Code session to activate (plugins load at session start).

Fleet rollout via settings.json

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
  }
}

Configuration

  • 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.md is the single source of truth.

  • Tune the quitting-phrase detector: the regex lives in hooks/stop-guard.sh.

Design note — persistence vs. don't-assume

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.

Prior art / credits

  • 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-completion and the Karpathy guidelines cover the "claim done when not / surface assumptions" half.

License

MIT © 2026 Benjamin Wong

About

Claude Code plugin: stops agents parking work for time-of-day reasons ('it's late, go to bed') and overriding rules by assumption. Always-on doctrine + safe Stop-hook backstop.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages