How to

Code

Code runs coding agents on your server, in your real repositories, several at once: Claude Code, Codex, and agents that speak the Agent Client Protocol (Gemini CLI, Qwen Code, opencode, Claude Code (ACP)). You start, watch, chat with and stop them from any device, your phone included, and your accomplice can steer them for you.

Before you start

On the machine Mandala runs on, as the user Mandala runs as:

  • install the agents you want and log in to them as you normally would; Mandala uses your installations as they are and injects no keys;
  • install git, and gh (logged in) for pull requests and CI checks;
  • optionally Docker, for sandboxed sessions.

Start a session

  1. Open Code. Add a repository with its path on the server (/home/sam/src/shop).
  2. Under New session: choose the Agent, its Permissions, an optional Title ("Fix the sync retry handler"), and under What to do describe the goal, the constraints and how to check it.
PermissionsMeaning
Asks you before other toolsThe agent asks before any tool outside its safe set
Decides what is safe, asks the restThe agent's judgement, asking when unsure
Its sandbox (writes only here), asks to go beyondCodex's own sandbox (its default)
Never asksFull autonomy inside the worktree
  1. Start. Each session works in its own git worktree, on its own branch (alma/<title>-<id>), so sessions never step on each other or on your checkout.

While it works

  • Session shows each step as it happens; write your next message at any time. Changes shows the diff; changes are committed after each turn.
  • Stop a turn, or Close the session.
  • Turns run detached: a Mandala restart does not stop them, and an interrupted turn resumes through the agent's own session.

Questions become approvals

When an agent asks permission for something its mode does not allow, the question becomes an approval card: in the session, in your conversation, and as a notification with Approve and Deny on your phone. Allow … for this session answers all such questions for that tool. Your own words count too: on the Code page, a message sent while a question waits approves it or refuses it, and your words are passed to the agent. A card expires when its turn ends.

Hand over to your accomplice

Who steers this session: you, or your accomplice. Handed over, it reads each finished turn and sends the next instruction, for at most 8 turns before you step in. Writing a message yourself takes it back.

Pull requests and CI

Open PR opens the pull request with gh (only Mandala pushes). While it is open, the Checks tab follows its CI: about every minute, and at once when GitHub's webhook says a run finished (GitHub). When CI fails and the agent is idle, Mandala gives it a fix turn with the failing logs, then commits, pushes and checks again — one round per commit, up to 3 rounds (configurable per project). You are told once: when the rounds run out, when a fix changed nothing, or when the PR turns green.

Merging and deploying stay yours.

Reviews

Review asks another agent to review the branch, read-only, against its base with the original brief and the diff (by default the other agent: Codex reviews Claude Code's work and the reverse). The review lands in the session; Send to the agent passes it on. It can also be posted as a PR comment.

Sandbox

A project can run its turns and tests in a Docker container: your user, no extra privileges, 2 CPUs, 4 GB, optionally no network, with only the worktree, the agent and its login mounted, and no GitHub credentials. Turn it on per project (ask your accomplice, or POST /api/code/projects/{id}).

Your accomplice and code

Your accomplice has code.* tools: it starts, reads, steers, reviews and closes sessions, and opens pull requests. It is woken when a session it steers finishes a turn.