Agent workflow
Before editing
Section titled “Before editing”- Read the repository’s
AGENT.md,.har/README.md, and.har/stages.json. - Check status before choosing a slot.
- Launch once and record the returned work directory.
- Read
.har/CLAUDE.agent.mdin that worktree for resolved URLs and the repository-specific definition of done.
har env statushar env preflight 2har env launch 2Use one slot per task. Separate parallel tasks use separate slots.
Occupied and failed slots
Section titled “Occupied and failed slots”A normal launch never silently replaces an active session.
har env launch 2 --replaceOnly use --replace after reviewing the current branch and worktree. If that
worktree has uncommitted changes, replacement remains blocked until the owner
explicitly approves --force.
A launch that failed partway is different. Preserve and resume its existing state:
har env recover 2# equivalent to: har env launch 2 --resumeDuring implementation
Section titled “During implementation”- Edit only under the slot’s
workDir. - Let the harness own service startup, ports, databases, and process management.
- Use preview URLs returned by status or launch instead of hardcoding ports.
- Run focused project commands through
.har/agent-cli.sh <id> exec ...when needed. - Use quick verification as the feedback loop.
har env verify 2har env status --jsonBefore handoff
Section titled “Before handoff”- Add or update automated tests.
- Run full verification.
- Stage exactly the state that passed.
- Commit inside the session worktree.
- Complete the environment.
har env verify 2 --fullgit add -Agit commit -m "feat: describe the change"har env complete 2Any edit after full verification changes the tree hash and requires another full verify. Completion keeps the branch, so the user can push it or open a pull request.
When to teardown
Section titled “When to teardown”Use plain teardown for abandoned work, manual cleanup, or a task that should not record a completion validation:
har env teardown 2Branch deletion is a separate, explicit operation.
