Clones
This guide is part of where your agents run.
A clone is Claude Code or Codex that works for you while you are away. You start it with a task, and it works as you, with your skills, on your own subscription or key. It opens a draft pull request with your name on it and stops when CI is green.
Each clone runs in a fresh Docker container on a machine that you own. That can be your laptop, a spare machine, or a cloud VM. There is no shadowclone server, and your tokens stay in a file on that machine.
$ shadowclone clone start --repo you/app "fix the flaky date parser test"Queued clone k3x9m2qa for you/app: fix the flaky date parser test$ shadowclone clone listk3x9m2qa working you/app shadowclone/k3x9m2qa - 2026-10-18T13:40:02Z fix the flaky date parser testClones are separate from the Actions bot. The bot runs in GitHub Actions on an API key, and anyone with write access can tag it.
| Mode | Runs on | Model login | Who starts it | Commits show |
|---|---|---|---|---|
| Actions bot | GitHub Actions | An API key | Anyone with write access | The bot |
| Clones | Docker on a machine you own | Your subscription, or a key | You, from the CLI or your agent | You |
Set up with your agent
Section titled “Set up with your agent”Ask your agent in the repository checkout, on the machine that runs the clones:
Set up shadowclone clones for this repository with my Claude subscription.The agent uses the setup-clones skill. You answer two questions, approve the skill files, and paste your tokens into the secrets file. The agent runs a check and tells you how to start your first clone. Setup takes about 5 minutes.
Without an agent, run the same steps in a terminal:
shadowclone clone setup --repo owner/repositoryshadowclone clone secrets --repo owner/repositoryshadowclone clone status --repo owner/repositorySetup pushes your equipped skills to your private repository <you>/shadowclone-skills first, after you approve the file list. It also installs shadowclone serve as a launchd agent on macOS or a systemd user service on Linux. That service starts the clones.
Choose a login
Section titled “Choose a login”| Provider | Agent | Secret | Notes |
|---|---|---|---|
claude-subscription |
Claude Code | CLAUDE_CODE_OAUTH_TOKEN from claude setup-token |
The default. A Pro or Max plan. The token lasts one year |
anthropic |
Claude Code | ANTHROPIC_API_KEY |
|
chatgpt-subscription |
Codex | None | Run shadowclone clone login. Refused on a public repository. One clone at a time |
openai |
Codex | OPENAI_API_KEY |
|
openai-compatible |
Codex | OPENAI_COMPATIBLE_API_KEY |
Needs --base-url https://... and --model. The endpoint must serve the Responses API |
ollama |
Codex | OLLAMA_API_KEY, only if your server needs one |
Needs --base-url and --model |
foundry |
Codex | AZURE_OPENAI_API_KEY |
Needs --base-url https://<resource>.openai.azure.com/openai/v1 and --model |
Every clone also needs GH_TOKEN: a fine-grained token that covers the repository and <you>/shadowclone-skills. Give it read and write access to contents, issues, and pull requests, and read access to actions. Setup prints a link that fills in these settings. Reviews do not support ollama and foundry yet.
Anthropic allows you to sign in to the unmodified Claude Code with your own subscription where a platform hosts it. OpenAI asks you to use one ChatGPT login from one job stream at a time, and not on public repositories. So a ChatGPT login runs one clone at a time.
Start a clone
Section titled “Start a clone”shadowclone clone start --repo owner/repository "<task>"works on a new branch,shadowclone/<id>.--issue <number>works on that issue, on the branchshadowclone/issue-<number>. With no task, the clone does the work that the issue describes.--pull <number>continues the work on that pull request’s branch. A clone cannot push to a fork.--review <number>posts a review of that pull request as you.
From an agent with the shadowclone MCP tools, ask for a clone in plain words. The agent calls shadowclone_clone with your task or the plan that you approved. shadowclone_sessions lists the clones. See the MCP guide.
shadowclone serve starts up to 2 clones at a time, oldest first. The others wait in the queue. A clone works for up to 170 minutes. It watches the CI of its pull request and fixes each failure before it stops.
Follow and stop clones
Section titled “Follow and stop clones”shadowclone clone listshows each clone with its state, branch, and pull request.shadowclone clone show <id>shows the task and the recent events.shadowclone clone logs <id>prints the end of the container log.shadowclone clone stop <id>stops a clone. A running clone first commits its unfinished work and pushes it to its branch. A queued clone never starts.
The states are queued, working, waiting (for your answer), done, failed, limited (the model login reached a usage limit), and stopped. clone show also prints the clone’s final report.
Steer a clone and answer it
Section titled “Steer a clone and answer it”shadowclone clone send <id> <message>gives a running clone a new instruction. Claude Code stops its current step and reads the message as a new turn. Codex reads it in the running turn.- When a clone needs your decision, it asks a question with a recommended option and keeps working on the rest.
clone listshowsneeds-youfor that clone, andclone showprints the question id. shadowclone clone answer <id> <question-id> <answer>answers it.- If the clone has nothing else to do, it waits up to 30 minutes for your answer. Then it takes its recommended option, skips each destructive step, and lists that step in its report.
What a clone can do
Section titled “What a clone can do”A clone works as you, through your fine-grained token. Its commits and pull requests show your name. Three markers show the agent’s part:
- The
shadowclonelabel on the pull request. - The line “Made by a shadowclone clone for @you.” in the pull request body.
- A
Co-authored-bytrailer for Claude or Codex on each commit. Setup with--no-attributionturns off the trailer.
A clone never pushes to the default branch. A git hook in the container refuses the push. Setup needs write access to the repository, and it changes none of the repository settings. If you want GitHub to block the push too, add a ruleset for the default branch yourself. Earlier versions of setup added the ruleset shadowclone sessions default branch. You can delete it in the repository settings.
A review runs the repository’s toolchain only on a pull request that you wrote in this repository. For a fork or a pull request from another person, the review runs none of its code and turns off web search.
Each repository has a daily limit of 20 clones, and one issue or pull request has one active clone at a time.
Stop and remove
Section titled “Stop and remove”- To stop all clones, stop the service:
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/dev.shadowclone.sessions.pliston macOS, orsystemctl --user disable --now shadowclone-sessions.serviceon Linux. - To remove the setup, delete
~/.shadowclone/clones/and the fine-grained token. Rundocker volume rm shadowclone-codex-loginif you used a ChatGPT login.
The run folders in ~/.shadowclone/clones/runs/ keep each task, its events, and its container log. shadowclone serve removes a finished run folder after 30 days.
Upgrade from cloud sessions
Section titled “Upgrade from cloud sessions”Clones replace cloud sessions. A /shadowclone comment no longer starts work, and the Cloudflare, Vercel, Modal, Daytona, and E2B hosts are gone.
- Run
shadowclone clone setup --repo owner/repositoryagain. A saved setup from an earlier version does not load. - If you used a cloud host, delete its deployment and the repository webhook that setup added.
The refs under refs/shadowclone/ and the status comments of earlier sessions stay in the repository. Nothing reads them anymore, so you can delete them.