# Install hindsight

These instructions are for a coding agent (Claude Code, Codex, pi or another) setting hindsight up on the computer of the person it works with. hindsight records the person's agent conversations in the repositories their team chose and links them to the commits they produced, on https://hindsight.remotely.works.

Before you start, tell the person the three steps below in one line, and that step 2 opens a browser tab they confirm themselves. Run each step in a terminal, check its result, and tell the person what happened. Ask before anything this guide does not name. The whole setup takes about two minutes; nothing in it changes a repository or makes a commit.

## 1. Install the CLI

```sh
curl -fsSL https://hindsight.remotely.works/install.sh | sh -s -- --setup
```

This downloads the hindsight CLI for this computer (macOS or Linux), checks its signature and checksum, installs it into `~/.local/bin` (or `~/bin` when that is on the PATH) without sudo, then runs `hindsight setup`.

If the person gave you an invitation email, run its line instead: it is the same with the token before `sh`, `curl -fsSL https://hindsight.remotely.works/install.sh | HINDSIGHT_JOIN_TOKEN=<token> sh -s -- --setup`, which keeps the token out of the process list.

If `hindsight` is not found afterwards, the installer printed the line that adds its folder to the PATH: show it to the person, and use the full path (`~/.local/bin/hindsight`) meanwhile.

## 2. Let the person sign in

`hindsight setup`, which step 1 started, opens https://hindsight.remotely.works in the browser for the person to confirm the sign-in, and waits. Say so at once: "A browser tab is waiting for you to confirm the sign-in." You cannot confirm it for them and must never type a password, token or code on their behalf. Over SSH or without a display it prints a GitHub address and a code to enter there instead; relay both to the person. If the command times out before they confirm, run `hindsight setup` again.

Setup then adds hindsight's hooks to the settings of each agent harness it finds in the home folder, keeping everything else in them, and prints which workspaces record automatically. hindsight Live comes along in the same settings, with no question: in the repositories of a workspace that has Live on (every workspace starts with it on), the person can share a session with their team as it runs (/hindsight-live, or asking their agent to go live), and setup prints which workspaces have it; nothing is live until the person says so, and everywhere else Live does nothing. Where Claude Code has no status line of its own, setup gives it "● hindsight Live" under the prompt while a session is live; a status line the person has is never replaced. Setup also installs the hindsight skill into the skills folder of each harness it set up: it teaches agents on this computer to answer "why is this code like this?" from the recorded conversations, and to share or keep a session private when the person asks. Nothing is committed and no repository file changes.

Setup prints one row per step and ends with one line: "This laptop is ready.", or what is left, marked ⚠ above it (a step the person does, such as approving Codex's hooks once; the skill not installed, which `hindsight skills install hindsight --user` tries again). Relay that line to the person.

## 3. Check

```sh
hindsight status --all
```

Report to the person: the harnesses set up, the workspaces and how many repositories they record automatically, which of them have hindsight Live, and that the next session in one of those repositories is recorded. Agent sessions already running load the hooks when restarted.

If a workspace records per repository instead, it says so: ask the person which repository they work in, then run `hindsight link` in a clone of it.

## If something fails

- Show the person the command's output; do not retry around a refusal.
- `hindsight doctor` says what is wrong and how to fix it.
- `hindsight uninstall` removes hindsight from this computer and puts every file it changed back.
