# harness

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 158 installs · ★ 2756 repo stars
- Author: stellarlinkco
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/stellarlinkco/myclaude/tree/HEAD/skills/harness/SKILL.md
- Updated: 2026-05-04
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/harness

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add stellarlinkco/myclaude --skill harness -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/harness/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/harness/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add stellarlinkco/myclaude --skill harness -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/harness/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add stellarlinkco/myclaude --skill harness -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/harness/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install stellarlinkco/myclaude skills/harness
```

2. **Manually: put the files in place**
- File: `.github/skills/harness/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add stellarlinkco/myclaude --skill harness -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/stellarlinkco/myclaude --path skills/harness
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/harness/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add stellarlinkco/myclaude --skill harness -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/stellarlinkco/myclaude/tree/HEAD/skills/harness/SKILL.md

## When to use it
- 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
- Run `/harness init .` and queue up tasks to refactor all API controllers
- Resume the loop with `/harness run` — it stalled on `task-004` last session
- Add a step mid-flight: `/harness add "Write migration for users table"`

## Similar
- [harness:deploy](https://affpapa.org/en/nevibecode/skills/harnessdeploy.md) — skill · ★ 58 repo stars
- [unix-cli](https://affpapa.org/en/nevibecode/skills/unix-cli.md) — skill · 333 installs
- [shell-integration](https://affpapa.org/en/nevibecode/skills/shell-integration.md) — skill · 123 installs
- [shell-expert](https://affpapa.org/en/nevibecode/skills/shell-expert.md) — skill · 141 installs
- [groove-admin-config](https://affpapa.org/en/nevibecode/skills/groove-admin-config.md) — skill · 581 installs
- [implement-task-linear](https://affpapa.org/en/nevibecode/skills/implement-task-linear.md) — skill · 346 installs

From the same set: [stellarlinkco/myclaude](https://affpapa.org/en/nevibecode/by/stellarlinkco/myclaude.md) — 7 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
