# When a run stops

A run stops when it needs you, when you stop it, or when the machine does. The state is on disk, so it continues from the last verified phase in any session or agent.

A run is meant to keep going on its own. It stops for one of three reasons: it needs a person (a gated phase, a halt, or the end of the board), you stopped it, or the process died with the chat, the terminal or the machine. In every case the state is in `.koi/run/`, committed with your code. That is what lets the next launch continue from the last verified phase, in any session and with any agent.

## Read why it stopped

Koi sends no notifications. The reason is where the run was:

- `/junji goal` reports it in your agent's chat: a red check, a gated phase, a failed child, or no runnable phase left.
- The Yokai cockpit shows `HALT` with the reason, or `STOPPED` after you pressed `x` or the agent disconnected.
- Headless `yokai` prints `⚠ halt — <reason>` and exits with code `2`.

To see where the board stands, paste this into any chat in the repository:

```text
Read .koi/run/BOARD.json and .koi/run/NOTES.md. What has been verified? What comes next? Wait before changing any code.
```

A good answer names the last finished phase and its outcome, the commit it produced, and the next card. For example: "P1 is done: add, complete and delete work, 14 tests pass, commit 3c9e1f2. Next is P2, persistence. nextAction is /junji next."

If the answer does not match the code, ask the agent to run the commands in `CONTEXT.md › Verification bar` and inspect the last commit before going further.

## Let it run again

Fix what the reason points at, then start the run again the same way:

- In your agent, send `/junji goal` to run the remaining phases on their own, or `/junji next` to run one while you watch.
- With Yokai, press `r` in the cockpit after a stop, or run `yokai` again after a halt or a restart. A gated phase runs only when you launch with `--allow-gated`.

If a phase was interrupted halfway, its card shows `planning`, `building` or `sealing`. Both tools continue from that point and reuse the phase plan that already exists. There is no `--resume` flag: launching again is how a run continues.

If you switch to a different agent, install the Junji skill there first with `npx skills add getkoi/koi --skill junji`. Yokai does not need the skill.

## When every phase is done

`nextAction` is `/junji consolidate`. This stop is the one that always needs you. Try the change yourself first. Use `/junji brief` for a summary you can share, or `/junji consolidate` to close the run. If something is missing, `/junji iterate` adds phases, and they run like the rest.

## What can go wrong

- There is no board. Check the branch and that you are at the repository root. A finished run may have been consolidated; look for the document it wrote, usually under `specs/`.
- The agent says it cannot see `/junji`. The skill is not installed for this agent, or the agent needs a restart.
- Two cards are in progress. `next` stops and asks you to keep only one. Decide which phase is really in flight and set the other back to `todo`.
- The run uses `BACKLOG.md` instead of `BOARD.json`. It is an older run. Ask the agent to read `BACKLOG.md` instead; Junji still supports it.

[Run on its own](/en/docs/koi/autonomous) compares the two ways to run. [Work across sessions](/en/docs/architecture/sessions) explains what each file holds.

## Cards to read next

- [![](/art/verbs/goal-card.webp) goal · Run phases in sequence](/en/docs/junji/goal)
- [![](/art/verbs/brief-card.webp) brief · See what shipped](/en/docs/junji/brief)
