long-running-harness
Skill4 starsChanged 28 days agoMITView on GitHub
Set up a multi-session autonomous coding loop the way Anthropic prescribes — a two-prompt initializer/coding split, a machine-checkable features.json with verify-before-flip, init.sh + progress-file durable state, and a session-start liveness ritual that survives context resets. Use when building a long-running or multi-session agent that must make incremental progress across many context windows without re-exploring, one-shotting, or prematurely declaring done. Implements "Effective Harnesses for Long-Running Agents". Trigger phrases: long-running agent, multi-session, autonomous build, features.json, initializer agent, session handoff, build across sessions, durable state, init.sh, progress file.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- I-Onlabs/claude-code-skillsword for word, first seen Oct 25, 2026
- Archive228/lab-skillstheir own version, first seen Aug 12, 2026
Other versions2 projects use a version of this.
Word for word · 1
- I-Onlabs/claude-code-skills★ 4100% same
Edited · 0
None found.
Wrote their own version · 1
- Archive228/lab-skills★ 8same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository169 other files it gives its agents.
- epub-skill/CLAUDE.mdCLAUDE.md
- linear-cli-skill/CLAUDE.mdCLAUDE.md
- AgentDB Advanced FeaturesSkill
- AgentDB Learning PluginsSkill
- AgentDB Memory PatternsSkill
- AgentDB Performance OptimizationSkill
- AgentDB Vector SearchSkill
- agent-evalSkill
- agentic-jujutsuSkill
- agile-product-ownerSkill
- ai-tool-pickerSkill
- algorithmic-artSkill
- api-connectorSkill
- api-design-patternsSkill
- architecture-diagram-creatorSkill
- article-extractorSkill
- aws-agentic-aiSkill
- aws-cdk-developmentSkill
- aws-cost-operationsSkill
- aws-serverless-edaSkill
- biogeobearsSkill
- brainstormingSkill
- brand-guidelinesSkill
- canvas-designSkill
- capa-officerSkill
- ceo-advisorSkill
- changelog-generatorSkill
- code-auditorSkill
- codebase-documenterSkill
- code-executionSkill
- code-explainerSkill
- code-refactorSkill
- code-reviewerSkill
- code-transferSkill
- content-creatorSkill
- content-research-writerSkill
- conversation-analyzerSkill
- csv-data-summarizerSkill
- cto-advisorSkill
- d3-vizSkill
- dashboard-creatorSkill
- defense-in-depthSkill
- deploy-itSkill
- developer-growth-analysisSkill
- dispatching-parallel-agentsSkill
- doc-coauthoringSkill
- docxSkill
- domain-name-brainstormerSkill
- dwa-councilSkill
- error-fixerSkill
- escalation-reasoningSkill
- evaluator-optimizerSkill
- executing-plansSkill
- extract-from-pdfsSkill
- fda-consultant-specialistSkill
- feature-planningSkill
- file-operationsSkill
- file-organizerSkill
- finishing-a-development-branchSkill
- firebase-buddySkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Read git log + claude-progress.txt — reconstruct what happened, don't re-explore.
- Very specific: line 37
Liveness health-check: run ./init.sh, drive the app end-to-end (Playwright/Puppeteer MCP: real user action → observe result).
- Very specific: line 39
Read features.json; pick the single highest-priority passes:false feature.
- Very specific: line 41
Verify against its steps end-to-end.
- Very specific: line 42
Commit with a descriptive message.
- Very specific: line 72
Use evaluator-optimizer for the per-feature verify (separate skeptical checker).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Long-Running Harness (Anthropic's durable-state loop)
Anthropic's empirical finding: "compaction isn't sufficient … even Opus 4.5 running in a loop
across multiple context windows will fall short if it's only given a high-level prompt." Durable
on-disk artifacts — not summarization — are what survive. This skill operationalizes their canonical
harness. (Source: anthropic.com/engineering/effective-harnesses-for-long-running-agents; the full
prescription is in plans/anthropic-loop-harness-playbook.md.)
The two failure modes this kills
- Over-ambition — the agent tries to one-shot the app, runs out of context mid-feature, leaves it half-done. → fixed by one feature at a time.
- Premature completion — a later session "sees that progress had been made, and declares the job
done." → fixed by the features.json
passesledger (verify-before-flip).
The two-prompt split (same system prompt + tools; only the first user prompt differs)
Initializer (runs ONCE). Expand the high-level goal into the scaffold, then STOP — do no feature work:
features.json— every feature seededpasses:false(the full outline of "done").init.sh— boots the dev server + runs a basic end-to-end smoke test (saves tokens every session).claude-progress.txt— the running work log (seed it).- the initial git commit (the baseline to revert to).
Templates: templates/init.sh, templates/claude-progress.txt, and the verify-before-flip schema at
../loop-designer/references/features-json.template.json.
Coding agent (every session after). Runs the session-start ritual below, works ONE feature, leaves clean state. Identical prompt each session — the files, not the context, carry continuity.
The session-start ritual (put this in the coding-agent prompt / CLAUDE.md / loop.md)
pwd— confirm the only-editable directory.- Read
git log+claude-progress.txt— reconstruct what happened, don't re-explore. - Liveness health-check: run
./init.sh, drive the app end-to-end (Playwright/Puppeteer MCP: real user action → observe result). If broken, fix that FIRST before any new feature. - Read
features.json; pick the single highest-prioritypasses:falsefeature. - Implement that one feature only.
- Verify against its
stepsend-to-end; flippasses:false→trueonly on success. - Commit with a descriptive message; append a
claude-progress.txtentry; leave merge-clean state.
The features.json contract (the anti-premature-completion ledger)
- One object per feature:
{category, description, steps[], verify{command,expected}, passes}. - The coding agent may edit ONLY the
passesboolean — never add, remove, or reword entries. Header rule (verbatim Anthropic): "It is unacceptable to remove or edit tests because this could lead to missing or buggy functionality." - Flip to
trueONLY after end-to-end verification, never when code is merely written. - JSON, not Markdown — "the model is less likely to inappropriately change or overwrite JSON files."
- A "done" claim while any
passes:falseremains is a premature-completion violation (the Ralph-Wiggum guard). Now hook-enforced:fabric_stop.pyemits a FEATURES GUARD advisory at every Stop when an in-scopefeatures.jsonhaspasses:falseitems (file-gated → dormant when absent). Also check on demand with~/.claude/bin/check-features-complete(exit 1 = features still failing), or wire it as a hardStopblock via--stop-hookmode (exit 2) per the script's header.
Durable state (disk > context)
- git = the revert/recover state machine (descriptive commits; revert bad changes to a working state).
claude-progress.txt= human-readable session log (see template for the per-session schema).features.json= the machine-checkable completion ledger.- (SDK/API path) mirror these under the memory tool's
/memoriesand treat ASSUME-INTERRUPTION as law: anything not written to disk/memory is assumed lost on the next context reset.
Context economy (keep the loop inside the window)
Smallest high-signal token set; CLAUDE.md < 200 lines (it re-injects after /compact; nested ones
don't); push detail into path-scoped .claude/rules/ loaded on demand. Strip harness components on each
model upgrade — "every component encodes an assumption about what the model can't do; stress-test them."
Wire it to this setup
- Drive the per-session loop with native
/loop(bare/loop→~/.claude/loop.md) or the bespokebin/autonomous-loop --run(preemptive budget caps). - Use
evaluator-optimizerfor the per-feature verify (separate skeptical checker). - Feed accept/reject into the CAPC ledger (
probe_cost_per_accepted_change). - Decision layer:
loop-designer. Bespoke 2-agent generator:autonomous-skill/nonstop-agent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

