long-running-harness
Skill8 starsChanged 3 months agoMITView on GitHub
Operating procedure for agent work that spans many context windows: split the run into a one-time initializer session (init.sh, feature_list.json, claude-progress.txt, initial git commit) and repeated coding sessions that each ship exactly one feature, verify it end-to-end via browser automation, and leave the repo in clean committed state. Trigger whenever a build will outlive a single context window (multi-hour/multi-day autonomous coding, session handoffs, resuming a scaffolded project), or when designing a harness/loop for such work.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- OpenxIntelligence/Coding-Agent-Skillstheir own version, first seen Nov 1, 2026
- I-Onlabs/claude-code-skillstheir own version, first seen Oct 25, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- I-Onlabs/claude-code-skills★ 4same name
- OpenxIntelligence/Coding-Agent-Skills★ 4same 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 repository21 other files it gives its agents.
- agent-design-fundamentalsSkill
- agent-evalsSkill
- agent-failure-preflightSkill
- agentic-coding-disciplineSkill
- agent-improvement-loopSkill
- agent-sandboxingSkill
- coding-agent-securitySkill
- context-compressionSkill
- context-engineeringSkill
- gpt-56-promptingSkill
- mcp-2026-migrationSkill
- mcp-code-executionSkill
- memory-compactionSkill
- monorepo-agentsSkill
- planner-evaluator-harnessSkill
- prompt-cache-optimizationSkill
- prompt-engineering-canonSkill
- skill-authoringSkill
- spec-driven-devSkill
- tool-designSkill
- zero-trust-agentsSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Use this skill when:
- Distinctive: line 23
Do NOT use when the task comfortably fits one context window — the scaffolding overhead is not worth it — or for work with no persistent …
- Very specific: line 43
Every entry starts with "passes": false — the file is the visible roadmap of remaining work.
- Distinctive: line 44
Use JSON, not Markdown, for the feature list.
- Very specific: line 49
Run pwd — you may only edit files in this directory.
- Very specific: line 50
Read the git logs (git log --oneline -20) and claude-progress.txt to get up to speed on recent work.
- Very specific: line 51
Read feature_list.json and choose the highest-priority feature whose passes is false.
- Very specific: line 52
Run init.sh to start the development server.
- Distinctive: line 53
Run a basic end-to-end smoke test (e.g.
- Distinctive: line 62
Use git as the recovery mechanism.
≈ “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 Agent Harness
This skill is the discipline for making progress on a project across many context windows, distilled from Anthropic's engineering post on effective harnesses for long-running agents. Compaction and context management alone are not sufficient: an agent given a high-level prompt (e.g. "build a claude.ai clone") tends to either attempt to one-shot the whole app and exhaust context mid-implementation, or — in a later session — see partial progress and declare the job done. The fix is structural: one initializer session that scaffolds the environment, then many coding sessions that each complete exactly one verified feature and hand off cleanly. Anthropic's framing: "engineers working in shifts, where each new engineer arrives with no memory of what happened on the previous shift."
When to use
Use this skill when:
- A build or task will span multiple context windows — hours or days of agent work with fresh context each session.
- You are the FIRST session on a greenfield project meant for multi-session work → run the initializer procedure.
- You are resuming a project that already has
init.sh/feature_list.json/claude-progress.txt→ run the coding-session procedure. Never re-run the initializer on a scaffolded project. - You are designing a loop/harness that will spawn repeated agent sessions on one codebase.
Do NOT use when the task comfortably fits one context window — the scaffolding overhead is not worth it — or for work with no persistent codebase to hand off.
Rules
Architecture
- Split the run into two logical roles: an initializer agent (first session only) and a coding agent (every session after). They are the same model, same system prompt, same tools — only the initial user prompt differs. Do not rely on compaction to carry a multi-hour build; it isn't sufficient on its own.
Initializer session (runs once)
- Set up the environment; do not build the product. Produce: an
init.shscript that starts the development server, afeature_list.json, aclaude-progress.txtprogress log, and an initial git commit recording what files were added. - Expand the user's high-level prompt into
feature_list.json: a comprehensive file of end-to-end feature requirements. Breadth matters — the claude.ai-clone example contained over 200 features. Each entry has the shape:
Every entry starts with{ "category": "functional", "description": "New chat button creates a fresh conversation", "steps": ["Navigate to main interface", "Click the 'New Chat' button", "Verify a new conversation is created", "Check that chat area shows welcome state", "Verify conversation appears in sidebar"], "passes": false }"passes": false— the file is the visible roadmap of remaining work. - Use JSON, not Markdown, for the feature list. The model is less likely to inappropriately change or overwrite JSON files than Markdown files; JSON gets treated as data, prose gets rewritten.
Every coding session — startup protocol
- Begin with the fixed orientation sequence, before touching code:
- Run
pwd— you may only edit files in this directory. - Read the git logs (
git log --oneline -20) andclaude-progress.txtto get up to speed on recent work. - Read
feature_list.jsonand choose the highest-priority feature whosepassesisfalse. - Run
init.shto start the development server. - Run a basic end-to-end smoke test (e.g. start the server and use the browser automation tool to exercise a core flow) BEFORE implementing anything new. This catches an inherited broken state early instead of building on top of it.
- Run
Every coding session — work rules
- Work on exactly one feature per session. This is the direct counter to the do-too-much-at-once failure mode; incremental single-feature sessions keep the codebase in a recognisable state at each handoff.
- Edit
feature_list.jsonONLY by changing apassesfield. Use — and obey — strongly-worded constraints: "It is unacceptable to remove or edit tests because this could lead to missing or buggy functionality." - Set
"passes": trueonly after self-verifying the feature end-to-end with browser automation (the reference implementation used the Puppeteer MCP): take the steps a user would take, watch the UI respond. Unit tests and curl commands passing is NOT sufficient — agents that stopped there repeatedly marked broken features complete. Testing tools that see the real UI let the agent find bugs not obvious from the code alone. - Know the verification blind spot: browser-native alert modals are invisible through the Puppeteer MCP, and features relying on them tended to be buggier. Treat such features as unverified by browser automation alone.
- End the session in clean state: code appropriate for merging to a main branch — no major bugs, orderly, well-documented, so the next session can start a new feature without cleaning up an unrelated mess. Concretely: commit to git with a descriptive message and write a summary of the session's progress into
claude-progress.txt. - Use git as the recovery mechanism. Descriptive incremental commits let any session revert bad code changes and recover a known-good working state instead of debugging forward.
Failure-mode map
| Problem | Initializer's countermeasure | Coding agent's countermeasure |
| Premature "project done" | Feature list with end-to-end descriptions | Read feature list each session; work one incomplete feature |
| Buggy, undocumented state left behind | Git repo + progress notes file | Read notes/git logs; smoke-test at start; commit + update notes at end |
| Feature marked complete without testing | Feature list with passes flags | Self-verify end-to-end before flipping passes |
| Tokens wasted rediscovering how to run the app | Write init.sh | Run init.sh at session start |
Checklist
Initializer session (once, at project start):
init.shwritten — starts the dev serverfeature_list.jsonwritten — comprehensive end-to-end features expanded from the user prompt, all"passes": falseclaude-progress.txtcreated- Initial git commit made recording added files
- No product features implemented
Every coding session:
pwd— confirm working directory- Read
claude-progress.txt git log --oneline -20- Read
feature_list.json; pick highest-prioritypasses: falseentry - Run
init.sh - End-to-end smoke test passes before new work (fix/revert first if not)
- Implement ONE feature only
- Verify it end-to-end with browser automation, not just unit tests
- Flip only the
passesfield, only after verification - Commit with a descriptive message
- Update
claude-progress.txtwith a progress summary
Anti-patterns
- One-shotting the app: implementing many features in one session until context runs out, leaving half-done, undocumented work.
- Premature victory: seeing existing progress in the repo and declaring the project finished instead of checking
feature_list.jsonfor remainingpasses: falseentries. - Marking complete without proper testing: flipping
passesafter unit tests or curl checks alone, without end-to-end UI verification. - Editing the feature list beyond
passes: removing or rewording tests, descriptions, or steps. - Markdown feature lists: the model overwrites prose more readily than JSON.
- Skipping the startup smoke test: building new features on top of an inherited broken state.
- Relying on compaction alone to bridge sessions instead of git history plus progress notes.
- Ending a session with uncommitted or undocumented changes, forcing the next session to burn tokens reconstructing what happened.
Source
- Effective harnesses for long-running agents — https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents — 2025-11-26 (Justin Young, Anthropic Engineering; code examples in the accompanying quickstarts repository, autonomous-coding)
Distilled from the official document(s) above on 2026-08-12. If this skill and the source disagree, trust the source.
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.

