autopilot
Repo-local Autopilot
Install the Claude autopilot bundle into a target repository's local .claude/ directory.
What this installs
Running the installer writes these repo-local files into the target repository:
.claude/hooks/autopilot-keep-running.sh.claude/hooks/session-start.sh.claude/commands/autopilot_reset.md.claude/settings.jsonpatched to wire the repo-local hooks
The install is repo-local by design. It does not depend on ~/.claude/ and should not install or update global Claude settings.
Default target
If you do not pass a target path, the installer uses the current working directory.
Explicit target repo
Use --target-repo /absolute/or/relative/path to install into another repository.
Installer entrypoint
Resolve the installer path in this order:
if [ -f "skills/autopilot/scripts/install_repo_local_autopilot.py" ]; then
INSTALLER_PATH="skills/autopilot/scripts/install_repo_local_autopilot.py"
elif [ -f "agent-skills/skills/autopilot/scripts/install_repo_local_autopilot.py" ]; then
INSTALLER_PATH="agent-skills/skills/autopilot/scripts/install_repo_local_autopilot.py"
elif [ -f "scripts/install_repo_local_autopilot.py" ]; then
INSTALLER_PATH="scripts/install_repo_local_autopilot.py"
else
INSTALLER_PATH="$HOME/.agents/skills/autopilot/scripts/install_repo_local_autopilot.py"
fi
Install into the current repo:
python3 "$INSTALLER_PATH"
Install into another repo:
python3 "$INSTALLER_PATH" --target-repo /path/to/repo
Installed settings behavior
The installer safely updates .claude/settings.json to:
- append a repo-local
SessionStarthook pointing to"$CLAUDE_PROJECT_DIR"/.claude/hooks/session-start.sh - prepend a repo-local
Stophook pointing to"$CLAUDE_PROJECT_DIR"/.claude/hooks/autopilot-keep-running.sh - preserve unrelated hooks such as
bun-check.shandcodex-review.sh - avoid duplicate autopilot entries on re-run
- set default env values only when missing:
AUTOPILOT_KEEP_RUNNING_DISABLED=0CLAUDE_AUTOPILOT_MAX_TURNS=20
Reset and stop controls
After installation, use the repo-local command:
/autopilot_resetto reset the current session turn counter/autopilot_reset stopto stop autopilot on the next turn/autopilot_reset statusto inspect the current session/autopilot_reset status-allto inspect all tracked sessions
That reset control is installed into the target repo as .claude/commands/autopilot_reset.md.
Validation checklist
After install, verify:
- The repo contains the installed
.claude/hooks/and.claude/commands/files. .claude/settings.jsonpoints to repo-local hook paths.- Re-running the installer does not duplicate hook entries.
- The hook scripts are executable.
- Unrelated existing hooks remain intact.
- Autopilot runtime files appear under
/tmp/claude-autopilot-*when the hooks run. - Invalid target
.claude/settings.jsonfiles fail with a clear error instead of being overwritten.
See references/devsh-testing.md for a remote sandbox validation workflow.