setup-harness
Setup harness
Give every Claude Code session in this repo a fast, measured way to check its own work: scripts/check.sh answers "is this change good" at three rungs, Claude Code hooks run the fast rungs on every edit and every stop, and the pre-commit runner holds the commit. The run is explore, present, confirm, write, prove. Nothing is written before the human confirms it as a diff, and nothing third-party is installed before it passes the install check.
Paths are contracts. scripts/check.sh, .claude/hooks/check-hook.sh, .claude/hooks/cloud-setup.sh and docs/agents/harness.md are read by hooks and by a re-run, and setup-skills is to read the profile; write them at exactly those paths. Configuration is committed at project scope (.claude/settings.json, .claude/hooks/, the runner config); anything machine-specific goes to .claude/settings.local.json, and the report names it as such.
Process
1. Preconditions: instruct and stop
On any failure print the exact command, then "then rerun /setup-harness", and stop.
- A git repo with tracked files, on GitHub or Azure DevOps (
git remote get-url origin).curlandpython3onPATH: this skill'sscripts/pick-version.shneeds both. - A clean working tree (
git status --porcelainempty; elsegit stash -u). - Claude Code floor. Skip this item entirely when
CLAUDE_CODE_REMOTE=true. Readclaude --version. Below theFloor:of templates/harness-profile.md, write nothing under.claude/in this run, print the upgrade command for the install method (claude update; Homebrewbrew upgrade claude-code; npmnpm install -g @anthropic-ai/claude-code@latest), and stop. - Warn, do not stop, in the report's header:
claude doctor </dev/nullreportsAuto-updates:other thanenabled: name the switch doctor names (DISABLE_AUTOUPDATER,DISABLE_UPDATES,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC) and the install method's own update command, since Homebrew, WinGet and apt installs do not self-update.- The installed version trails its channel's latest:
npm view @anthropic-ai/claude-code dist-tags --json(latestandstable); name the channel, both versions and the update command.