harness — Claude Code skill for multi-session agents
A skill for Claude Code, Codex, Cursor and other platforms that keeps long-running agent tasks alive across context resets, with checkpointing and git-based rollback. Triggered by /harness run or when a job spans many dependent subtasks.
AGPL-3.0 158 installs ★ 2,756 updated 2026-05-04
npx skills add stellarlinkco/myclaude --skill harness -a claude-codeWhat harness does
harness runs on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. It wraps any multi-step job in a persistent loop: /harness init <project-path> creates two state files — harness-tasks.json for structured task state and harness-progress.txt as an append-only log — then drives execution task by task.
After a context window reset, the agent rebuilds its position from those two files plus git history. A task found with status in_progress at session start means the previous session was cut short; the skill routes it through a dedicated recovery protocol. Concurrent writes to harness-tasks.json are blocked by a mkdir-based lock in /tmp, which is atomic on POSIX systems. A failed task rolls back via git reset --hard to its started_at_commit, and depends_on chains prevent later tasks from starting until their prerequisites complete.
The session config in the example sets max_tasks_per_session to 20 and max_sessions to 50 — those are illustrative values from the source, not hard platform limits. The .harness-active marker file must exist in the harness root for any hooks to fire; without it every hook exits 0 immediately, leaving the project untouched.
What it helps with
- resume an agent job after a context window reset
- roll back a failed subtask to its last clean commit
- queue dozens of subtasks with explicit dependency ordering
- prevent two concurrent agent sessions from corrupting the task file
- add a new subtask to a running queue without stopping the loop
Example prompts for the agent
- Run
/harness init .and queue up tasks to refactor all API controllers - Resume the loop with
/harness run— it stalled ontask-004last session - Add a step mid-flight:
/harness add "Write migration for users table"
How to install harness
1Skills CLI (Vercel)
npx skills add stellarlinkco/myclaude --skill harness -a claude-code2Manually: put the files in place
~/.claude/skills/harness/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/harness/
1Skills CLI (Vercel)
npx skills add stellarlinkco/myclaude --skill harness -a codex2Manually: put the files in place
.agents/skills/harness/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add stellarlinkco/myclaude --skill harness -a cursor2Manually: put the files in place
.cursor/skills/harness/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install stellarlinkco/myclaude skills/harness2Manually: put the files in place
.github/skills/harness/SKILL.md1Skills CLI (Vercel)
npx skills add stellarlinkco/myclaude --skill harness -a gemini-cli2Platform CLI
gemini skills install https://github.com/stellarlinkco/myclaude --path skills/harnessManually: put the files in place
.devin/skills/harness/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add stellarlinkco/myclaude --skill harness -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about harness
How do I install harness in Claude Code?
Run npx skills add stellarlinkco/myclaude --skill harness -a claude-code. The skill lands at ~/.claude/skills/harness/SKILL.md.
What does the harness skill do?
It manages long-running agent work by persisting task state and a progress log across sessions, then recovering from interruptions and rolling back failures with git reset --hard.
Does the project need to be in a git repo?
Yes. Rollback on failure relies on git reset --hard targeting the commit stored in started_at_commit. Without a git history that command has nothing to reset to.