Attached repo and coding
Bind a GitHub repository so Agent mode can clone and edit code in a sandbox.
Brain is not a full IDE (no LSP or inline apply). In Agent mode you can attach a GitHub repo so the agent clones it into a temporary sandbox at /workspace — not onto your Brain server disk.
Attach a repo
- Switch composer mode to Agent
- Open the Attached repo control in the composer
- Paste
owner/nameor a GitHub URL (optional git ref) - Clear the attachment when finished
For private repositories, connect GitHub first so clone credentials work.
What the agent does
- Clones into the sandbox workspace
- Explores and edits with coding tools
- Can follow the open PR skill: create a branch, commit, push, and open a pull request
Ask mode ignores coding tools even if a repo is attached.
Opening a pull request
Ask in Agent mode to open a PR after the change is ready. Typical flow:
- Branch from the attached ref
- Commit sandbox changes
- Push to GitHub
- Open the PR via GitHub MCP (needs GitHub connected)
Review the PR on GitHub like any other change.
Dual path
| Situation | Path |
|---|---|
| No repo attached | Chat + MCP apps you enabled |
| Repo attached (Agent) | Sandbox coding + MCP as needed |
Prefer the sandbox harness for local file edits; use GitHub MCP for remote GitHub API operations (PRs, issues).
Host requirements (microsandbox)
Brain pins microsandbox for the coding sandbox (not Vercel Sandbox).
| Host | Requirement |
|---|---|
| Linux | KVM available to the container/VM |
| macOS | Apple Silicon |
If the runtime is missing, coding tools fail with a clear error. Operators may need the microsandbox platform install or MSB_PATH pointing at the binary. There is no Brain-specific sandbox API key in .env.example.
See Troubleshooting if attached-repo turns fail after deploy.
