runner
AGENTS.md206 starsChanged 2 months agoMITView on GitHub
This file is the repo-wide guide for any coding assistant working on Runner. Keep shared conventions here instead of putting them only in a tool-specific file such as CLAUDE.md. Runner is a local desktop app for coordinating multiple CLI coding agents from one UI. Users create reusable roles, compose them into crews, start missions, and interact with each session through a real PTY. Core vocabulary: Surface hierarchy (strict — do not blur these in code, docs, or UI copy): -…
- Deletes or force-pushes
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 4
Keep shared conventions here instead of putting them only in a tool-specific file such as CLAUDE.md.
- Very specific: line 53
Start the native app against the development database: make run.
- Very specific: line 63
Prefer the smallest check that covers the change.
- Distinctive: line 81
Follow existing local patterns before adding new abstractions.
- Very specific: line 82
Keep platform window chrome in crates/runner-app/src/platform_ui/{macos,windows}.rs and font mappings in the adjacent …
- Distinctive: line 83
Keep changes scoped to the request.
- Distinctive: line 84
Do not revert user changes.
- Distinctive: line 86
Use structured APIs and parsers when available instead of ad hoc string manipulation.
- Distinctive: line 88
Keep comments rare and useful.
- Distinctive: line 91
Do not add repo conventions only to an agent-specific file.
- Distinctive: line 96
Use focused commits with an imperative subject.
- Distinctive: line 103
Do not add tool-specific co-author trailers unless the user explicitly asks.
- Distinctive: line 117
When Jason asks for the post-mission cleanup, usually together with the merge, it covers three steps, in this order, once the PR has merged:
- Very specific: line 119
Archive the mission: Stop it if a session is still live (runner mission stop <id>), then runner mission archive <id>.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Runner Agent Guide
This file is the repo-wide guide for any coding assistant working on Runner.
Keep shared conventions here instead of putting them only in a tool-specific
file such as CLAUDE.md.
Product Context
Runner is a local desktop app for coordinating multiple CLI coding agents from one UI. Users create reusable roles, compose them into crews, start missions, and interact with each session through a real PTY.
Core vocabulary:
- Role: a configured CLI agent runtime and system prompt, reusable across crews.
- Crew: a named set of slots, each filled by a role, with exactly one lead.
- Mission: a live run of a crew, with one session per slot.
- Session: one spawned agent process attached to a PTY.
- Event: an NDJSON log entry used for mission coordination.
Surface hierarchy (strict — do not blur these in code, docs, or UI copy):
- Window: a real OS window (⇧⌘N). Multi-window support is impl 0018.
- Tab: one group of panes shown on a window's chat surface — the unit the layout picker builds and the sidebar highlights (formerly "chat group" / "split"). ⌘N starts a chat in a new tab.
- Pane: one slot inside a tab, holding a single chat session. Panes are filled from a pane's own New chat button or a sidebar pick.
Stack
- Native UI: GPUI with
alacritty_terminalas the terminal model and render buffer. - Application core: Rust, SQLite via
rusqlite, exposed bycrates/runner-backend. - PTY runtime:
portable-pty. - Event transport: append-only NDJSON logs watched through
notify. - Bundled CLI:
runner, built from thecrates/runner-cli/workspace member.
Project Map
crates/runner-app/: GPUI application, terminal renderer, and terminal fixture corpus.crates/runner-backend/: UI-agnostic application core, including SQLite, session manager, event bus, router, and MCP server.crates/runner-cli/: the bundledrunnerCLI, used by spawned agents inside a mission and by people, scripts and agents outside one.crates/runner-core/: shared event-log primitives.design/: Pencil source files.docs/arch/: architecture references (how it works).docs/product/: product vision and direction (why we're building this, what surfaces matter).docs/features/: in-progress feature specs, named{tracking-issue}-{slug}.mdsince 2026-09-01 (file the issue first); shipped specs live indocs/features/archive/.docs/impls/: implementation plans; shipped plans live indocs/impls/archive/, mission briefs indocs/impls/briefs/.docs/tests/: validation and smoke-test plans; records of shipped features live indocs/tests/archive/.docs/roadmap.md: where the project is, mirrored from the GitHub milestones and dated.docs/tech/: deep dives on the libraries Runner builds on (how the dependencies work), pinned to the versions inCargo.lock.
Development Commands
- Start the native app against the development database:
make run. - Format:
make fmt. - Clippy:
make clippy. - Workspace tests:
make test. - Local validation:
make verify(check + test + clippy + fmt-check).
CI runs Clippy and workspace tests with --profile ci, which uses lighter dependency optimization and debug information. Reproduce it with cargo clippy --locked --workspace --all-targets --profile ci -- -D warnings and cargo test --locked --workspace --no-fail-fast --profile ci --timings; macOS also checks formatting and Clippy with --features updater. Normal development uses the dev profile; releases use level 3 optimization with thin LTO and Cargo's default codegen units.
On Windows, use .\make.cmd run to build and start the app with its CLI sidecars, or .\make.cmd build to build only. Add --release for optimized binaries under target\release; the default development binaries are under target\debug. Use .\make.cmd clean to remove the Cargo target directory, or .\make.cmd clean --release to clean only release outputs; close the development app and finish other builds first. Installed apps, user data, Rust toolchains, and Cargo's shared dependency cache are kept. The script works in PowerShell and Command Prompt without GNU Make; use the native Cargo commands in Local Windows development for checks.
Prefer the smallest check that covers the change. For native UI changes, run the runner-app tests plus workspace clippy; for core behavior, run the relevant crate tests.
Full Smoke Tests
When Jason explicitly requests a complete smoke test for a major refactor or important release, follow Full smoke test procedure. It covers live runtime lifecycle checks through the development Runner UI and CLI, with a result matrix and cleanup. Add the change's feature-specific checks and record platform or runtime gaps explicitly. Ordinary implementation and CI do not authorize launching real agents; an explicit live smoke-test request supplies that authorization for the bounded test chats and missions in the procedure. Use development data, preserve existing sessions, and archive only the test chats and missions you created. Record each run in docs/tests/; the #777 run is the first example.
Worktrees
The checkout at the repository root stays on main. Every branch of work gets its own linked worktree under .worktrees/, named after the branch with its slashes flattened: fix/659-session-start-status lives in .worktrees/fix-659-session-start-status. Create it with git worktree add .worktrees/<flattened-branch> -b <branch> origin/main and remove it with git worktree remove once the branch has merged. Because the directory name is the branch name, an editor window's title says which work it holds, and either name can be derived from the other.
.worktrees/ is ignored, and nesting is safe in the ways that matter: git clean -xfd skips a nested worktree and reports it as a skipped repository, so removing one takes a deliberate -ff; the workspace members in Cargo.toml are explicit paths, so a nested checkout is never part of a build; and ripgrep honours the ignore, so a search from the root checkout does not cross into another branch's copy.
Each worktree carries its own target/ and pays for its own build. Do not point them at a shared CARGO_TARGET_DIR: Cargo takes an exclusive lock on the target directory, so concurrent worktrees would queue behind each other instead of building in parallel.
Work stays inside its own worktree. When several are live at once, treat the others as another machine's checkout. Design files are the exception: .pen files are opened and edited only in the root checkout on main, even when the code they describe is on a branch.
Engineering Conventions
- Follow existing local patterns before adding new abstractions.
- Keep platform window chrome in
crates/runner-app/src/platform_ui/{macos,windows}.rsand font mappings in the adjacentfonts_{macos,windows}.rs, selected at compile time. Windows layout changes must preserve the macOS implementation; share sidebar and workspace content across platforms. - Keep changes scoped to the request. Avoid unrelated refactors.
- Do not revert user changes. If the working tree is dirty, inspect first and preserve unrelated edits.
- Use structured APIs and parsers when available instead of ad hoc string manipulation.
- Keep comments rare and useful. Explain non-obvious intent, not mechanics.
- Treat
design/runner-mvp-design.penas the historical MVP canvas. Put new product work in a feature-scoped.penfile and keep UI aligned with the file and node referenced by the user or feature spec. The active canvas isdesign/runner.pen, the product canvas of screens andcmp/components; feature specs go indesign/specs/<issue>-<slug>.pen, one file per spec, since 2026-09-18. A spec file holds only the frames that spec needs, plus thecmp/components they reference; it is never a full copy ofrunner.pen. Design files live in the root checkout onmain, never in a worktree: design and spec are settled onmainfirst, and a branch's code follows them. The gpui-rewrite's parity exception (plan decision 1) ended at thev0.6.0cutover on 2026-08-23. README.mdandREADME.zh-CN.mdchange together: a PR that edits one edits the other, and a paragraph that cannot be translated yet is marked<!-- TODO zh-CN -->rather than left silently behind.- Do not add repo conventions only to an agent-specific file. Update this file and leave tool-specific files as pointers if needed.
Commit And PR Conventions
- Use focused commits with an imperative subject. A crew mission's pull request is one commit; see Crew Missions.
- Common scopes:
db,commands,ui,event-log,session,event-bus,router,cli,mission,docs,validation. - Example:
fix(session): preserve terminal geometry on tab switch. - A doc-only change (
docs/, the READMEs, this file) is committed straight tomainfrom the root checkout, with no branch, worktree or pull request; a mission brief still goes on its mission's branch. Open a PR for docs only when the edit is large and spans several files, such as a restructure or a rename across the docs tree. - For validation branches, keep PR descriptions current when scope changes.
- Bring a branch up to date by rebasing it onto
origin/mainand pushing withgit push --force-with-lease; never mergemaininto a branch. A PR's history stays its own commits on top ofmain. - Do not add tool-specific co-author trailers unless the user explicitly asks.
Crew Missions
A crew mission ends in an open pull request by default. The crew works on its own branch in its own worktree, commits, pushes, opens the PR against main, and drives CI green on both platforms; then it stops. Jason reviews the PR and does the final merge, or explicitly asks the crew to merge after review and CI are clean. Crews do not cut a nightly or release without explicit authorization. Every mission brief states this in its authorization section, and a crew whose brief is silent on it follows this rule anyway.
An explicit merge request includes GitHub's configured automatic deletion of the merged remote branch; no separate confirmation is needed. Local branch and worktree cleanup still requires explicit authorization; see Post-mission cleanup.
A mission runs in its worktree. Before starting it, create the worktree as described under Worktrees and commit the brief on its branch; then start the mission with the worktree as its directory, runner mission start --crew <crew> --cwd <repo>/.worktrees/<flattened-branch> …, not --project runner. Every slot's agent and shell then start in the worktree instead of the root checkout, the mission still lands under the runner project because the project is inferred from the directory, and the brief names the same path.
A mission lands as a single commit. Before pushing, the crew squashes everything on its branch, the brief commit included, into one commit on top of main, with a subject that names the change rather than the brief. Fixes after the push, from review or CI, are folded into that commit with git commit --amend and pushed with git push --force-with-lease, so the pull request always shows one commit. Split into more than one commit only when the mission covers changes that are unrelated to each other, such as a fix and an independent cleanup that could each be reverted alone, and say why in the pull request body. Every mission brief states this in its authorization section, and a crew whose brief is silent on it follows this rule anyway.
Post-mission cleanup
When Jason asks for the post-mission cleanup, usually together with the merge, it covers three steps, in this order, once the PR has merged:
- Archive the mission. Stop it if a session is still live (
runner mission stop <id>), thenrunner mission archive <id>. - Remove the worktree and branches.
git worktree remove .worktrees/<flattened-branch>, then delete the local branch. Squash and rebase merges leave the branch unmerged by ancestry, so confirm the PR merged withgh pr viewrather thangit branch --merged. GitHub deletes the remote branch on merge; delete it by hand only if it is still there. - Archive the docs, in one doc-only commit on
main. Move the test record todocs/tests/archive/. Prune the mission briefs (git history keeps them) unlessdocs/impls/briefs/README.mdkeeps one as a reference. When the tracking issue closes, which for a multi-PR feature means after its last PR, move the spec todocs/features/archive/and itsdocs/features/README.mdentry to Shipped. Repoint every link to the moved files and updatedocs/roadmap.md.
Notes For Agent Runtimes
This repository is intentionally agent-agnostic. Claude Code, Codex, or any
other assistant should read AGENTS.md as the shared guide. Tool-specific
instruction files may exist only as compatibility entrypoints and should point
back here.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

