Using with agents
AI agents increasingly create their own worktrees. These recipes make the worktrees they create ready to build, with the files your repository declares in .taxilane.json (and .worktreeinclude) and your project’s local files, and keep them visible and cleanable in Taxilane. They all rely on the taxilane command being on your PATH (see Installation).
Per-worktree environment
Section titled “Per-worktree environment”A worktree isolates files, not ports. When the repository declares variables in .taxilane.json, each worktree gets its own values:
{ "env": { "PORT": "${port}", "API_URL": "http://localhost:${port:api}", "APP_SUFFIX": "-${worktree}" }, "envFile": ".env.taxilane"}${port}reserves a port for that variable and${port:<key>}one shared by every variable using the key. Ports start at 20000, are unique among the repository’s worktrees, are free when reserved and never change afterwards. They’re kept in Git’s own folder for the worktree, so removing the worktree releases them.${worktree}is the worktree’s folder name;$$is a literal$.taxilane envprints the current worktree’s variables asexportlines (--format dotenvorjsonfor other tools), soeval "$(taxilane env)"sets them in a shell.envFile(optional) is written into each worktree when it’s created or provisioned, in dotenv format, for tools that read one. It’s never written over a file Git tracks, so add it to.gitignore.
For Android repositories, "providers": { "emulator": {} } adds ANDROID_SERIAL=emulator-<port> to every worktree’s environment, so ./gradlew installDebug, connectedAndroidTest and plain adb commands only use that worktree’s emulator. The adb server itself is shared by every worktree, so an agent must never restart it (adb kill-server) or force a device with -s, -e or -d; the SessionStart hook tells Claude so. Agents start it with taxilane emulator start (it waits until the emulator has booted); see Providers › Android emulator for the AVD and window settings. Likewise, "providers": { "ios-simulator": {} } gives each worktree its own iOS simulator and IOS_SIMULATOR_UDID; agents boot it with taxilane simulator start and build with xcodebuild -destination "id=$IOS_SIMULATOR_UDID", and KMP tests use it once the build script (or the machine-wide init script) passes it to device (Providers › KMP tests). On macOS, "providers": { "desktop-app": { "module": ":desktopApp" } } lets agents check a Compose Desktop app without computer use: taxilane headless start runs the worktree’s app hidden, the Compose Hot Reload MCP server drives it and taxilane headless capture shows it (Checking a desktop app in the background). What still needs the real desktop is driven with computer use one agent at a time: in any repository, an agent takes the machine’s desktop turn with taxilane desktop acquire --wait first and gives it back with taxilane desktop release (desktop). When a task needs real hardware or a specific model, an agent in a repository with the emulator or iOS simulator provider borrows one of the phones or tablets connected to the machine with taxilane device acquire (--wait in the background when none is free), passes TAXILANE_ANDROID_DEVICE_SERIAL or TAXILANE_IOS_DEVICE_UDID to its tools explicitly and gives it back with taxilane device release; connected devices are lent to agents until you withdraw them (Providers › Physical devices).
For Gradle repositories, settings in the Gradle provider ("providers": { "gradle": { "daemonMaxHeap": "2g", "idleTimeoutMinutes": 30 } }) add the same GRADLE_OPTS to every worktree’s environment, so the daemons that agents’ builds start use that heap and idle timeout instead of the ones in gradle.properties, and can be shared between worktrees. It replaces a GRADLE_OPTS already set in the shell, and doesn’t reach builds started from an IDE (Providers › Daemon memory and lifetime per worktree).
For Xcode repositories, "providers": { "xcode": { "compilationCache": true } } adds XCODE_XCCONFIG_FILE to every worktree’s environment, pointing to a machine-wide .xcconfig that turns on compilation caching with prefix mapping, so an agent’s first xcodebuild in a new worktree reuses what other worktrees already compiled. It replaces an XCODE_XCCONFIG_FILE already set in the shell, doesn’t reach Xcode opened from the Dock and doesn’t help Swift packages. With "cocoaPods": true, a new worktree gets the base repository’s CocoaPods pods cloned when its Podfile.lock matches, and taxilane new (also for a multirepo group), taxilane provision and the desktop app name the folders that still need pod install, with the same notice. Agents can check DerivedData with taxilane xcode and delete the orphaned folders with taxilane xcode clean (Providers › Xcode).
For Flutter repositories, "providers": { "flutter": {} } runs flutter pub get (fvm flutter pub get with .fvmrc) in every new or provisioned worktree, so it builds at once. Flutter doesn’t read ANDROID_SERIAL, so the SessionStart hook tells Claude to start the worktree’s device first and always pass it with flutter run -d "$ANDROID_SERIAL" or -d "$IOS_SIMULATOR_UDID", and never to launch emulators with flutter emulators --launch (Providers › Flutter).
When Google’s android CLI is installed, the SessionStart hook of a repository with the emulator provider tells Claude to pass --device "$ANDROID_SERIAL" to android run, install, layout, screen and input, never to start or stop emulators with android emulator, and to pass --no-metrics unless you turned its metrics on. Taxilane never runs android init (Providers › Google’s Android CLI).
The recipes below show how each agent gets these variables.
Approving a repository
Section titled “Approving a repository”Agent hooks and the Herdr plugin can’t ask you anything, so they never run a repository’s hooks.postCreate commands, nor deliver the variables it declares in env or write its envFile, until you have approved them on this machine: they provision the worktree, skip them and print a note on standard error that names taxilane trust. Run it once in each repository you trust:
taxilane trust # show the commands, variables and environment file, and asktaxilane trust --yes # approve without askingAfter that the hooks run and deliver them, until the repository’s commands or variables change; then you approve again. Details: Approving a repository.
Claude Code
Section titled “Claude Code”Claude Code’s WorktreeCreate hook replaces its own worktree creation for claude --worktree, EnterWorktree, subagents with isolation: "worktree" and background sessions. One command points it at taxilane, together with WorktreeRemove so cleanup goes through Taxilane too, and with the hooks that report the agent’s state (below):
taxilane hooks installIt shows what it will add to your ~/.claude/settings.json and asks before writing; --yes skips the question. Your other settings and hooks are kept, running it again changes nothing, and after upgrading Taxilane it adds or replaces only the hooks that changed. taxilane hooks install --project writes the repository’s .claude/settings.json instead (shared with the team), taxilane hooks status says whether they are installed, outdated or missing, and taxilane hooks uninstall removes them. The desktop app does the same from Settings › Claude Code, with “Install”, “Update” and “Remove”, and suggests it once when it finds a Claude agent without a known state. CLAUDE_CONFIG_DIR is honored. A settings file that isn’t valid JSON is never overwritten.
The hooks it installs, each one a command hook:
| Event | Command |
|---|---|
WorktreeCreate |
taxilane hook worktree-create |
WorktreeRemove |
taxilane hook worktree-remove |
SessionStart |
taxilane hook session-start |
UserPromptSubmit, Notification, Stop, SessionEnd |
taxilane hook agent-state |
PreToolUse, for Bash commands that mention computer ("if": "Bash(*computer *)") |
taxilane hook desktop-turn |
PreToolUse, for Claude’s computer-use tools that act on the desktop (clicks, typing, keys, scrolling, opening an app, writing the clipboard, batches) |
taxilane hook desktop-turn |
The hooks run taxilane, so it must be on the PATH of the shell you run Claude Code from. In the desktop app, Preferences and the board’s hooks notice show this prerequisite next to “Install”, keep it disabled until the command is available and offer “Install command-line tool” (see The taxilane command).
What happens then:
claude -w TASK-123askstaxilanefor the worktree. It’s created onfeature/TASK-123in your Taxilane project’s worktrees folder, or in.claude/worktrees/(Claude Code’s usual place) when the repository has no project, and provisioned. Claude Code starts the session inside it.- Running
claude -w TASK-123again reuses that worktree. - When Claude Code removes the worktree (you choose to remove it when exiting, or it had no changes),
taxilaneremoves it and deletes its branch only if it’s merged; a branch with work is kept. - With this hook Claude Code no longer processes
.worktreeincludeitself; Taxilane reads it instead, so its files are still copied. SessionStartappends the worktree’senvvariables to the session’sCLAUDE_ENV_FILE, so every Bash command Claude runs sees them ($PORT), and tells Claude which variables this worktree has, without their values. It only does so in a repository registered as a project, and only delivers the declared variables once the repository is approved; while they await approval, it names them and tells Claude to ask you to review them withtaxilane trustinstead of approving them itself. It also gives the session Taxilane’s workflow rules: a short list adapted to where it runs, including how to start the emulator or the iOS simulator when the repository uses those providers. Its workflow rules reach any session started inside a worktree or the main checkout of a Git repository, also without--worktreeand also when the repository declares noenv(then there is no variables line and nothing is written toCLAUDE_ENV_FILE).
Claude Code only runs a repository’s project hooks once you’ve trusted its folder. If the hooks live in the repository’s .claude/settings.json and you’ve never run claude there, claude -w stops with “Workspace trust not yet accepted”: run claude once in the repository, accept the trust dialog, and retry. Hooks in ~/.claude/settings.json don’t need this for repositories you already trust.
The new worktree starts from the HEAD of the worktree Claude Code runs in (the main checkout’s current commit when you start there), like taxilane new, and Claude Code’s worktree.baseRef setting doesn’t apply. Checked with Claude Code 2.1.306.
Agent states outside Herdr
Section titled “Agent states outside Herdr”The agent-state hooks record whether each Claude session is working (UserPromptSubmit), blocked (Notification, for example a permission prompt), done (Stop, or a Notification saying the prompt has been idle) or over (SessionEnd). The desktop app and taxilane status show that state for Claude agents without Herdr, and a blocked or done agent puts its worktree under “Waiting for you”.
- Each session is a small file in the worktree’s own Git folder (
<git-dir>/taxilane/agent-sessions/), so it never shows up as a change, isn’t copied to other worktrees and goes away with the worktree. - A record counts only while its Claude process runs; records left by a crash are ignored and deleted.
- Granting a permission fires no hook. A blocked session whose transcript is written to afterwards reads as working, so the state follows the permission being granted.
- When Herdr or Orca also reports the agent, their state is used.
- When neither the hooks, Herdr nor Orca give a Claude agent a state, Taxilane takes the status Claude Code itself keeps for each live session in its registry (
~/.claude/sessions/): busy as working, waiting as blocked, and idle as done after a turn or idle before the first one. It’s shown withstateSourceclaude-codetoo. - Other agents (Codex, Gemini…) have no such hooks and show without a state unless Herdr reports them.
- When the session that holds the desktop turn ends its response (
Stop) or ends (SessionEnd), the turn is released for the next agent waiting. - These recorded sessions also protect a worktree’s emulator and simulator: a working session renews the device lease and is never released from under it, while a blocked one is released last. Herdr’s states aren’t used for this. See Providers.
Herdr is a terminal multiplexer for AI agents: it keeps their sessions running in the background and shows which one is working, blocked or done. Herdr runs the agents and Taxilane creates and prepares the worktrees they work in.
Recommended flow. Create the worktree from Taxilane (the desktop app or taxilane new), so it lands in the project’s worktrees folder, provisioned, with its ports and environment. Then use the “Open in Herdr” action of its row in the desktop app: Herdr opens it as a worktree of its repository, grouped under the repository’s space like its own “Open worktree…”, focused, with a single pane whose shell already has the worktree’s environment (PORT, ANDROID_SERIAL, …, everything taxilane env prints), and runs the project’s agent command there, the same command “Copy command” copies. If Herdr already has that worktree open with an agent running in it, the action only focuses that agent’s pane and doesn’t type anything; if the workspace is open but its agent is gone, it starts the agent in a new pane of that workspace with the same environment and leaves the other panes alone. Each time it types the agent command it waits up to 10 seconds for Herdr to detect the agent, and reports an error naming the pane and the command if it doesn’t. Herdr’s server must be running (herdr); the action calls herdr directly and doesn’t need taxilane on any PATH. From a terminal, or from an agent, taxilane open <task id> --herdr does the same (--agent <name> picks another of the project’s agents).
Agent states. While Herdr is running (for Claude without Herdr, see Agent states outside Herdr), the desktop app and taxilane status show the state Herdr reports for each agent in a worktree: working, blocked (waiting for you, for example on a permission prompt), done or idle. A worktree whose agent is blocked or done is listed under “Waiting for you”, and “Open in Herdr” focuses that agent’s pane instead of only opening the workspace. Agents Herdr sees count as running even if the process list can’t, so cleanup keeps their worktrees. If Herdr isn’t installed or its server isn’t running, agents are shown without a state and nothing reports an error; Taxilane asks Herdr at most once every 30 seconds after a failure.
Don’t use Herdr’s “New worktree” (or herdr worktree create) for Taxilane projects: Herdr always places those checkouts in its own folder (~/.herdr/worktrees/<repo>/<branch>, or the [worktrees] directory of its config.toml), outside the project’s worktrees folder, and Taxilane lists them with the Herdr origin.
Rescue path: the Taxilane plugin for Herdr. For worktrees created from Herdr anyway, by mistake or by an agent through Herdr’s API, install the plugin once:
herdr plugin install CiroFeliu/Taxilane/integrations/herdrThe plugin is installed from the repository’s default branch, main, which only receives released code, so it matches the released taxilane. The plugin’s manifest and notes live in integrations/herdr/ in the repository. On every worktree Herdr creates, it runs taxilane hook herdr, which provisions it like taxilane provision does: files from .taxilane.json and .worktreeinclude, your project’s local files, reserved ports and envFile. When the repository has a Taxilane project and the worktree is outside its worktrees folder, it also shows a Herdr notification saying so and recommending creating worktrees from Taxilane.
The plugin also listens to worktree.removed: when you remove a worktree from Herdr (“Remove worktree” or herdr worktree remove) in a repository with a Taxilane project, taxilane hook herdr deletes its branch if Git considers it merged, and keeps it otherwise, the same as removing from Taxilane does. Run herdr plugin update to get this on an existing install.
The other way round needs no plugin: removing a worktree from Taxilane (the row’s remove action, “Clean up”, taxilane clean --yes or Claude Code’s removal) also closes its Herdr workspace, and the agent running there, once the worktree is removed. The dialogs say beforehand which worktrees are open in Herdr; if Herdr isn’t installed or running, nothing changes, and if closing the workspace fails, the removal still counts and a warning shows Herdr’s message.
- The plugin runs
taxilane, so it must be on thePATHof the shell you start Herdr from (Herdr’s background server keeps that shell’s environment; restart it withherdr server stopafter installingtaxilane).herdr plugin logshows each run with the files it copied, or the error. - Herdr opens the new workspace a moment before the plugin runs; an agent you start instantly could find the files still being copied.
- The plugin doesn’t type anything into the new workspace’s shell. Its variables reach agents the usual way: Claude Code’s
SessionStarthook above, theenvFile, ordirenv(see below).
Orca is a desktop app for running coding agents in worktrees: it lists each repository’s worktrees, opens terminals in them and shows which agent is working, waiting or done. Orca is optional: without it nothing changes. Taxilane works with Orca 1.4.243 or newer, found as orca (~/.local/bin, /opt/homebrew/bin, /usr/local/bin, the app bundle on macOS, then the PATH) or, on Linux, only as orca-ide, since orca there is usually GNOME’s screen reader.
Recommended flow. Create the worktree from Taxilane, then use “Open in Orca” in its detail or its row’s context menu, or taxilane open <task id> --orca from a terminal or an agent (--agent <name> picks another of the project’s agents). Taxilane:
- starts Orca when it isn’t running and waits up to 30 seconds for it;
- registers the repository with Orca when Orca doesn’t know it, and, when Orca would hide worktrees it didn’t create for that repository, sets that repository’s “non-Orca worktrees” visibility to show them (no other repository’s setting changes);
- focuses the worktree’s terminal when Orca already reports a live agent in it (a finished turn counts), without typing anything;
- otherwise opens a new focused terminal in the worktree that runs the project’s agent command with the worktree’s environment (
env 'PORT=…' … claude -n <session name>, or$env:NAME = '…'; …on Windows) and waits up to 10 seconds for Orca to report the agent, failing with the terminal and the command if it doesn’t. The terminal stays open either way.
Taxilane runs the project’s own command rather than Orca’s agent launcher, whose default runs Claude with full access, and Claude sessions get the same -n name as in Herdr, so inter-agent messages reach them.
Agent states. While Orca is running, the desktop app and taxilane status show the state Orca reports for each agent: working, blocked (Orca’s “waiting”, for example on a permission prompt) or done, with stateSource orca. Orca’s state wins over the one Claude Code’s hooks record. Taxilane asks Orca once per refresh with orca worktree ps, never starts it for this, and after a failure or a closed Orca waits 30 seconds before asking again. Orca reports these states through its own agent hooks in ~/.claude/settings.json, and it also recognizes an agent started in a new terminal without them. With the hooks off (orca agent hooks off, applied when Orca restarts), Orca loses track of a Claude whose terminal outlived a restart of Orca. Taxilane then falls back to Claude Code’s session registry: “Open in Orca” finds that Claude through the terminal Orca gave its process (ORCA_TERMINAL_HANDLE) and focuses it instead of starting a second agent, an agent Taxilane starts counts as started once its session appears in the registry, and the agent’s state comes from the registry (see Agent states outside Herdr). Finding the terminal reads the process’s environment, which Taxilane can do on macOS and Linux but not on Windows.
Board, comment and links. While Orca is running, Taxilane keeps each worktree Orca lists in step with its own view, on the desktop app’s refresh, after “Open in Orca” or taxilane open --orca, after taxilane hook orca setup, after each of Claude Code’s agent-state hooks (in the background, so the desktop app doesn’t need to be open), and with taxilane orca sync:
- Board status. New worktrees go to
todo, ones with an agent working, waiting for you or with unfinished work toin-progress, pushed (or inactive) ones toin-review, and merged ones tocompleted. Taxilane only writes the status when the worktree’s state changes, so a card you move by hand stays put until then. - Comment. The comment shows Taxilane’s summary, such as
Taxilane: unfinished · 3 uncommitted changes · 2 commits not pushed. It’s only written while the comment is empty or still Taxilane’s; a comment you type in Orca is kept. - Links. With the GitHub CLI (
gh) installed and signed in, a pushed branch’s pull request is linked, and so is the issue a branch is named after (123-login,issue-123orgh-123) when it exists. A link already set in Orca is never replaced or cleared. Taxilane asks GitHub at most once every 10 minutes per worktree, counted across the app, the hooks and the command line.
The main worktree, worktrees Orca doesn’t list and folder workspaces are left alone, and Orca is never started for this. A failed update never fails the action: the command line prints taxilane: couldn't update <path> in Orca: … and the app tries again on its next refresh.
What the agent is doing. With the states, Orca reports what each agent waits on, what it was asked and what it last said. The worktree’s detail shows, under each agent Orca reports, the tool it waits on with its input (only while it’s blocked, for example Waiting on Bash: npm test on a permission prompt), its prompt and its last message, each shortened to three lines, and taxilane status --json gives them in each agent’s activity.
Ports Orca sees. Orca ties the ports listening on the machine to the worktree their process runs in, also for worktrees it only shows, such as Taxilane’s. With the states, Taxilane reads them with one orca ports --all per refresh, under the same rules: the worktree’s detail lists them after the ports Taxilane reserves, with the process and the address a dev server printed in an Orca terminal, and marks the reserved ports Orca sees listening; taxilane status adds listening=<ports> and its JSON listeningPorts.
Origin. Worktrees Orca created are labelled “Orca”. A Taxilane worktree opened in Orca keeps its Taxilane label. While Orca can’t be asked, worktrees inside the folder where Orca last created one, or ~/orca/workspaces, are labelled “Orca”.
Worktrees created from Orca. Orca creates its worktrees in its own folder with branches named <git user>/<name>. Prefer creating them from Taxilane. For the ones created from Orca anyway, add Taxilane to the repository’s orca.yaml, as described in Configuration: taxilane hook orca setup provisions them like taxilane provision and notes when they’re outside the project’s worktrees folder, and taxilane hook orca archive frees their emulator, simulator and idle Gradle daemons before Orca removes them.
Removal. Removing a worktree from Taxilane (the remove action, “Clean up”, taxilane remove, taxilane clean --yes or Claude Code’s removal) also closes its Orca terminals, and the agents in them, once the worktree is removed; a folder locked by those shells gets its terminals closed and the removal retried once. The dialogs and taxilane clean’s dry run say beforehand which worktrees have Orca terminals. If Orca isn’t installed or running, nothing changes and Orca isn’t started; if closing fails, the removal still counts and a warning shows Orca’s message.
Computer use. Orca’s computer use is its orca computer command, which the agent runs from its shell to click, type and press keys in another app’s window. With Taxilane’s hooks installed, Claude Code takes the machine’s desktop turn for the worktree before each orca computer command that acts on the desktop, renewing it while the agent keeps acting, and the turn is released when the response ends, as for any other computer use. While another worktree holds the turn, or others wait for it, the command is blocked and the agent is told who holds the desktop until when and to wait for it with taxilane desktop acquire --wait in the background. The commands that only look (capabilities, permissions, list-apps, list-windows, and get-app-state without --restore-window) never need the turn. Other agents in Orca, such as Codex, don’t run Taxilane’s hooks and only get the rule from the workflow guide.
Emulators. In a repository with the emulator provider, starting a worktree’s emulator (taxilane emulator start, or Start in the app) while that worktree is open in a running Orca also shows the emulator in the worktree’s emulator view in Orca, with live video, even when it runs without a window. Opening a worktree in Orca while its emulator runs shows it there too, and the agent’s terminal stays in front. Taxilane never starts Orca or the emulator for this, and if Orca can’t show it the start or the open still succeeds (taxilane emulator start says why on standard error). Stopping the emulator needs nothing from Orca: its view keeps the last frame until the next start shows it live again. Close Orca’s emulator tab rather than using it to stop the emulator. A tab opened from Orca’s own “+” menu, where you pick the device by hand, shuts the emulator down when you close it. Taxilane then shows it as stopped, and taxilane emulator start boots it again.
iOS simulators. In a repository with the iOS simulator provider, the worktree’s simulator is shown in its Orca emulator view the same way: when taxilane simulator start (or Start in the app) boots it while the worktree is open in a running Orca, and when the worktree opens in Orca while its simulator is booted. Shutting the simulator down needs nothing from Orca either. Orca’s view shows one device per worktree, and when another device is shown in that worktree, Orca shuts down the simulator it was showing. So when a worktree’s emulator and simulator are both running, Taxilane shows neither, and says why (orcaView: skipped for a start). For the same reason, picking another device by hand in the view of a worktree that shows its simulator shuts that simulator down; taxilane simulator start boots it again.
Multirepos. In a multirepo folder, taxilane open <id> --orca and the group header’s “Open all in Orca” open every worktree of the group under its own Orca repository, and taxilane open --orca and “Open multirepo agent in Orca” run the multirepo agent in Orca’s workspace for the multirepo folder. A folder that isn’t a Git repository needs a one-time setup in Orca’s app first; see Multirepos and groups. While Orca reports an agent in that workspace, the multirepo view shows its state as for a worktree’s agent.
Choosing the runner
Section titled “Choosing the runner”Herdr and Orca are both first-class runners. Choose the one you use in the desktop app’s Settings, under Tools → Default runner; it’s saved in ~/.taxilane/settings.json, so taxilane uses it too. The runner in use is the one you chose while it’s installed; otherwise it’s the first installed of Herdr and Orca, and Herdr when neither is. It decides:
- what a worktree’s main open action, the Worktree menu’s open item and its shortcut (Cmd+O on macOS, Ctrl+O elsewhere) open in, and what the guided tour offers;
- which runner comes first in a worktree’s detail, its row’s context menu, a group’s header and the multirepo agent’s menu (the other stays available);
- where the “New change” selector starts;
- where
taxilane open <target>opens when you pass neither--herdrnor--orca; - which runner the workflow rules below name:
taxilane open <id> --orcawhen Orca is in use.
Taxilane’s workflow rules
Section titled “Taxilane’s workflow rules”Agents that work in Taxilane’s worktrees tend to break its flow: they switch the branch of the worktree a session starts in, create worktrees outside taxilane, type into another session’s terminal or clean worktrees without asking. The rules that follow from how taxilane works are kept in one catalog, versioned with the binary, in four topics: worktrees, parallel, resources and cleanup. They are defaults: every output says that the project’s AGENTS.md and your own instructions take precedence. Personal or team preferences (code style, commits, pull request format or reviewers) are not part of it; the one rule about pull requests points to a fact Taxilane records: open them against the branch taxilane base prints.
-
Claude Code gets the short subset, adapted to the session, from the
SessionStarthook (at most eleven lines, ending with a pointer to the rest): the rule about the main checkout or the worktree, opening sessions withtaxilane open --herdror--orca, after the runner in use, and messaging them only when that runner is available (Herdr answering, or Orca installed, since opening starts it), the emulator and simulator rules only when the repository declares those providers, one line pointing totaxilane headless startwhen it declares the desktop app, and asking beforetaxilane clean --yes. Rules about rare actions stay out of it and are told when they happen:taxilane newprints the commit a new branch starts at, and Claude’s computer use (its own tools ororca computer) takes the desktop turn through thePreToolUsehook, which only stops it, explaining how to wait, when another worktree holds the turn; likewise a heavy build (Gradle, Maven,xcodebuild,swift buildorswift test) run outside the build turn is turned away by thePreToolUsehook with thetaxilane build run --command to run instead. A backend session gets no rule about the desktop, emulators or simulators. -
Any agent can read all of it with
taxilane guide [<topic>]: the rules that apply where it runs first, then the ones that don’t, each marked with what it needs.taxilane guide --plainprints every rule without looking at the directory, so it also works outside a repository. -
Agents without hooks (Codex, Gemini CLI, Cursor) get a minimal block in the
AGENTS.md-style file they read, which only says to runtaxilane guide, so the rules always come from the installed binary:Terminal window taxilane guide install --agent codex # ~/.codex/AGENTS.md (or $CODEX_HOME/AGENTS.md)taxilane guide install --agent gemini # ~/.gemini/GEMINI.mdtaxilane guide install --project # the repository's AGENTS.md, which Cursor readstaxilane guide install --file <path> # any other filetaxilane guide status # installed, outdated or missing in each of themtaxilane guide uninstall --agent codexThe block sits between
<!-- taxilane:guide v1 -->and<!-- /taxilane:guide -->; everything else in the file is kept byte for byte, installing again never duplicates it and an older block is replaced. It shows what it will write and asks[y/N]unless--yesis given. Cursor keeps user rules in its settings, not in a file, so for it use--projector--file. Claude Code isn’t an--agent: it has the hook, and a block in the project’sAGENTS.md(which Claude Code reads throughCLAUDE.md) would give it the rules twice, whichtaxilane guide statuswarns about.
Migrating your own instructions
Section titled “Migrating your own instructions”If your AGENTS.md already repeats these rules, run taxilane guide --migrate --file <path> and give its output to your agent. It prints every rule with its id and asks the agent to list what the file repeats, propose removing it and show the diff without applying anything until you confirm. The command doesn’t read or write the file. taxilane guide install and status also warn when the file mentions taxilane new, taxilane open or taxilane clean outside the block, and never change that text. For a repository’s AGENTS.md, do the same through a pull request.
Cursor
Section titled “Cursor”Cursor’s parallel agents run the setup commands in .cursor/worktrees.json inside each new worktree. Provision it there:
{ "setup-worktree": ["taxilane provision"]}Add your other setup commands (npm ci, …) after it. Cursor creates and names the worktree itself; Taxilane lists it as created elsewhere. Setup commands don’t leave variables in the agent’s shell, so for the per-worktree environment declare an envFile (provisioning writes it) or start commands with eval "$(taxilane env)" && ….
Codex’s local environments run a setup script when it creates a worktree for a new thread. Use taxilane provision as (or at the start of) that script. Codex’s documentation doesn’t say which directory the script runs in; if it isn’t the new worktree, pass its path: taxilane provision <worktree path>. This recipe hasn’t been verified with Codex yet. As with Cursor, use an envFile or eval "$(taxilane env)" for the per-worktree environment.
Any other agent or tool
Section titled “Any other agent or tool”-
Let Taxilane create the worktree, then start the agent in it:
Terminal window cd "$(taxilane new TASK-123)" && codex -
The tool creates the worktree and can run a command afterwards: run
taxilane provision <worktree path>(or plaintaxilane provisionfrom inside it). -
Per-worktree environment in your own shell: with direnv, commit an
.envrccontainingeval "$(taxilane env)"; every worktree loads its own values when youcdinto it. Without direnv, runeval "$(taxilane env)"yourself. -
Clean up whatever accumulated, from any tool:
taxilane cleanlists merged worktrees and worktrees whose folder is gone;taxilane clean --yesremoves them.