koi
Documentation / yokai

Yokai

Yokai runs the phases Junji prepared, one at a time, through a coding agent. It checks each result on disk and moves on only when the checks pass and the work is committed.

Who does what in a phase
  1. You prepareReview the checks Yokai will run and the model tier for each phase.
  2. The agent worksYokai sends the phase to the agent, which plans it, edits the code and commits.
  3. Yokai verifiesIt runs the checks itself and reads the board and Git. A failed check keeps the phase open.
yokai setup, up to Start run

yokai setup in the demo repository. It asks how to choose models (one model), confirms Claude Code on the host, shows the check script, runs the tests when it is approved, lists the three phases at the medium tier and ends at Review and start. Start run opens the cockpit on phase P0 at the Plan step, waiting on the agent. The recording stops there, before the agent's first turn.

When to use it

Use Yokai when the plan is reviewed, the phases are on the board, and you want them to run on their own in a terminal, on a server or in CI. It suits overnight runs, long migrations and CI jobs. It stops and shows why when it needs you: a gated phase, a halt, or the end of the board. For a single phase you want to watch closely, /junji next in your agent is simpler, and /junji goal runs several in your agent's chat. Run on its own compares the two.

Yokai is a Rust program, the yokai command. It works with Claude Code, Codex, Cursor CLI and OpenCode. It does not need the Junji skill installed; it reads the files Junji wrote.

What it adds over Junji alone

  • A second agent turn, the judge, reviews every change before Seal.
  • Checks run as reviewed scripts that Yokai executes itself, so the agent cannot report a pass it did not get.
  • Each phase can use a different model, chosen by tier.
  • Bookkeeping misses, such as a forgotten commit, are repaired automatically.
  • Runs can happen in a Linux sandbox built from a Dockerfile in your repository.

How Yokai runs a phase explains the mechanism.

Your first run

You need Git, a signed-in agent, and a repository where Junji has run begin, plan and refine.

  1. Install Yokai.
  2. Prepare the project with yokai setup --once: choose the agent and model, review the checks and the phase tiers.
  3. Run one phase and inspect the commit. Then run yokai, or yokai --headless, and leave the rest running.

If something stops, look up the message in Run troubleshooting.