---
url: /run.md
---
# Run an agent

`pandra run` starts an agent from a local project, your store, a Git repository, an OCI registry, or a package file. The agent works in the directory you run the command in, unless you choose another directory ([workspaces](/run/workspaces.md#workspaces)). On a terminal, it opens the harness's own interface. With its output redirected, it writes only the agent's answer there, and the terminal shows Pandra's lines on stderr, such as the `Session:` field that names the session. At the end of the run, fields on stderr name the skills the agent loaded and those it did not. To review the changes in the current directory with the example agent `reviewer`, whose prompt asks for that review:

```sh
pandra run github.com/pandra-io/pandra/examples/reviewer > review.md
```

```text
✓ Prepared · 0.0s
  Session:  ab26a541d3ae (reviewer)
✓ Started claude-code 2.1.285 · 0.5s
✓ Ran reviewer · 41s
  Skills loaded:      ponytail-review
  Skills not loaded:  pandra
```

An agent from someone else asks for your approval on its first run ([trusting agents](/run/trust.md)). You can start a run in three ways: in the harness's interface, headless for a script, or for an editor ([headless, TUI, and ACP](/run/starting.md#headless-tui-and-acp)). A run in the interface or a headless run creates a session, one conversation with the harness, which you can resume, inspect, and remove:

1. Run: `pandra run github.com/pandra-io/pandra/examples/reviewer > review.md` creates a session, `ab26` here, whose workspace is the current directory, starts the agent on Claude Code, and writes the review to `review.md`.
2. Resume: `pandra resume ab26 --prompt "Also check the error handling."` continues the same conversation as the session's second run, and prints the answer.
3. Logs: `pandra logs ab26` shows what the agent did, run by run.
4. Remove: `pandra session remove ab26` removes the session and its log.

* [Starting a run](/run/starting.md): what you can run, the interaction modes, prompts, and what Pandra checks before the agent starts.
* [Trusting agents](/run/trust.md): what Pandra shows before a remote agent first runs, and how you approve it.
* [Workspaces and sessions](/run/workspaces.md): where the agent works, and how to resume, inspect, and remove its sessions.
* [Running in the background](/run/background.md): detached runs, waiting for their answers, and messages to a running agent.
* [Running in a microVM](/run/vm.md): running an agent in a Linux VM of its own on a Mac, with network rules and credentials kept on the host.

Choosing the harness and the model is under [harnesses](/harnesses/choosing.md). Agents that a repository declares for everyone who works in it run by name with `pandra guild run` ([your repository's agents](/guilds.md)).
