Agent skill
long-running-agent
Multi-session agent harness for complex projects spanning many context windows — initialiser/coding agent cycle
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/long-running-agent-baphled-dotopencode
SKILL.md
Skill: long-running-agent
What I do
I provide the harness pattern for agents working on projects that span multiple context windows. Based on Anthropic's research, I define the initialiser/coding agent cycle that prevents the two most common long-running failures: one-shotting everything and declaring premature victory.
When to use me
- Starting a complex project that will take multiple sessions
- When a task cannot be completed in a single context window
- When multiple agent instances will work on the same project sequentially
- When resumability across sessions is required
Core principles
- Initialiser first — The first session sets up scaffolding, not features
- Feature list in JSON — Never Markdown (models overwrite MD, not JSON)
- One feature at a time — Never attempt multiple features in one session
- Leave clean state — Every session ends with a git commit and progress update
- Verify before declaring done — Integration testing, not just unit tests
The Two-Agent Pattern
Initialiser Agent (first session only)
Prompt focus: "Set up the environment for future agents — do not implement features."
Creates:
feature_list.json— All features, all initially"passes": falseclaude-progress.txt— Running log of what each session accomplishedinit.sh— Starts dev server + runs a basic smoke test (exits 0 on success)- Initial git commit with all scaffolding
Coding Agent (every subsequent session)
Prompt focus: "Make incremental progress on ONE feature, leave clean state."
Session start ritual:
pwd— confirm working directory- Read
claude-progress.txtandgit log --oneline -20 - Read
feature_list.json— find highest-priority failing feature - Run
init.sh— verify app works before touching anything - Work on ONE feature only
Session end ritual:
- Run integration tests (browser automation, not just unit tests)
- Update
feature_list.json— only changepassesfield, never remove entries - Append to
claude-progress.txt— what was done, what is next - Git commit with descriptive message
Feature List Format
Use JSON, never Markdown. Models are less likely to overwrite JSON files.
{
"features": [
{
"category": "functional",
"priority": 1,
"description": "User can log in with email and password",
"steps": [
"Navigate to /login",
"Enter valid credentials",
"Verify redirect to dashboard"
],
"passes": false
}
]
}
Critical rules:
- Never remove entries — only change
passes - Never mark
passes: truewithout running the actual steps - Instruct agents: "It is unacceptable to remove or edit features"
Progress File Format
## Session 3 — 2026-02-20
Agent: Senior-Engineer
Feature: User login (#1)
Status: COMPLETE — passes: true
Next: Password reset flow (#2)
Issues: None
Anti-patterns to avoid
- ❌ Attempting multiple features in one session
- ❌ Using Markdown for feature tracking (models overwrite it)
- ❌ Marking features complete without integration testing
- ❌ Starting a session without reading progress file + git log
- ❌ Leaving broken code at end of session
- ❌ Declaring project done based on visual inspection alone
KB Reference
~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/Agent-Guidance/Long Running Agent.md
Related skills
task-tracker— Per-session task managementmemory-keeper— Cross-session knowledge persistencegit-master— Commit discipline between sessionsplaywright— Integration testing for web appschecklist-discipline— Rigorous feature status updatescontext-efficient-tools— Keep tool results lean across sessions
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?