agent-harness
Framework for orchestrating multiple AI agent sessions to complete complex, long-running software projects. Use when the user wants to set up or use the long-running agent harness pattern for managing multi-session projects, breaking work into discrete sessions with persistent state tracking, or implementing incremental progress workflows across multiple Claude Code sessions.
What this skill does
# Long-Running Agent Harness
Framework for completing complex projects across multiple Claude Code sessions.
## Overview
The harness solves the **context window limitation** by breaking work into discrete sessions where each agent:
1. Starts with a fresh context
2. Reads the current state from files
3. Makes incremental progress on ONE feature
4. Documents everything for the next agent
This is based on Anthropic's research on effective agent harnesses.
## When to Use This Skill
Use this skill when:
- A project is too large for a single Claude Code session
- You want to work incrementally across multiple sessions
- Multiple agents (or you over multiple days) need to collaborate on one codebase
- You need persistent progress tracking that survives context window limits
## Architecture
```
Initializer Agent (First Session)
│
▼
Creates harness files:
├── init.sh → Environment setup script
├── feature_list.json → Requirements (all failing)
├── claude-progress.txt → Handoff log
└── Git repo
│
▼
Coding Agent Session 1 ──▶ Coding Agent Session 2 ──▶ ... ──▶ Coding Agent Session N
```
## Setup
### Step 1: Initialize the Harness
Copy the harness files to your project:
```bash
cp -r ~/.claude/skills/agent-harness/assets/* ./my-project/
cd my-project
chmod +x init.sh
```
### Step 2: Define Features
Edit `feature_list.json` with your actual requirements:
```json
{
"project_name": "My Web App",
"features": [
{
"id": "feat-001",
"category": "infrastructure",
"description": "Project setup and dev server",
"steps": ["Create package.json", "Set up dev server", "Verify hot reload"],
"passes": false
},
{
"id": "feat-002",
"category": "authentication",
"description": "User login with email/password",
"steps": ["Create login form", "Add validation", "Test E2E"],
"passes": false
}
]
}
```
**CRITICAL**: Set ALL `passes` to `false` initially. This prevents agents from declaring victory too early.
### Step 3: Customize init.sh
Edit `init.sh` for your project:
```bash
# Add your setup commands
npm install
npm run dev &
sleep 3
curl -s http://localhost:3000/health || echo "WARNING: Health check failed"
```
## The Agent Loop
Every session follows this exact pattern:
```bash
# 1. Get bearings
./init.sh # Set up environment
read feature_list.json # See current progress
read claude-progress.txt # Get context from last session
git log --oneline -20 # Understand recent changes
# 2. Verify state
# - Start dev server
# - Run existing tests
# - Check for regressions
# 3. Select ONE feature
# - Read feature_list.json
# - Pick highest-priority incomplete feature
# 4. Implement
# - Make focused changes
# - Test thoroughly (like a human user)
# - Commit frequently
# 5. Complete and handoff
# - Update feature_list.json (set passes: true)
# - Append to claude-progress.txt
# - Final descriptive commit
```
## Feature Categories (Priority Order)
| Category | Description | Priority |
|----------|-------------|----------|
| `infrastructure` | Setup, config, tooling | 0 - Do first |
| `core` | Essential functionality | 1 |
| `feature` | User-facing features | 2 |
| `polish` | UI/UX improvements | 3 - Do last |
## Rules
1. **Work on ONLY ONE feature at a time**
2. **It is UNACCEPTABLE to remove or edit tests**
3. **Set ALL features to passes: false initially**
4. **Test like a human user** (not just unit tests)
5. **Leave code in a clean, mergeable state**
6. **Use JSON for structured data** (not markdown)
7. **Write descriptive commit messages**
## File Reference
### feature_list.json
Source of truth for requirements and progress:
```json
{
"id": "feat-001",
"category": "authentication",
"description": "User login",
"steps": ["Step 1", "Step 2"],
"passes": false,
"notes": ""
}
```
- `id`: Unique identifier
- `category`: infrastructure | core | feature | polish
- `passes`: Boolean - ONLY set to true after thorough testing
- `notes`: Context for next agent
### claude-progress.txt
Human-readable handoff log. Append at end of each session:
```
Session: 2024-03-05T10:00:00
Worked on: feat-001
Changes: Created LoginForm component
Issues: None
State: Ready for next feature
```
### init.sh
Idempotent setup script. Must be safe to run multiple times.
## Helper Commands
The `harness.py` script provides convenience commands:
```bash
python harness.py init # Initialize harness files
python harness.py status # Show completion progress
python harness.py next # Suggest next feature
python harness.py complete ID "notes" # Mark feature done
python harness.py session # Run full workflow
```
## Recovery
If something goes wrong:
```bash
# Revert to last known good state
git log --oneline -20
git reset --hard <good-commit>
# Update feature_list.json to reflect current reality
# (set passes: false for features that need rework)
```
## Assets
This skill includes template files in `assets/`:
- `init.sh` - Setup script template
- `feature_list.json` - Feature list template
- `claude-progress.txt` - Progress log template
- `harness.py` - Helper CLI script
Copy these to your project and customize them.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.