ChengYanSuo

harness-kit

The engineering method for "running long tasks with Claude Code", distilled into a project skeleton you can clone and use.

Lab · Open Source2 min read

A long-running Agent's worst enemy isn't a lack of intelligence — it's getting lost on a long task: forgetting the goal, losing track of progress, drifting off plan, finishing with no way to verify. The root cause is entrusting all of that to the model's unreliable memory. A harness is the rig you strap around the model: a deterministic engineering structure that moves the goal, the progress, and the verification criteria into external files, so the Agent re-anchors at every step and doesn't drift. harness-kit turns "how to build that rig" into a cloneable methodology with templates.

What it solves

Run a long task with Claude Code that spans multiple sessions and you've probably hit these four walls:

FailureSymptom
Cross-session amnesiaNew session, the Agent forgot where it left off and why it was designed that way
Progress driftSet out to build A, drifted to B along the way, no single source of truth
Missing verificationClaims "done" with no reproducible passing criteria
Context explosionMaterial dumped into the window all at once, important info buried

They share one root: business rules, progress, and verification criteria were entrusted to unreliable LLM memory. harness-kit moves them all into deterministic files.

Core mechanism: four layers of defense

LayerRoleArtifact
L1 PersistenceRules/progress on diskCLAUDE.md + STATUS.md + Auto Memory
L2 MethodologySingle source of truth + verifiable slicesfeatures.json + milestone trio + fixtures
L3 Automation hooksDeterministic automationhooks (Stop/SessionStart progress append)
L4 Context isolationOutsource dirty work to subagentsisolation discipline + dedicated subagent

These land in five core components: CLAUDE.md (project constitution), STATUS.md (single-page state), features.json (atomic-task source of truth, pending/in_progress/failing/passing), the milestone trio (init.sh / AGENTS.md / PROGRESS.md), and fixtures-before-code.

How to use

After git clone, two ways: manual — copy the 11 templates under templates/, fill in the placeholders, and start; one-shot — install it as a Claude Code plugin, run /harness-kit:harness-init, answer a few questions, and the whole skeleton is scaffolded. The repo ships a filled-in examples/demo-cli/ minimal sample and docs/methodology.md with the four-layer walkthrough.

In one line

Not template-nesting — it's moving the fact that "this project is still alive, and here's how far it got" out of your memory and into files.