From the free trial in your terminal to your first lane, then every command to continue and find your way back.
This guide describes Treelab 1.17.0, the latest published version.
Text remains selectable. Check paths before pasting a command into your terminal.
Prepare your Mac
You need a Mac running macOS 13 or later and at least one coding agent, Claude Code or Codex, already signed in to your account. Accounts, access and subscriptions for these tools are separate and not included. If missing, Git and jq are installed by the installer through Homebrew, and cmux by lab setup, each time after your consent. gh and its GitHub permissions are only needed to deliver pull requests.
In Terminal, check the macOS version and that your agent is present: each command -v should print a path. If no agent is found, install Claude Code or Codex and sign in before continuing.
sw_vers -productVersion
command -v claude
command -v codex
Try, subscribe, install
Paste the command below into Terminal. The installer follows your Mac’s language, English or French, and asks one question per screen: your agent (only if both Claude Code and Codex are installed), your project (new, existing or an example), then what you want to get first. Your answers stay on this Mac: running the same command again resumes where you left off.
Then comes “How do you want to start?”, with three choices. “Start free trial”, selected by default: give your email address, then “Send the key”. The trial lasts 14 days, with no card, and opens every feature; one trial per email address and per Mac. “Subscribe” opens the subscription page in your browser; after payment, the key arrives by email. “I have a key” waits for a key you already received. In all three cases, the key (it starts with tl_key_) arrives by email and is pasted into Terminal, hidden. Never pay twice.
A consumer who subscribes receives the key immediately only if they request access before the end of the 14-day withdrawal period and acknowledge losing that right; otherwise the key arrives by email when the period ends.
“Install Treelab on this Mac?” recalls the location, the project and the tools; nothing is installed before you agree. The installer then activates the key on this Mac, installs Git and jq if missing, downloads and verifies Treelab, then runs lab setup, which shows the plan (instructions, skills, agents, hooks, commands, shell profile and backups) and offers cmux separately if missing. Type I accept only if you agree to these changes; if you decline, nothing is changed and lab setup --dry-run shows the plan again at any time. Finally, the installer registers your project and opens its first lane in cmux.
When the trial ends, nothing is charged and the installed version keeps working; only new versions need a subscription. lab subscribe opens the subscription page without changing keys: your trial key becomes the paid key of the first seat. Once subscribed, the same command, with the key of the first seat, opens the customer portal to manage or cancel the subscription.
curl -fsS https://treelab.sh/install | /bin/bash
lab setup --dry-run
lab subscribe
Check the installation
Open a new terminal to pick up PATH changes. The installed command is treelab; lab is its short name when that name is free. If lab already belongs to another tool, it is kept and you use treelab for direct calls. Lane tabs start the agent with lab launch: this automatic startup assumes lab resolves to Treelab; otherwise, contact support before continuing.
doctor explains each check with a NOTE: fix each failure, then rerun. Codex asks for a one-time hook approval (/hooks); Claude Code loads them without any action. The regular diagnostic may contain private paths: keep it on your Mac.
treelab --version
treelab doctor
command -v lab
Your first lane
A project is your registered Git repository. A lane (formerly couloir) is an isolated working copy under .worktrees/ for one need. A batch (formerly lot) is a verifiable step with a branch and a document; its Goal states the result that must be proved.
When installation ends, your first lane is already open in cmux, and it is guided: the agent first checks that GitHub is ready, starts from what you want to get, asks five questions at most, then runs one single batch up to a pull request for you to read. Answer in that tab; the agent runs lab next itself to open each step.
For a new need in the same project, lab new creates another lane; --brief gives the agent the text of your need. For another repository, run lab onboard in its folder: it registers it without touching your files and opens an agent in a “welcome” tab, which closes by itself once the lane is open.
lab next demo premier
lab new demo second --brief besoin.md
cd /chemin/vers/autre-depot
lab onboard
From batch to delivery
In the lane tab: clarify → plan → execute → verify → deliver. Checks include tests, the doctor diagnostic, an independent review and actually trying the screens. Each batch is delivered by lab merge after checks pass; its document keeps the evidence and a Handoff readable without the agent’s memory.
next reads the state and selects the next step; it neither merges nor removes anything. After the last batch comes acceptance: you try the exact result, then the agent records your approval with lab acceptance. close then delivers the last batch and removes the lane, after your explicit confirmation; --dry-run first lists anything that would prevent it. A failed check stops delivery until it is fixed.
lab plan demo
lab status demo
lab close demo premier --dry-run
lab close demo premier
Update, rollback and removal
lab next installs the latest minor or patch version by itself, at most once a day; a major version is only announced, and auto_update=no in ~/.lab/config limits everything to the announcement. lab update does the same on demand: it downloads the version with your licence, checks the archive and its fingerprint, then switches. Open agent sessions keep their version.
The previous version is preserved: lab update --rollback returns to it offline. Every failure ends with RESULT=refused or interrupted, the reason and the file concerned, and the installed version is kept; --resume continues an interrupted update.
For removal, inspect uninstall --dry-run, then run uninstall or uninstall --keep-state to keep the active installation manifest marked as removed. The registry is always preserved; without this option, the completed manifest is archived with backups. Backups remain at the printed path; separate dependencies are not removed. Interrupted removal resumes with uninstall --resume. Fix the stated cause first; do not delete the journal.
lab update --catalogue
lab update --rollback
lab uninstall --dry-run
Data and network
Treelab sends no telemetry. Only three moments contact treelab.sh. The installer: the trial sends your email address, a random identifier for this Mac (machine_id), the version of the terms and your language; activation sends your key and that same identifier. lab update and lab next’s automatic update: your licence and that identifier, to read when your update rights end and download the version. lab subscribe: the same, to open your subscription page. Reminders that a trial or subscription is ending read a copy kept on this Mac. Everything else, including your repositories and documents, stays on your Mac and in your own remote repositories.
This site loads no diagnostic service and never asks for your key. The package and its messages are in English; the installer is in English or French, depending on your Mac’s language, and the agent replies in your Mac’s language. This guide and the website exist in English and French.
Command reference
Square brackets mark optional arguments, angle brackets mark values to replace, and | marks a choice. These are reference syntaxes, not lines to paste unchanged. projet is optional when the current folder identifies the registered repository. Names and options remain those of the package, in English.
The installer runs it for you once your key is active; you can run it again at any time. It checks the Mac, summarises what will be installed, then waits for you to type I accept before writing anything. --dry-run shows the plan without installing. --reapply reapplies saved choices. --import takes over an earlier installation: links, hooks, registry, documents and preferences. --dev is for a Treelab development checkout.
Installs instructions, skills, agents, hooks and commands, and offers cmux separately if missing; existing settings are preserved and backed up. Claude then runs lab’s reads (status, plan, usage, now, help, batch current, list, checks and processes) and GitHub reads (gh pr view, checks, list and diff, gh run view and list) without a permission request; never a command that publishes, deletes, opens a session or writes a lane’s state. No agent session should run during the operation. If the plan changes, rerun and reread it. After the installer, your first lane is already open; run on its own, it suggests lab doctor, then lab onboard in a project folder. The treelab and lab commands are a short launcher: if the installed copy goes missing, they print ERROR=CURRENT_BROKEN and, in FIX=, the command that points ~/.lab/current back to a kept version.
doctor · Diagnose
lab doctor [project] [--root <checkout|worktree>] [--project-only] [--report|--freeze] [--only <CHECK>] [--json]
Without a project, checks the Mac’s installation; with a project, its working setup. Each check passes, warns or fails; each failure carries its remedy, FIX= in one line and FIX_KIND=command (a command to type as is) or manual (a change by hand), and nothing is ever repaired for you. --only <CHECK> runs that check alone and exits with its result: after a remedy, it says whether the check passes. --root selects the checkout or worktree; --project-only skips global checks. With Docker, the line <project>.docker warns, never fails, when room is short or leftovers of the project remain, with the figures and lab docker clean <project>. The regular diagnostic may show private paths: keep it on your Mac.
--report produces an anonymised report, with no writes and nothing sent; --json structures the output. Exit 0: no failure; 1: a failed check; 2: invalid options or diagnostic. --freeze resets the project’s measurement baseline, only for an intended change recorded in the log, never to hide a failure: a rise accepted this way fails again 90 days later, until a new freeze. LAB_DOCTOR_SKILLS_WARN_LIMIT sets an optional warning threshold.
Downloads the latest version with your licence, checks the archive and its fingerprint, then switches to it. Open agent sessions keep their version; the next one starts from the new one. --catalogue only reads the available version. --rollback returns offline to the preserved previous version; --resume continues an interrupted update. --adopt, run from an extracted release, replaces an earlier installation.
Without typing anything, lab next installs the latest minor or patch version at most once a day; a major version is only announced. To receive the announcement only, write auto_update=no in ~/.lab/config. Every failure ends with RESULT=refused or interrupted, plus REASON= and the file concerned: the installed version is kept.
subscribe · Subscribe without changing keys
lab subscribe
Opens this installation’s subscription page in your browser: your trial key becomes a paid key, with nothing to paste or reinstall. A cancelled or unpaid subscription opens its Stripe page (card, invoices, renewal). With a terminal, lab subscribe waits for the payment, 30 minutes at most, then shows the new date; q then Enter stops waiting without losing anything.
The link comes from the activated installation and only works for one hour; it is shown only when no browser opens. Without a terminal (an agent), the page opens and control returns at once. A key without an end date has nothing to do; another seat of a team subscription is managed by its purchaser. Output: SUBSCRIBE=checkout, portal, owner, renew, legacy or none, then RESULT=.
Outside live sessions, inspect --dry-run first. Actual removal requires terminal consent. --keep-state preserves the active installation manifest marked as removed; --resume continues interrupted removal after its cause is fixed.
Removes only manifest-owned elements, restores backed-up settings and preserves unrelated changes. Keeps backups at the printed path and separately installed dependencies. The registry is always preserved. Without --keep-state, only the completed manifest is archived with backups. Ginkgo too, listed before consent: the app stopped, its microphone permission forgotten, its OpenAI key and its folder removed (kept with --keep-state). If the journal or an expected fingerprint no longer matches, preserve files and restore their integrity before resuming.
onboard · Guided tour
lab onboard [--agent claude|codex]
Run it in your Git repository folder. Three screens introduce the vocabulary, the cycle and the safeguards. The repository is then registered as a project, without touching your files, the project’s tower opens in its “tower” tab, pinned first, and an agent opens in a “welcome” tab: it asks about your need, opens your first lane, then that tab closes by itself.
Running it again creates no duplicates. --agent selects Claude Code or Codex. Without cmux, it prints the command to run yourself (NEXT_COMMAND).
lab onboard does this for you the first time. From an existing Git repository, name names the project and --root selects its root. --docs repo puts future documents in worktrees; local keeps them outside Git. --owner shared|other describes ownership without authorising writes to the main checkout. --agent sets the default agent.
Writes the local registry, detects the base, remote and project commands; attempts a fetch. Leaves the main checkout unchanged. PROJECT and ROOT identify the registered repository. If the repository cannot be found, set --root to its Git root.
From the registered repository, choose a short lane name. --brief stores the text of your need with the lane documents: the agent starts from it. --batch names the first batch, --kind selects the branch type, --base its base, --title its title and --agent its agent. --no-open skips the tab; --no-install skips project dependency installation; --permanent creates the lane already permanent. --guided makes it a short, guided first lane: GitHub ready first, five questions at most, one single batch up to its pull request; lab onboard and the installer use it.
Creates .worktrees/<lane>, its branch, metadata and the first batch document; normally installs dependencies, then opens the cmux tab with the agent, which starts with a few scoping questions. WORKTREE, BRANCH and LOT identify the result. The main repository must have no pending changes. If the lane already exists, use open.
guide · See where the lane stands
lab guide [project] <lane>
Shows the lane’s step in plain words: 1 questions about your need, 2 the plan, 3 the work checked by tests, 4 your review of the pull request. Then says whether GitHub is ready and, if not, what to do: install gh, sign in, or create a private repository, only with your agreement.
Read only: nothing is written and a slow network never blocks it (GITHUB=unknown after the delay). GUIDE_STEP= and GITHUB= (ready, gh-missing, gh-logged-out, no-remote, other-host) give the same information to an agent; GITHUB_FIX= names the remedy.
Reads where the lane stands and starts what is needed: run or resume the batch, open the next batch after delivery, or prepare your final trial. --goal adds criteria; --agent selects the agent. Run from the lane session, it replaces that session with a fresh one in the same tab; --auto is still accepted as a synonym. A Claude batch session whose context goes above context_max (250,000 tokens by default, set in ~/.lab/config, 0 turns it off) is reminded after each action, in the session language, to update its log and Handoff, then run lab next. With --answer <file>, the last message it wrote to you is shown first by the fresh session. The tower starts fresh by itself too, never in a turn that answers you: it answers your message, finishes the gesture in progress, and hands over at the next return of its background wait; its fresh session shows that answer first, then runs its check and starts its wait again; nothing is asked of you. The batch stays on the Mac by default: only a batch file whose Execution line says cloud runs, with cmux and Cloud set to yes, on a Cloud machine (CLOUD_RUN=) and comes back to the Mac to close; lab deploy or lab lock in its steps keep it on the Mac. The choice is announced in one line (EXECUTION=) and --local always keeps the Mac.
The second form forces the next batch, for example a fix after your trial (--kind fix). A red last nightly run of the main branch is announced (NIGHT=) with a suggested fix lane (NIGHT_FIX=), without blocking anything. next neither merges nor removes anything. Another live session or a missing delivery requires finishing the reported step before retrying.
permanent · Keep a lane open for good
lab permanent [project] <lane> [on|off]
Without a value, or with on, the lane becomes permanent: it chains its batches, each one delivered by its own pull request. off makes it ordinary again. lab new … --permanent creates it already permanent.
A permanent lane is never offered for a trial (acceptance), removal or closing: lab close and lab close --abandon refuse it and name the remedy. When no batch is left, lab next opens a free session that waits for your request. PERMANENT=yes or no gives the result; lab status, lab list, lab plan and lab sweep show PERMANENT=yes.
Every project has a tower: lab onboard creates it for a new project. The first call creates the tower: the permanent lane tower, started under Claude in bypassPermissions mode (the first start may ask you once to confirm that mode). Its tab is the only one lab pins, in first position. Its session applies the tower skill: it checks every lane, relaunches a stopped one, delivers what is ready and lists what waits for you, then waits in the background until something changes in the project. It never answers in your place. A tower under Codex is refused.
Next calls print TOWER=present, then one block per lane: LANE=, WAITS_FOR= (you, merge, acceptance, close, date, ci or nothing), WHY=, SESSION= and CONTEXT= (the tokens the live session’s last call sent to the model). ABOVE_CONTEXT_MAX= names the lanes whose session is above context_max, and their WHY says so: the tower reports them and never acts in their place, a Claude session is told to start fresh by itself, a Codex session gets no reminder. Above context_max, the tower itself starts fresh, asking you nothing and never in a turn that answers you: it carries out and answers your message, finishes the gesture in progress (a closing and its publication included), and at the next return of its wait lab next replaces its session in the same tab with a fresh one that shows its last answer first, then runs the check and starts its wait again. In every project, with or without a tower, a question, a permission request, an acceptance ready or a refused lab next sends a cmux alert to the tab of its lane. --all offers a tower to each registered project without one: one [y/N] question per project in a terminal, nothing created without a terminal (CONFIRM=needed); --no-install skips installing dependencies. --wait is the tower session’s own wait, started by it as a background command (refused to a lane’s agent and to a terminal, nothing written): it returns on a line of lab’s events file from another lane of the project — a question, a permission, an acceptance ready, a blocked lane, a finished watcher, a red CI, a queued merge or go-live, acceptance words, an agreement — (WAKE=events, EVENTS=, then EVENT=<lane> <kind>, ten at most; lines a minute apart count as one), or after 6 hours without one (WAKE=heartbeat): a quiet project gets four checks a day at most; half an hour after a go-live was left for a later round, its CI still running or its target busy (WAKE=queue). A gesture of the tower itself never wakes it. A newer wait makes the previous one return (WAKE=replaced), the end of the tower’s session too (WAKE=orphan), without losing a line; the tower starts the wait again only after WAKE=events, WAKE=heartbeat or WAKE=queue; meanwhile the production health is read every half hour without waking the tower. lab wake restarts a tower without a session within the hour, and lab doctor shows each project’s tower, as information. In a project with a tower, only the tower merges, deploys and closes: the merge asked by a lane’s agent waits for it (merge) and the closing happens on your yes, in its tab. If the shared .claude/settings.json forbids agents to push or merge, the tower offers once to lift those rules (PROPOSE=lift-deny): --lift-deny lists them, --yes removes them, lab’s guard replacing them, --no keeps them. A project opened by an older lab may keep a main tab: it hands over to the tower then closes, by itself, with nothing ever typed in it and nothing asked to you. Each check run by the tower acts (MAIN_TAB_ACTION=): an idle terminal closes (never the last tab, never the one you are looking at); another program or a doubtful reading leaves it, and the tower tells you (MAIN_TAB=busy or unreadable). A Claude session at rest is never disturbed: a copy of its conversation, without a screen and never saved, writes its handover under three headings (10 minutes and 2 dollars at most; otherwise lab keeps your last 10 messages and says why), stored outside the repository, then the tab closes and the tower is told. A Codex session gets one invitation by a cmux message; without its handover 24 h later, lab writes it from your last messages. --main-tab does the same at once; --no keeps the tab for good. --handover is run by that session, or by the same conversation resumed elsewhere, text on standard input. HANDOVER= points to a handover to read: the tower sums it up in three lines, asks you which needs open a lane, then --handover-done. A tower opened before its skill was updated is told once to read it again (TOWER_SKILL=told). --all --main-tab, under the order main_tab=handover only, creates the tower of each project that has a main tab and no tower. Production health: health.<target>=, written by hand in the project configuration, is a read-only command that lab tower runs at most every 10 minutes; a red one (name=integer numbers, or two unreadable reads in a row) waits for you with its numbers (HEALTH_RED=) and sends one cmux alert to the tower’s tab, blocking nothing.
Ginkgo is a small macOS app in the menu bar. lab ginkgo opens it, with or without a project: speak freely, without a key to hold; Ginkgo answers out loud, in your language, what the towers see and what waits for you, passes a message on to a lane, reads the exact question of a waiting lane and answers it for you, one question at a time, and has the tower carry out your orders. Say goodbye, or use its icon, and the microphone closes: your voice only goes to OpenAI during an open conversation. Say stop and Ginkgo goes quiet: the conversation stays open.
The voice engine is only ears and mouth: the work stays with the tower and the lanes. Ginkgo stands above every conversation: it reads the towers of all your projects and acts on the one you name; a project, given or the current folder’s, is only where it starts (outside any project, it starts from the whole computer); then it follows the project you talk about. state --all reads what waits for you in each project, creating nothing. state reads without ever creating a tower (TOWER=absent without one); tell delivers the text to the agent of the lane’s tab through cmux, from Ginkgo, and refuses an unknown lane, a lane of another project, the tower or a lane without a tab. Your own OpenAI API key is used: key openai asks for it once, hidden, and stores it in the macOS keychain; status says whether it is there (KEY=present), never the key. Ginkgo comes with treelab, built and signed: nothing to install, on an Apple Silicon Mac with macOS 14 or later (elsewhere, lab ginkgo refuses and the rest of treelab works). At the first launch in a terminal, a missing key is asked for, then macOS asks once for the microphone (again after each update); lab doctor says whether the shipped app is in place. question reads the whole choice box, or the end of the last message; answer types the answer in the lane’s tab and refuses a question changed since it was read or an unknown choice; order types the order in the tower’s tab; closing a lane is never a free order: close reads it back out loud and sends the close only after your yes, within 120 seconds. A box whose every question ends with “(default in 30 min)” and marks a “(Recommended)” choice shows its deadline, DEFAULT_AT=, 30 minutes after the question: with no answer by then, lab ginkgo default, started by the hook as a watcher, types the recommended choice of each question with a note asking the session to write it as a decision, each question read again on screen before its keys; a box whose choices would accept or close a lane never gets one. A box without that mark blocks its lane: with no answer 30 minutes after the question and the tab of its session off screen, lab ginkgo park, started by the hook as a watcher, types a parking note in each question (PARK=parked): the session writes its Handoff with the question open, commits and ends its turn; once idle, its tab is closed and the box stays the lane’s question, in Waits, To validate and on the iPhone. The answer given there relaunches the lane with it, read first by its new session; answer refuses a parked lane. Never on a permanent lane; if lab cannot close the session (an uncommitted file, a command in the background), the question stays in Waits with the reason (PARK=stuck). Ginkgo also speaks first when a lane starts waiting for you (a question, a permission, a blocked lane, an acceptance ready, a close to confirm; merges, CI and dates stay silent): news, read every 30 seconds, says it out loud with the conversation open, otherwise in a notification with a sound whose click opens the conversation, which starts with that news. ginkgo_speak=always|conversation|notify|never (notify: a notification only, once the conversation is closed) and the quiet hours ginkgo_quiet=21:00-08:00 (off for none) are set in ~/.lab/config: during them, nothing while the conversation is closed, then one notification sums up what still waits. news --all does the same for all your projects, each news naming its project: while the Treelab app runs, it reads the feed the app keeps up to date (SOURCE=feed, under a second); without it, it computes everything, every 2 minutes (SOURCE=computed); when Ginkgo quits, it reads again only the lanes of the news it could not say (--only-forgotten). Tell it also what you want to hear: “ignore demo”, “only the questions of treelab”, “even at night for this lane”, for a project, a lane and/or a kind of wait, until you say otherwise or for the time you give; it stores it at once through precision set and says it back in one sentence, lists, changes or removes it by voice. lab keeps them in one place and applies them to the news (what is set aside is neither said nor held, then announced once the precision is lifted; even at night goes through the quiet hours) and to its answers (lanes set aside are left out, only counted, until you name them); an agent can neither store nor remove one. Three ways to start, ginkgo_listen=command|key|name in ~/.lab/config, or the menu of its icon, which changes it at once and writes it there (listen <mode> does the same; without a mode, it says LISTEN=): command, the default, opens the conversation and you speak freely; key: hold ⌥ Space while you speak, release it for the answer — between two presses the microphone is off and nothing is sent; a press while Ginkgo speaks cuts it; ginkgo_hotkey= picks another combination; name: say “Ginkgo, what waits for me?” in one breath — the name is recognized on this Mac only by Apple’s speech recognition, nothing leaves it before the name and the sound sent starts at the name; a short sound confirms; nothing said within 8 seconds, Ginkgo closes and listens for its name again; a locked or sleeping Mac closes the microphone until it is unlocked. The name needs macOS Dictation turned on (System Settings, Keyboard, Dictation); otherwise Ginkgo closes the microphone and its menu says so. macOS asks once for speech recognition (again after each update); lab uninstall forgets it with the microphone. For the Treelab app: lab ginkgo <project> --background starts Ginkgo with no conversation and no microphone (in name mode, it listens for its name). The app then drives it through a local socket, yours alone (SOCKET=, in the lab state): it opens and closes it, cuts its microphone, cancels a close waiting for your yes, changes the project without closing the conversation, and receives live its state, the project and lane it talks about, its lines, what it did and the voice levels. Nothing there confirms a close, answers a lane or gives the tower an order, except what you write to it in the Treelab app, which counts as your voice: Ginkgo asks lab who wrote it (ginkgo caller, ROLE=human|agent|other|gone): only the Treelab app itself is heard, its program read from the system in a dev.treelab.app bundle; the text of a program launched or detached by an agent, or of any other program, is refused, nothing sent; it then answers in writing, without sound. Launched by the app (--no-icon), Ginkgo has no menu bar icon while the app is there: its window is Ginkgo’s face. status says PROTOCOL=1 when the shipped app speaks this channel; before that, the Treelab app asks for a Ginkgo update.
plan · See progress
lab plan [project] [--json]
Recomputed at each display from the batch documents: each lane’s current batch, completed batches out of the total, and its phase.
Read-only. Readable table on stderr, fields or JSON on stdout. If empty, create a first lane with new.
status · Read detailed state
lab status [project] [lane]
The project (folder, branch, merge target, default agent), then each lane as in list, pending deliveries, what is online and files touched by two lanes at once. With a lane: the project, that lane alone and the files it shares with another one.
Read-only; a lock whose process has exited may be removed while reading. GitHub is asked once for the whole project: without an answer after 20 seconds, PR= stays empty and one line says so. An unknown lane is refused with the names of the open lanes. If the project is unclear, supply its registered name.
directory · Who is where: projects, tower, lanes and their sessions
lab directory [project]
Reads the files of lab and git alone, without any git command nor network. Without a project, every registered one. One block per project (root, main checkout readable or not, session of the main checkout, tower), then one block per lane, the tower first: role, branch, agent, session name, alive or not (pid and start time), tab. --json gives one object per block. What each lane waits for stays in lab tower.
EVENTS= names the events file, one for every project: lab appends one line per real change — a question, a permission, an acceptance ready, a blocked lane, the end of a watcher, a red CI — never for a session at rest nor for a wait written again unchanged. A line: key=value fields separated by a tab, v=1 first, why= last on 200 bytes at most. Never rewritten; at 1 MiB, the file becomes events.1.
recall · Find where something was decided, without rereading the folders
Searches the .md files of docs/lots — batch files with their Handoff, evidence reports, changelogs, briefs — for words typed without accents: “decision ecran” finds “Décision prise à l’écran”. No AI, no network: a full-text index (FTS5) built by the system’s sqlite3, kept in lab’s state, never in the repository nor the source of truth; erased, it is rebuilt, and a file changed, added or removed is seen at the next search. One block per file, best first, with its best section and a snippet of 300 characters at most; 25 results and 32 KiB at most. At equal text, a tower’s note comes after a lane’s batch file.
--causes groups the Cause lines of the batch files by the code element they name between backticks: one group per element named by at least two batch files, empty templates left out. --forget adds a path or a pattern to the project’s exclusion list, readable and editable by hand: never indexed nor shown again; --excluded lists it. Without sqlite3 with FTS5: RECALL=unavailable, rc 1.
security · The security state of this Mac, in twelve fixed checks
FileVault, firewall, Gatekeeper, System Integrity Protection, macOS and Homebrew updates, programs listening to the network, startup items and their signature, password when the screen locks, open sharing, last Time Machine backup, Find My Mac. Each check is ok, info, watch, red or unknown with its reason and, when not ok, gives a fix in one sentence: red first.
lab security reads without changing anything, no network, no macOS prompt: a read that macOS refuses without a password gives unknown; same state, same report. Under each fix set in System Settings, “Open: lab security open <check>” opens the page of the cause (FileVault, firewall, updates, startup, screen lock, sharing, AirDrop, Time Machine, Apple Account), never another address; what is set elsewhere (SIP in Recovery, Homebrew in Terminal, a port in its program, a startup leftover in its folder) says where. Treelab Core fixes by itself, once, what is fixed without an admin password — today AirDrop open to everyone, set back to contacts — after the guard agrees, and says so; reopened by you, it is left alone. --kv gives the report to programs, Treelab Core and the app: CHECK_, DETAIL_, REMEDY_, FIX_ and SETTINGS_ for each check, then the counts and SECURITY=ok, warn, red or unknown (a check not read is never called safe); without the security module of Treelab Core, one sentence (SECURITY=unavailable under --kv). Every answer that is not a report — a page opened, a gesture done or refused, no module, nothing kept yet, a file that cannot be read — is one sentence; --kv gives its keys (OPENED=, RELAUNCHED=, REMOVED=, INSPECTED=, ITEM=, WHY=, TEXT=). lab security inventory shows the inventory of this Mac that Treelab Core takes every 5 minutes: startup items, extensions, programs listening to the network and running programs, by the real path read from the kernel (never the name a program gives itself); what is new in the last 24 hours with when it was first seen, then each item. A startup item, extension or listening program never seen on this Mac makes a notification, one per pass at most; the first pass is the reference, without notification. The processor time of each pass is measured and judged against a frozen ceiling that lab doctor reads (global.security.inventory): red above it. Nothing more is read: the command shows the last pass kept; --kv gives it as is; without the module or before the first pass, one sentence (INVENTORY=unavailable or none under --kv). Treelab Core stops by itself a startup item added after its first pass whose program is unsigned, or signed ad hoc (on this Mac, without a developer identity): it disables it, stops it and its process, writes it in its journal and says so in a notification. Never a program of Apple or of Homebrew, a script, a daemon (it would need an administrator password), nor an item you relaunched. lab security stops reads that journal: each item, its state and its program, and under a stopped item its two gestures; an item whose startup file was removed outside Treelab is no longer offered, a last line counts them; back in its folder, it is offered again. --kv gives STOPS= (items still on this Mac), STOPPED=, GONE= (items that left it), then ITEM_n=, STATE_n=, AT_n=, RULE_n=, PROGRAM_n=, REASON_n=, RELAUNCH_n= and REMOVE_n=, the items that left last, STATE_n=gone, without gesture. lab security relaunch <item> enables it again, and Treelab leaves it while its program stays the same; lab security remove <item> puts its startup file in the Trash and names its program; put back from the Trash, the item starts again with lab security relaunch <item>. Both gestures are yours: typed in a terminal of your own, they are refused to an agent. Once a week, Claude inspects the inventory of this Mac and gives a report apart. What leaves is anonymized: your name, account, home folder, computer and host names, serial number, hardware identifiers, e-mail and network addresses, and private folders, files and labels become tokens; a text where any of them is left is never sent. Claude runs without any tool, setting, MCP server nor session kept, with a fixed instruction and a budget of 1 USD, only once its program is found at a fixed path and signed by Anthropic, and once the guard has judged the whole command. lab security inspection shows the last report: each finding, high, medium or low, with its items by their real names on this Mac, why, what to do and, when a System Settings page helps, lab security open <check>. Advice only: Treelab changes nothing on this Mac and never runs Claude’s advice; a web address or a command in it is hidden. A missed try is said at the top and tried again a day later; a notification only when the high and medium findings change. --sent shows the exact text that left for Claude; --kv gives the report as kept; --now asks for one now, at most once an hour, without a yes once you approved the family securite in Treelab Core, a gesture never an agent’s (otherwise one sentence and the order is cancelled, WHY=needs_yes under --kv).
list · List lanes
lab list [project]
One block per lane: folder, branch, batch and state, agent, pull request, current session. Without a project: every registered project.
Read-only. If a project is missing, check init from its root without recreating work files.
top · See who uses this Mac and cut with one click
lab top [--fast]
lab top --cut <pid|family|idle|lane-done>
lab top --wake <tab>
lab top --explain <pid|family>
Without an option, a snapshot that changes nothing on the machine: memory pressure, compressed memory, swap, load and thermal state; each claude or codex session tied to its project, lane and cmux tab, with its context (the tokens its last call sent to the model, marked ! above context_max); the families outside Treelab (Chrome, test browsers, virtual machines, node, cmux); finally what could be cut, each with its reason, what the cut implies and the command of its click. Sessions put to sleep by lab are listed with their wake command. Each pass also keeps each lane’s load in lab’s state, on the Mac, never sent: lab usage <project> --load reads it back.
One gesture at a time, without confirmation: lab checks the reason again when acting and refuses otherwise, naming the refusal. --cut puts an idle session to sleep in its tab (woken in place by --wake), closes the tab of a finished lane after checking its Handoff, uncommitted files and idleness, stops a process outside agents (stop signal, 10 seconds, then forced stop; a family by its root, a Lima VM by limactl stop); --cut idle and --cut lane-done handle a whole reason. An agent is never killed, nor a session on screen or running a background command; cmux, the calling session, the parents of sessions, root processes and top_keep= names are never proposed. --explain opens a tab where Claude explains; it cuts only once you agree.
usage · Measure the share of tokens sent above context_max
Each action sends the whole conversation back to the model: the longer a session, the more each of its actions costs, and above context_max (250,000 tokens by default) a batch session is told to start fresh from its Handoff. lab usage measures how much of what a project’s sessions sent to the model went to calls above that threshold, from the token counters of this Mac’s Claude journals only, never their text.
Over the last 7 days by default, over N days with --days, or from --from to --to (a date at midnight UTC or a UTC instant). SHARE_ABOVE gives the share in percent, TOKENS and TOKENS_ABOVE the tokens, CALLS the model calls, each counted once; subagents are counted apart (SUBAGENT_*). The project’s root and its lanes are read; Codex and the sessions run on a Cloud machine are not. Read-only. With --load, each lane’s load (CPU and memory of its sessions and their children, average and peak), kept per hour at each lab top and menu-bar dot pass; with --time, the active time of the project and of each lane per UTC day (a pause over 15 minutes does not count, parallel sessions count once), kept day by day to outlive the erased journals. Everything stays on the Mac, in lab’s state, never sent; lab usage --keep, run by itself when the day changes, keeps the closed days. With --waits, where the agents’ time went: a question waiting for your answer, framing (after grill-me, batch-plan, acceptance or first-lane, before batch-run) or not, tests run on this Mac, waiting for CI or a remote machine, builds, waiting for a background task, screens, subagents, the agent’s own thinking (a pause over 15 minutes does not count) and other tools, in seconds and as a share of the total, with the week’s CI cost kept by lab next and lab close. Parallel sessions and parallel calls add up. Read-only: nothing is kept or sent, no journal text is shown, only tool names and durations. With --lead, the time from a batch’s start (the first journal line on its pull request’s branch, after that branch’s previous merge) to its merge, as a median and a 90th percentile, from the list of merged pull requests that lab next and lab close keep on the Mac, at most once a day: lab usage never reads GitHub. With --summary, the last closed week, Monday to Monday UTC: that lead time and the week before’s, the week’s CI cost, the agents’ time and its top three uses, then the settings lab made that week (Treelab installed, updated, rolled back or reapplied, a CI workflow template committed in the project), kept on the Mac, never sent; with --due, only once a week (SUMMARY=shown after), once the list of pull requests is fetched after the week’s end (SUMMARY=waiting before): it is the summary the tower gives you each Monday.
lanes reads every registered project, one project or some of its lanes, as the tower sees them: for each lane outside the tower, what it waits for and why, whether a session runs, its current batch and whether it waits for you; per project, how many lanes wait for you, then the total and lab’s language. focus brings the lane’s cmux tab to the front, otherwise its project’s workspace.
Each block also names the exact files and folders whose change can change its answer. snapshot keeps these blocks for the Treelab app, one file per lane and per project under ~/.lab/state/app-snapshot, rewritten only when it changes: each lab write (wait, session, merge queue, agreement, watcher) redoes its lane’s file in the background, and only while the app lives (its mark, set by --reader and checked by its pid). The app reads these files without running lab; it runs lab again only for a changed document, the end of a session or a watcher, or a date reached, limited to the lane or project touched, never on a timer. lanes is read only: no network, no tower created, nothing written. focus never starts an agent, a session or a tab; an unknown project or lane, or cmux out of reach, is refused by name. ask and answer serve the To validate screen: ask reads what a lane asks, as data to show — its whole question box, a permission read on the screen of its tab with the tool, its input and Claude’s three choices (once, always, refuse), otherwise its wait and the last message of its session, and whether a session runs in the lane. answer is a click of the person in the window, refused to an agent and to the tower: the answer goes to the lane’s tab as a click, an agreement included, which the hook of lab keeps; a box changed since it was read, or other on the screen of the tab, sends nothing, and a lane without a session receives nothing (its tab is a shell), except a box lab parked after 30 minutes without an answer: the answer is taken once, kept in a file, and lab next relaunches the lane with it, read first by its new session. thread reads a lane’s conversation for the Conversation screen of the iPhone and the window of the Treelab app, from the transcript of its session (Claude or Codex), bounded, writing nothing but its cache under the lane’s .lab: what the person typed, with the kind and size of each attached file (never the file), and, for each turn, the agent’s last written answer; for the last turn, the steps of the agent’s plan and its actions (the description of a command or the name of a file, never the command); never a hook, a reminder, a tool result nor a command; the last 40 messages, with the model and the memory of the conversation (its tokens and the threshold where Treelab hands over to a new session), and, for a Claude session lab launched, its account, that account’s plan and its 7-day limit with its reset, as lab account reads them; a missing or unreadable transcript is said so, never a wrong thread nor a guessed account. A /goal of Claude Code (how lab next starts a batch) opens a turn without a message, so the steps and actions of a lane lab launched show; --watch, for the window of the app on this Mac only (never through the door of the iPhone), names the transcript it watches, and with the last turn TURN_AFTER=<n>, the served messages before it (a /goal after a reply opens a turn that has none of its own yet). switch serves the Change buttons of the conversation state on the iPhone, a gesture of the person: the same conversation resumes in the lane’s tab, on the chosen model (fable, opus, sonnet or haiku, kept for this conversation unless that model hits its limit) or on the next free account; each refusal is named, nothing changes. voice serves Voice on the iPhone, a gesture of the person: the OpenAI key of this Mac never leaves it; lab reads it in the keychain, passes it on standard input, never as an argument, and gets from OpenAI a secret valid 60 seconds that fixes the model, the voice, the audio and the speech detection; only that secret leaves, sealed by the gate for the iPhone’s session; each refusal is named, no secret is made. attach serves the paperclip of the Conversation on the iPhone, a gesture of the person: the attached file, which the phone gate received encrypted and checked (size, fingerprint), is kept in the lane only, under a name made by lab in its .lab/attachments folder readable by you only, then a message cites it once to the session, with your text, by the same path as answer; its kind is read in its content, never in its name: PNG, JPEG, GIF or WebP image, PDF or text, 5 MiB at most; a refusal keeps nothing, a message that does not go erases the kept file; the last 20 files and 50 MiB stay per lane, everything leaves with the lane; the thread shows it as an attached file, its kind and size, never its path. The terminal app: lab drives cmux, or an app that keeps its command, socket and AppleScript, such as the Treelab app built from cmux. A terminal_app= line followed by the path of the app, in a project’s config then in ~/.lab/config, picks it; without the line, cmux itself, otherwise a Treelab.app installed with its command; its command and socket are set in the same file. Tabs, focus and notifications of that project then go through it, other projects stay on cmux; lanes says for each project the app that opens its lanes and where that choice comes from. A missing app is reported with its file, nothing opens elsewhere; removing the line brings cmux back. The settings of the Treelab app: account reads the account of this Mac, without network and without writing anything. Signed in, it answers from the account as lab last read it: the address, the role, the rights (trial and days left, monthly or yearly subscription with its renewal or end date, rights without an end), the seats taken out of the total, this Mac and its seat, how many Macs the account holds, and its team in short (the buyer for a member, how many addresses the buyer can invite, how many are invited or members). Signed out, it answers from the license that activates this Mac (never read: it holds a secret) and the rights that lab update and lab subscribe keep in cache, and shows a sign-in request still waiting with its code. It always names the file to watch, then the offer (trial, monthly and yearly price, team discount) from the offer file of the server shipped with lab. account --refresh reads the account again from the Treelab service first, only when this Mac is signed in; a session closed from another Mac signs this one out. ginkgo reads and writes the listen mode, speech and quiet hours of Ginkgo: speech and quiet hours apply at once, a new listen mode when Ginkgo opens again; the notify speech is a notification of this Mac, never the voice. notify serves the Notifications page: what lets you know (a conversation waits for you, an important gesture asks for your approval, a problem stops the work, a job is done), the quiet hours, this Mac and the voice of Ginkgo (the same setting as ginkgo), the iPhone; everything lets you know without a setting. On the iPhone, the phone gate seals each new wait for the paired iPhones, which alone open it: Apple and the relay only see a generic text; notify --route, allowed to all, says what it does with it — sent, held during the quiet hours then summed up at their end, or nothing when the iPhone or the event is off. The announcements of Ginkgo follow them: an event turned off is neither said nor notified, and comes back if it still waits once turned on again; what you marked “even at night” always goes through the quiet hours. Setting, here as with ginkgo, is a gesture of the person, refused to an agent: an agent never silences what waits for you. notify --try, allowed to all since it sets nothing, has Ginkgo send a test within 2 minutes, out loud when the conversation is open, otherwise on this Mac, quiet hours included; without this Mac or the voice, nothing is sent. usage serves the Usage page, read without network: for each Claude account, in the order of lab account and with its figures, the plan, the share used of the 5 hours and of the 7 days and when they reset (unknown when the reset has passed or was never read), free, full until a time or refused, the current account, and the claude.ai pages the page can open; when no account can work before a given time, that time (the one lab account announces) and the window that resumes then, for the gauge and pause banner of the window. usage --add adds a Claude account without a terminal: the sign-in happens in the browser, in a separate settings folder (the Mac keeps its account and each session its own), then lab opens a terminal of its own for claude setup-token and reads the token there, kept in memory only, never in a file; the token, the badge and the identity are stored in one go, the token checked by a real call, then sent to CodeRouter. usage --reconnect redoes what Claude refuses: a new sign-in for a dead badge, a new token for a refused token. usage --use moves the whole Mac to a free account that has its badge, as lab account use does; --auto off keeps the current account at the limit and waits for its own reset, instead of moving to another account; --warn has Ginkgo say, once per window, that an account reached 90 % of its 5 hours or of its 7 days, through the same channels and with the same quiet hours as its other announcements. These gestures and these three settings are the person’s, refused to an agent; switching by itself and warning are on without a setting. signin --email is a gesture of the person, refused to an agent: lab asks the service to send a sign-in link to that address and returns at once a 4-digit code, which the page of the link shows too with the name of this Mac; lab then waits in the background, until the link ends at most (15 minutes), and keeps the session of this Mac as soon as the link is confirmed in the browser, in a file readable by you only, never shown. signout --everywhere, a gesture of the person too, signs every Mac of the account out, this one included; the license key of a Mac is not touched. team shows the team of the account, read from the account as lab last read it, without network and allowed to an agent (--refresh reads it again first): the role, the buyer, then each invitation or member with its state, its date, its Macs and its seats. The buyer invites at most their seats minus one; a trial or a single seat invites nobody. team --invite and team --remove are gestures of the person, refused to an agent: an invitation sends an email in the language of lab, a removal gives the seat back to the buyer, then lab reads the account again. The invited person joins by signing a Mac in with the invited address, and the page of the link names the team; a Mac already signed in with another address first signs every Mac of its account out, then signs in again with the invited address. data --export copies the data of this Mac, as readable text, into a new folder: the account, the settings, the projects and lanes with their state, the Ginkgo log and news, the recorded agreements and words, and, when Treelab Core is installed, its data opened with its key (its log, the approved families and modules, the memory it learned, its order queue without the dictated text, its safety files, its reports and the data of the modules) in core/; never the license nor a keychain key, and each known shape of a key or a token (sk-, ek_, tl_key_, Bearer, token=, secret=, password=, billing and checkout links) is replaced by [secret removed]. data --erase is a gesture of the person, refused to an agent: a read-back and a token first, nothing erased, then the token given back within two minutes stops Ginkgo and erases its log and news, what lab keeps for the app, the account cache and the OpenAI key, then the log of Treelab Core, its reports, the data of its modules, the memory it learned, its finished orders and its key (a new key next), its numbers never given again; lab, projects, lanes, batch files, agreements, words, the license, the settings and the core’s approvals stay. update serves the Updates page, read without network: the installed version, the ready version (the last catalogue read, newer) and its news read on treelab.sh in lab’s language, the versions before, the version going back would restore (only an older one), install by itself (at the first lab next of the day) and warn me (Ginkgo says once per version that it is ready, held during quiet hours); update --check, allowed to all, reads the catalogue and the news again. update --install installs the published version as lab update does, update --back goes back as lab update --rollback does, update --later hides the card of this version for 24 hours: gestures of the person, refused to an agent, like --auto and --warn. secrets serves the Secrets page: one storage for the secrets of this Mac, the value in the macOS keychain, never in a file, an argument or an output. Reading, allowed to all, writes nothing: the projects of the registry, then each secret whose value is in the keychain, with its service (Stripe, OpenAI or another, named), its project or the whole Mac and when it was stored, never its value. The OpenAI key of the whole Mac is the key of Ginkgo, never stored twice. secrets --add stores a secret read on standard input (hidden in a terminal), --replace replaces it, --remove takes it out of the keychain: gestures of the person, refused to an agent. Every refusal of these commands exits with code 2 and its reason. passwords serves the Passwords page of Settings › Modules, read in Treelab Core through its installed executable: the step of the migration and its numbers, never a password, a site name or a file name. Read without asking (the motsdepasse family approved at the core) reads at each opening; passwords --page gives the page alone, never reading; otherwise passwords --check places the read and waits for your yes. --prepare and --passkeys always wait for your yes: --yes <n> gives it within 120 s, --cancel <n> cancels; the token stays in the state of lab, never shown. Erasing the files is typed in a terminal of your own (CLEAN_COMMAND=). Gestures of the person, refused to an agent. security serves the Security page of Settings › Modules, read in Treelab Core through its installed executable: the state of this Mac its securite module keeps, the overall state in words (red, to watch, all good, not read), the counts, the time of the last pass, the twelve checks with their sentence and remedy as the module writes them, the System Settings page of those that have one, and the inventory (startup items, extensions, listening programs, running programs, new items). What was not read is never said safe. Opening the page reads the last pass kept, never one more; security --page gives the page alone, without an order. Your click is the yes the core asks for: lab places the order and confirms it by its token, never shown. --check runs a pass now (150 s at most), --open <check> opens its System Settings page through the module, --module on|off turns the module on or off. Only the module’s fields pass, its message cut at 4 096 bytes. Gestures of the person, refused to an agent: an agent sees the state of the core and of the module, nothing more. menage serves the Cleanup page of Settings › Modules, read in the menage module of Treelab Core: the total freed, the last pass, the space available and its level, the history of 30 days and the disk view, each field in its shape, never the path of a state file; nothing is read until the menage family is approved at the core (menage --read auto). --clean starts a pass, --auto turns the pass by itself off or on. Removing and uninstalling are pasted in a terminal of your own: --command gives the command, one line, which Treelab Core takes only when you type it. Gestures of the person, refused to an agent; reading is allowed to all. try serves the Try button of the window: the dev server of the lane, which scripts/dev.sh of the template notes through lab served. Read without writing anything, it says whether the page is served at the revision of the lane, at another one, can be started, or there is nothing to try, with its address. try --start runs scripts/dev.sh in a process group of its own and answers once the page is served at the revision of the lane; try --stop stops that group only, and a server lab did not start (by an agent or by hand) is never stopped nor replaced. Closing the panel or quitting the app stops what it started. Gestures of the person, refused to an agent. history serves the History of the window (its icon, the Try panel, Open history in ⌘K): the versions of a project are the commits of its base branch, one per delivery, read without network nor writing, the 20 most recent, each with its date, its title and whether it can be brought back. history --back brings an earlier version back without losing anything: lab reads the base again, refuses if it moved, then writes on top of the current version a new one with the content of the chosen one and pushes it without force; nothing is rewritten, the version replaced stays in the history. Putting it online stays the job of lab deploy. A gesture of the person, refused to an agent. project serves New project of the window: it creates a project from scratch (a new folder in the projects folder, a README, a first commit, no remote), from a folder of the Mac (a git repository registered as it is, nothing written; a plain folder becomes one, its secrets, credentials and dependencies kept out, nothing leaves the Mac) or from a GitHub project (cloned by gh over HTTPS: its sign-in is enough, no SSH key), then registers it as lab init does, under the name typed, shown as its title. With an idea, its first conversation opens, guided, the idea as its brief. conversation serves the + of the window: its first message opens a new lane named after it, the message as its brief, as lab new does. Every refusal leaves nothing behind: a name taken, the home folder, a system folder or one that holds your projects, a folder over 1 GiB, a GitHub project out of reach. Neither is reserved to the person. modules serves the system modules of Treelab.app: processor, memory, disks, network, battery and temperature, which the app measures itself and shows in the menu bar, without SwiftBar, without macmon and without starting a single program. lab keeps the decisions: the active modules, the same list as lab widget modules (all six without a setting), and their SwiftBar plugins. Alone, it reads MODULES= (the active ones, comma-separated), HELD=app (the app shows them), swiftbar (plugins of lab still in the folder of SwiftBar) or none, and PLUGINS= (how many). --takeover notes that the app shows them and removes the six lab-<m> plugins, the lab-sep chevron and the lab-hide spacer from the folder of SwiftBar, after giving the position of each to the item of the app that replaces it (never over a position the person already gave that item), then the lab.60s.sh dot: the plugins that are not lab’s stay, SwiftBar is never opened and the list of modules is kept. When no other plugin is left, SwiftBar is retired (SWIFTBAR=retired): its login item goes if lab had added it (never the person’s), and SwiftBar is quit; a plugin that is not lab’s keeps both (SWIFTBAR=kept). While the app holds the bar, lab widget never puts a plugin back, nor opens SwiftBar. --release puts back the plugins of the active modules, the dot, the chevron and the spacer, as lab writes them, each at the last position of the item of the app that replaced it, gives back the login item and opens SwiftBar again if lab had quit it, and notes that they were given back. --start, which the app runs at each opening, at login too, takes them over as --takeover does, unless --release gave them back: the app never undoes that gesture, and --takeover takes them over again. --on <module> and --off <module> change the list, as lab widget modules on|off does, and the app follows it. --top, when the menu of the processor or of the memory opens, gives the five biggest consumers by processor and by memory (BLOCK=PROC blocks, as lab sysmon), an agent session named with its lane: ps alone is started, nothing is written. Refusals, rc 2, nothing written: usage (an unknown module or option). bar serves the chevron and the spacer of Treelab.app, which tidy the menu bar: collapsed, the spacer pushes off screen what is left of it; “Show for 10 seconds” narrows it, then it collapses by itself. Alone, it says who holds the bar (HELD=), the state of the chevron (SEPARATOR=, LEFT=, OPEN_S=, WIDE=, NARROW=), then the menu of the chevron, the same as SwiftBar’s for the same bar: MARK= and STATUS=, then one ITEM= line per line of the menu. --state says the state alone, without reading the bar. --act <words> does the click of a line of the menu (save or restore the order, tuck an app away, a tidying step, expand or collapse) through lab widget, without a notification, then returns ACT=, RC=, MESSAGE= and the fresh menu; it is a gesture of the person, refused to an agent (REASON=agent), and the order is refused while Bartender, Ice or Hidden Bar runs (REASON=rival). top serves the lab top dot of Treelab.app, “●N ✂M”, tinted by the memory pressure, and its menu of what to cut: the app reads it only at its start, when the menu opens and on events (snapshot changed, followed process ended, memory pressure, NEXT_S, the seconds before the next threshold), at most once a minute, never at rest; its menu is the one of the lab.60s.sh plugin for the same pass, in the language of the Mac, without Open lab top. --act top --cut <id>, top --explain <id> or top --cut idle does the click of a line, the exact words of lab top, through lab widget act: the result is notified and recalled at the top of the menu, then the fresh menu comes back; it is a gesture of the person, refused to an agent (REASON=agent).
trial · The app an agent tries, behind your windows
Every app an agent tries on the Mac goes one way: Terminal.app at a given width, a development copy of cmux, a throwaway Chrome, the app of a project. It opens behind your windows without taking the keyboard; a gesture that only works in front lasts as little as possible, then the front goes back to the app you had. open launches the app under an environment cut down to HOME, USER, LOGNAME, SHELL, TMPDIR and the system PATH (no secrets nor settings of the agent, only the --env named are added) and reads the front app every 100 ms until 3 s after the trial’s window shows (--settle seconds at most): an app that comes to the front by itself is sent back at once; a new copy that quits by itself is said, nothing noted.
terminal opens a new Terminal.app window set to --cols columns before the command, keeps its picture and its whole text, the window first grown to an output taller than it, then stops what runs on its terminal and closes it; your other Terminal windows are never touched. front runs a gesture with the trial in front, then gives the front back even when the gesture fails and keeps watching 2 s more: a trial that comes back to the front by itself is sent back at once; shot captures the window of the trial by its number; stop ends the noted process only, never a process that took its number since. One trial per lane at a time.
sysmon · Measure the Mac for the menu bar modules
lab sysmon
A single collection pass returns six blocks: processor, memory, disks, network, battery and temperatures. macmon (installed by brew) gives performance and efficiency core usage, the GPU, power, temperatures and fans; native tools give memory, disks, network throughput and the battery. Each block carries its figures and, for processor and memory, the five largest consumers tied to their project and lane for agent sessions.
Without macmon, temperatures and power disappear, the other modules stay whole. One collector feeds the six menu-bar modules (lab widget): each plugin only reads its cache, never reruns macmon. KEY=value blocks on stdout, a readable view on stderr. Read-only, nothing is cut.
mcp · See the tool servers
lab mcp
lab mcp --pin|--bump|--undo [--yes]
Lists each tool server (MCP) configured for Claude and Codex, globally and in each registered project: scope, transport, package and whether its version is pinned (@latest or no version: not pinned, each start may fetch a new one). Then the running copies grouped by package: copies, processes and resident memory; agent sessions are never counted.
No secret is ever shown: no environment variables, headers, addresses or arguments other than the package name. lab doctor warns above 1024 MB (mcp_rss_warn_mb= in the lab configuration) or for an unpinned version. KEY=value blocks on stdout, a readable view on stderr. Without an option, read-only. --pin pins each server launched by npx to the version it runs (read from the npx cache, no network); --bump offers the latest version published on npm; each shows the change (package before → after, never a file’s content) and asks for agreement, then saves each file before writing it; --undo restores the last save. A server launched otherwise (uvx, pipx) is named with its reason, never pinned.
install puts in place the lab top dot (every 60 s: colored by memory pressure, agent sessions, proposed cuts; its menu cuts with one click) and six system modules (processor, memory, disks, network, battery, temperatures) refreshed every 30 s, each a bar item with its detailed menu. lab installs macmon through brew for temperatures and power; without it, the native modules stay. modules list shows the active modules, off removes one, on puts it back.
SwiftBar is never installed by lab: without it, install shows brew reinstall --cask swiftbar and stops. The plugins go into the folder SwiftBar already uses, otherwise into a lab folder registered in its preferences; SwiftBar opens at login. One collector feeds the six modules (lab sysmon), as the budget requires. remove takes the dot and the six modules away, and the login item if lab added it; macmon, preferences and other plugins stay. A chevron, left of the dot, tidies the bar: closed, it pushes every icon on its left off the screen; its menu draws a map of the bar, flags a hidden lab icon, a new app or an order that moved, and walks through tidying in four steps. order save keeps the order, order apply puts it back (a running app relaunches only with --relaunch, never cmux, agents nor SwiftBar), and refuses while Bartender, Ice or Hidden Bar runs; tidy tightens the spacing, hides Control Center duplicates and stops iStat Menus, each step announced and undone by remove.
After the last batch, you try the result; the agent records your decision in one command. The tried revision is captured, the “Lane acceptance” section of the last document (“Recette du couloir” in a French one) is written and committed alone. Approval requires at least one --evidence; a refusal may carry your --feedback.
Refused if the lane is not in acceptance or changes are unsaved. ACCEPTANCE=valid or rejected, REVISION= and COMMIT= identify the decision. If the result changes afterwards, acceptance must be repeated before close. The Validated by line says who accepted (user, tower or lane agent) and the typed evidence checked: check: runs the acceptance_check= command of the project config, screens:<batch> checks again the screens filed by lab proof. In a project with a tower, the tower accepts on that evidence, screens shown to you when the interface is touched; a lane’s agent is refused.
close · Deliver, then remove the lane
lab close [project] <lane> [--confirm <lane>] [--retire <sha>…] [--night-red-ok <reason>]
lab close [project] <lane> --abandon [--confirm <lane>]
lab close [project] <lane> --dry-run [--abandon]
Presents what will be delivered and removed, then asks you to retype the lane name; --confirm supplies it after approval already given. It requires your trial and approval, recorded by acceptance. It then merges the last batch and removes the working copy, branches and tab, and the lane’s Docker containers and images, announced before the approval (running ones stopped first); Docker missing, silent or refusing never blocks, lab docker clean removes what stays. --dry-run lists every obstacle at once (OBSTACLE=, then RESULT=ok or blocked) without changing anything.
Just before merging, the main branch is re-read up to date: if the merge would remove lines added by another lane, close refuses and names them; --retire <sha> confirms that removal, then kept for this lane: the next closing, the tower’s included, does not ask for it again. If the last nightly run of the main branch is red, close refuses and suggests a fix lane; --night-red-ok "<reason>" goes ahead by writing a dated agreement in the acceptance section of the document. --abandon removes a lane with nothing to deliver, after the same confirmation. Unsaved files, a live session or stale acceptance block it: confirmation never overrides a failure. In a project with a tower, a lane’s agent is refused; the tower closes alone, without --confirm, when acceptance, the tried revision served and verified and the prod check are green (CLOSED_BY=tower), otherwise it asks you and closes on your yes. Your “yes, close” is given once: it also covers a red night and the commits that follow it (a sync, a fix the CI asks for), as long as the tree is clean and the pull request’s CI is green; close names them (AFTER_AGREEMENT=).
sweep · Inventory pending lanes
lab sweep [project] [--dry-run]
For each lane: its branch, whether it is merged, and what it is waiting for (a trial, a closure, the rest of the batch).
An inventory only: removes nothing and performs no fetch or prune. Only close removes a lane.
open · Find the tab
lab open [project] <lane> [--agent claude|codex] [--prompt <text>|-]
Recovery command: finds the lane tab, or reopens it with its agent, without choosing a new step. --prompt supplies text, while - reads it from standard input.
To move forward, use next. If cmux is unavailable, open the application before retrying. Do not start a second session while the first is working.
You do not type it: new and next write it in the lane tab. It rereads the batch document, rebuilds the agent’s full instruction (the Goal) and hands over to the agent.
A short line goes to the tab and the Goal is rebuilt on arrival, without truncation. Automatic startup calls the short name lab: if another tool owns that name, use treelab for direct calls and contact support. Put a long supplement in the document, not in --goal.
Merges the batch pull request into staging when it exists, otherwise into the main branch, as soon as automated checks pass. If they are still running, a watcher merges after they pass and the command returns (ACTION=armed). --title and --body-file set the request title and body. The agent runs it at the end of each batch.
Before merging, the command and then the watcher repeat a dry run on the fresh base and refuse a merge that would remove lines added by another lane (REGRESSION=): the refusal names file, lines and commit; --retire <sha> allows an intended removal. gh and permissions on the remote repository are required. In a project with a tower, run by a lane’s agent, it queues the merge for the tower (MERGE=queued) and merges nothing; the tower merges it at that same revision.
sync · Bring the base into a lane
lab sync [project] <lane>
Merges changes from the base branch into the lane, without pushing anything. launch does it before each session.
SYNC=up-to-date, merged, conflict or ignored. A conflict is aborted and named (CONFLICT_FILES=): the lane stays intact until it is resolved.
promote · Promote staging to production
lab promote [project] [--confirm <project>]
Without --confirm: presents what would go from staging to the main branch, writing nothing. With --confirm: opens the dated pull request and merges it at the exact revision after checks pass.
Run it yourself; an agent runs it only at your explicit request. PROMOTE=preview, armed, merged or none; PR=, INCLUDED= and INFLIGHT= detail the content.
batch · Read batch documents
lab batch current
lab batch list
lab batch new [--title <text>]
lab batch processes
lab batch forgot
lab batch forgot --fixed <n>|all --why "<cause and fix>"
lab batch checks
lab batch wait <Cn> <YYYY-MM-DD|YYYY-MM-DDTHH:MM:SSZ|+Nd> "<reason>"
lab batch wait --done <Cn>
Run in a lane folder. current gives the current batch document and its state; list gives each document and its state; new creates a batch document, --title sets its title; processes names what still runs in the lane folder, except the calling session: nothing is stopped, the agent stops each one or justifies it in the batch document. forgot lists the safety-net notes: what the lane left running after use, stopped by lab 15 minutes after its last use and handed to the lane by the project’s tower, without you; the lane’s session gets them at its next tool and at its start, fixes the cause with its test (one more batch if the batch is delivered), never starts it again to check, then settles the note with --fixed <n> (or all) and --why, the cause and its fix kept in the lane; lab handoff refuses a closed batch while a note waits. checks names the end-of-batch checks from the files touched: documents alone close without review or screen check, code needs one review, a listed screen or a touched interface folder needs the review then the screens; the doctor turns a closed batch red without their Review and Screens markers written in its log. wait puts a criterion on hold for a dated measure: the document becomes “waiting”, the batch is delivered like any other and the lane goes on.
Agents use it during a batch. new does not replace next for changing branch and session; do not create a competing document to bypass an active batch. At the date, lab next reopens the document for that criterion only, before the next batch; one postponement per criterion; wait --done marks it measured. Acceptance and closing wait until every measure of the lane is done. When the PR of the last batch waits for its acceptance, the due measure of an earlier batch starts from the base and its branch is kept aside (RETURN_TO= in lab next and lab status); after the merge of the measure, lab next goes back to it, merges the base and opens the acceptance. A due measure of the last batch itself reopens on its own branch, its PR untouched and never merged: once measured and pushed, lab next opens the acceptance.
handoff · Check the handoff
lab handoff [project] [lane] [--template]
Checks that the batch document says where the work stands and which batch follows, commits the lane documents, then prints the next command (NEXT_COMMAND). If the Handoff section (Reprise in a French document) is missing, adds its template to the document and asks you to fill it. --template only prints the expected form.
The agent runs it at the end of a batch. It does not deliver the batch and does not verify completeness of evidence: objective, reading order, evidence, remaining work and next batch must still be written.
wake · Reopen waiting batches at their date
lab wake
lab wake --install
lab wake --remove
lab wake --status
lab wake --at <project> <lane>
lab wake --reap [<project> [<lane>]]
Without an option: for each lane of the registered projects whose awaited measure is due and that has no live session, runs lab next, which reopens the document for that criterion; a project’s tower without a live session is restarted the same way. Before that, it closes the session of a lane that only waits for a date (Claude at rest for 30 min, Handoff filled, nothing uncommitted, alone in its cmux tab and off screen), keeping its last exchange for the next one. --install sets the macOS alarm: a launch agent that calls lab wake every hour and at login; lab batch wait sets it too.
Each run is written to wake.log in the state folder, with CMUX=reachable or absent. --status says whether the alarm is loaded, its last run and each wake-up at a date; --remove takes it away. --at <project> <lane> keeps one wake-up per lane with an open date: it sleeps to that date on the wall clock, relaunches the lane, then waits for the next date, never two relaunches. A Mac that is off at the date catches up when it wakes; without the alarm, or when cmux refuses processes it did not start, the next lab next reopens the document (PENDING=). --reap is the safety net: a simulator, container, Compose or Supabase stack, image builder or emulator that a lane session started and that nobody uses any more is stopped 15 minutes after its last use. For Docker, only real use counts, never the session alone: a live launcher, a command that names it, an open connection to a published port. Data is kept: never down, -v nor --no-backup. A colima or Lima machine started by a lane stops in the pass of its last stack, never while a container runs on it, even one started by hand; each stop is an event for the tower (REAPED=) and lab doctor counts them. Each pass over a whole project also writes its UTC day, kept 30 days: passes, longest gap, stops and what was not caught in time — a failed stop, a stop 20 minutes or more after the last use, the net silent over 10 minutes with a start running (time asleep never counts, a restart excuses the silence); lab doctor shows the last 7 days (starts.week). What you start by hand is never touched, nor a name in reap_keep=. --install also sets its alarm, every 2 minutes; each lane session sets it when it is missing, and it removes itself once its lab is gone.
calm · Install an update when things are calm
lab calm
lab calm --wait
Reads, without network and without writing anything, whether an update that restarts the terminal (cmux, Treelab) would cut a turn. CALM=yes and INSTALL=now when no agent works and nobody used the keyboard or the mouse for install_idle seconds (~/.lab/config, 120 by default). Otherwise CALM=no and INSTALL=wait, then INSTALL=night in the night slot (install_night=HH:MM, 03:00 Mac time by default, one hour long): the update installs then even without calm, and the sessions resume by themselves. At work: a Claude session busy or shell, a command running, a lab session at rest whose background command has not ended, a live Codex session of lab; each gets its SESSION=<project> <lane> <state> line, OTHER= counts those outside lab. A pending question counts as calm: it is asked again after the restart. Also WORKING=, CODEX=, IDLE=, PERSON=here|away|unknown, NIGHT= and WHY=. A click on Install never waits.
--wait returns at the first calm (CALM=yes) or at the night slot (INSTALL=night), without polling: the end of a turn (Stop hook) or of a session (SessionEnd) wakes it, then it reads again after 1, 3 and 10 s. After a cut (the terminal restarted, the Mac started), one check, 2 minutes later, names in a macOS notification each lab conversation cut while working or before a question that does not run again (lab next reopens it), one not_resumed event per lane; nothing is shown when everything resumed, nor for a conversation lab closed on purpose. lab calm then gives CUT=, CHECKED= and one NOT_RESUMED=<project> <lane> line per conversation of the last cut.
now · Timestamp
lab now
Prints the current instant in universal time, as AAAA-MM-JJTHH:MM:SSZ. Agents use it to date logs and handoffs.
LAB_NOW sets the value, for tests.
due · Track deadlines
lab due [project]
lab due [project] add <YYYY-MM-DD|YYYY-MM-DDTHH:MM:SSZ> <subject…>
lab due [project] done <id> <sha>
lab due [project] reschedule <id> <due date>
lab due [project] cancel <id> <reason…>
Without an action: the project’s open deadlines, overdue first, then those within 48 hours, then the rest. add records a deadline taken during a batch (follow-up, promised delivery).
fait closes a deadline with the commit that proves it; redater moves it; annuler closes it with a reason. Deadlines live neither in batch documents nor in the handoff.
waits · See everything that waits
lab waits [project]
One registry of the project’s waits and appointments, read from their sources: due dates, criteria parked until a date, what each lane waits from you, CI watchers, the next pass of the tower. Each once, with its date.
Late ones first, in red in a terminal, then those in progress, those waiting, those within 48 hours and the rest. With Treelab.app open, the same registry is kept in its snapshot.
Account 1 is your /login. add guides three steps: your /login becomes the account’s badge, claude setup-token gives the token stored in the macOS keychain (never in a file), then that token joins CodeRouter, the team accounts the Cloud machines use; a failed step keeps the previous ones. coderouter later sends a stored token to CodeRouter; a label already in the team is never replaced. remove removes it; without an action, the list shows which account is available.
When an account reaches its 5-hour or 7-day limit, the same conversation resumes in its tab on the next account; when all are exhausted, the tab waits for the reset time. suivant switches account immediately, from the lane’s Claude session. resume restarts one by one, 25 s apart (LAB_RESUME_GAP), the waiting tabs and the lane sessions stopped by a limit or a 401, after a real call checks each token; add and free do it themselves, --dry-run only shows what would be restarted. badge stores the current /login connection as the badge of the account linked to its e-mail; use, and the rotation at the limit, set that badge for the whole Mac (Chrome extension, pages, dictation without /login), after re-saving the active badge. A /login typed in a session is adopted as its account’s badge. At the limit, the main checkout’s session and a claude typed by hand are resumed in their cmux tab through run, with their options; outside cmux, the next account’s badge is set and the log says what to type. After the terminal restarts, run --restore relaunches in its tab the session that was working or waiting for an answer, with the text of lab, once the old window is gone: same conversation, same model, same account. reserve on marks a last-resort account: taken only when no other account can serve, left at the next launch once another is free; add --last-resort adds one without sending it to CodeRouter.
model · Choose the model of every claude
lab model
lab model default|fable|opus|sonnet|haiku
Without a value, lab model shows the model lab gives every claude it starts or resumes (claude_model= of ~/.lab/config, default when unset: the Anthropic default model), the family of that default, seen in the status line at the first refresh of a claude lab started (a later /model or /clear does not change it), otherwise assumed to be Opus, and the env.ANTHROPIC_MODEL key of the Claude settings with its state: ok, stale, foreign or missing.
With an alias (a typo such as sonet is refused), lab model writes it to ~/.lab/config and sets the key in the Claude settings, other settings kept: a claude typed by hand then starts on that model whatever its last /model, which now only lasts for its own session. lab model default returns to the family of the default. A value set outside Treelab is only replaced by lab model <alias>; treelab setup and treelab update set the key, the doctor checks it. A session already open keeps its model.
Without a value, shows the rule in force and where it comes from: CLOUD= and CLOUD_SOURCE= (lane, project, Mac setting or default). The lane overrides the project, the project overrides cloud= in ~/.lab/config, and the default is yes. no keeps every batch on the Mac, whatever its Execution line; with yes, each batch file chooses, without a question: only a batch whose Execution line says cloud goes to a Cloud machine, a batch without a line stays on the Mac.
yes or no writes the rule for the project, or for the lane when it is named or when the command runs in its folder; reset removes the rule at that level. An unreadable value is refused with the command that fixes it; ~/.lab/config is read, never written. image prepares the project machine once and freezes it. Every Cloud batch gets, with no manual step, a repository deploy key created by gh: the pair is generated on the VM, only the public key goes up, the VM clones and pushes over SSH, and the key is revoked on GitHub at the end, even if the VM is paused. A Cloud session blocked on a need of the Mac (“blocked: need <need>: <detail>”) comes back alone to the Mac and the need is remembered outside the repository: needs lists them, needs reset forgets them; without a value, lab cloud also shows the needs (NEED=) and the 5 last Cloud sessions (SESSION=). suite runs the bats suite of the current commit on a disposable Cloud machine sized from the plan (one bats job per vCPU, stale image rebuilt first), deleted afterwards even on failure: SUITE=green, red or unavailable, exit code 0, 1 or 3, without any token. If the plan is still full after the cleanup, the same suite starts on the Mac at once (RUN=mac), with the alert that a larger plan would keep it on the Cloud, unless the project’s CI runs the whole suite (full-suite label and FULL_CMD set): SUITE=unavailable, never on the Mac. clean frees the plan: project VMs nothing uses any more and snapshots older than the previous one, never the image, an open lane or another project’s machine; --dry-run only names them. The same cleanup runs before each suite and each Cloud batch start.
add copies a batch’s screenshots, outputs and measurements outside the repository, with each file’s SHA-256 fingerprint in a manifest.json; a file already under version control is only referenced. --step files the evidence under a named step.
verify recomputes each fingerprint and reports modified or missing evidence. record films the path the agent replays before an acceptance, the window of the path only, never the whole screen: start takes it by its number (--window) or by the process that shows it (--pid), shot <name> captures it at each step, stop files the video with its fingerprint (PROOF_VIDEO=). A forgotten recording stops by itself after --max seconds (600 by default). macOS only.
An agent signs up, reads the e-mails it receives and pays in a test environment with an identity of the project, never with one of yours. How the project receives its test e-mails is your choice, asked once: plus <mailbox> (sub-addresses of a mailbox of yours), domain <domain> (a catch-all domain of yours) or none (no e-mail to read). Until then lab identity says MAIL=unset and the question to ask, and new refuses; written in the project’s config, it is never asked again. --read names the command that reads, without changing anything, the last test e-mail of an identity.
new makes an identity: its address from your choice and a new password kept in the macOS keychain, never shown; production is refused. secret keeps a test secret of the project in the keychain, such as a provider’s test key: the value comes on standard input, never as an argument; a live key is refused. run hands the identity and the test secrets to the launched program only, through its environment (LAB_TEST_EMAIL, LAB_TEST_PASSWORD…), and returns its exit code; inbox runs your reading command; card gives Stripe’s public test cards. Three environments: locally, everything, test cards included; in preprod, sign-up and sign-in, paying stays your gesture; in production, the agent verifies with the permanent signed-in account and the production check, never a card, a password nor an account it made.
lock · Hold a shared resource
lab lock [project] <resource> [--pid <pid>]
Reserves for the current lane a resource declared in the project configuration (resources=): a simulator, a local database, a port. --pid names the holding process.
If another live lane holds it, the command refuses and names it; a dead holder is replaced. unlock releases it.
unlock · Release a resource
lab unlock [project] <resource>
Releases a resource held by the current lane, or by a session that no longer exists.
A resource held by another live lane stays with it.
served · Record the served build
lab served <port> [--pid <pid>]
Called by the project’s development script: records the lane, its revision, the port and the process serving the application.
At session start, the agent therefore knows which version is running locally.
Runs the project hook, a single executable file committed with the code: scripts/lab-services. lab finds it by its presence alone and calls it with the verb stop, from the lane’s folder — that lane’s Docker stack, database or containers are stopped and removed.
close and close --abandon run it themselves just before removing the folder; this command runs it again afterwards, for example after a first failure. The hook gets LAB_PROJECT, LAB_LANE and LAB_WORKTREE (empty when the folder is already gone: the main checkout’s copy is used instead, and named, since it may be older). It has 120 seconds; beyond that, it and its children are stopped. A failure never blocks a closing: lab names it and removes the lane anyway. With the verb list, the hook names what the lanes still hold, one resource per line: list shows them lane by lane, lab sweep and lab doctor name those of an already closed lane (15 seconds at most, never stopping anything), and stop --orphans stops them all, one lane after the other. A ready-made example for a Compose stack named after the lane: templates/project/lab-services.
docker · See Docker’s free space and remove the project’s leftovers
Without a verb, reads the free space of the Docker machine with one throwaway container (2 seconds at most) and counts the project’s leftovers: stopped containers (created and never started: after one hour) and images older than 7 days that carry the label sh.treelab.project=<project>, everything that carries the label of a closed lane (sh.treelab.lane=<lane> without its folder), and the build cache of its own builder lab-<project>. ROOM=short below 10 GB free or from 85% used. Resources without that label are counted, never touched.
clean removes those leftovers one identifier at a time — a closed lane’s running containers stopped first —, then the build cache older than 7 days of the builder lab-<project> only: a running container of an open lane, another project’s resource and an unlabelled one stay. lab close already removes those of the lane it closes; lab doctor warns about short room and leftovers. LAB_DOCKER_IMAGE_DAYS changes the 7 days. prepare creates that builder once and fetches the small image that reads the free space. Without Docker, or when it does not answer, nothing is removed and the command ends without error.
clean · Mac care, done for you, never breaking anything
Treelab takes care of your Mac without you having to do anything: every day, the useless files, proven so, leave by themselves and you see the gigabytes recovered. Nothing else is ever touched. The cleaning stops nothing: startup items, memory and heavy programs are shown to you, you decide. Removes, from a closed list, what is proven useless: temporary folders of finished agent sessions (session dead in the Claude Code registry, not the last conversation of its folder, nothing written for 6 hours; a running Claude Code keeps every session named on its command line, even when the registry lists it under a later one, and, started without one or with a command line that cannot be read, every folder of its project; project not found or its name not proven: that kind is skipped) and Xcode build data whose project no longer exists; a project on a disconnected disk keeps its own. Then, in every project lab knows, the build data of lanes at rest (node_modules, .build of Swift packages, Xcode data): no session for 7 days, 24 hours when the disk has less than 15% free. A lane keeps everything while it works (live or uncertain session lock, Cloud machine, a program inside, newer activity); a folder leaves only when proven to come back as is (ignored by git, nothing tracked inside, next to its tracked package.json with a lock file or its tracked Package.swift with Package.resolved, nothing written for 6 hours); the main checkout and a worktree that is not a lane are never touched. A folder that a running program holds open (its current folder, a file, an app launched from its build data) or that holds a mounted disk stays, whatever its age, and a removal never crosses into a mounted disk; without a readable list of open files and mounted disks, every kind but Docker is skipped. Then the safe list of this Mac, in the home folder: the caches of npm (with the packages npx keeps), pnpm, Homebrew, pip, bun and Swift packages, old Playwright browsers, simulators out of service and logs older than 30 days. Each one stays, with its reason, while its tool uses it: a program of the tool started less than an hour ago (bun at any age), a program that holds it open or names it on its command line, anything written in the last 24 hours; a pnpm store that projects link into stays; a Playwright browser leaves only when no install names its revision and a newer one of the same browser is there (an install running or unreadable skips that kind); a simulator that simctl says is out of service leaves through simctl delete, only while the Simulator service runs, with a single Xcode and every simulator runtime ready, never started; uv, the global packages of pnpm, its dlx cache and the settings of each tool are never touched. Then the caches of apps closed for 30 days, in ~/Library/Caches: the folder named after an app installed in /Applications or ~/Applications (the identifier in its Info.plist), its ShipIt folder (updates) and the cache folder of Chrome, Brave, Edge or Firefox. An app counts as closed for 30 days only with three proofs together: it is not open (lsappinfo) and no program of its bundle runs, Spotlight knows it and has not seen it opened for 30 days, nothing was written in its cache for 30 days. Apple apps and apps that keep offline files (online drives such as Dropbox, Google Drive or OneDrive; music, video, podcasts and books such as Spotify, Netflix or Kindle) keep their caches, and so does a folder of no installed app; the caches of sandboxed apps are never read (macOS would ask for access to the data of other apps); lsappinfo, Spotlight or plutil unreadable: that kind is skipped. Each folder is checked again just before it is removed; a symbolic link, a folder of another user or of another form is counted, never followed; an unreadable registry skips that kind.
The report gives per kind the number removed, the space freed and what stays with its reason, then FREED_BYTES, DISK_FREE_BEFORE and DISK_FREE_AFTER; when the space does not come back, the local Time Machine snapshots that hold it are counted. Docker, when it answers: one shared read finds the projects with a container, an image or a builder of their own, and each of them goes through lab docker clean as is; a project where a closed lane still runs a container is skipped (stopping it belongs to the after-use cleanup); Docker missing or stopped: skipped, never started (DOCKER=). What it frees lives in Docker’s own disk, outside FREED_BYTES: the free space before and after gives its effect. One line per removal in lab’s log, one run at a time (ACTION=busy). --dry-run shows what would leave without removing anything, --list adds one ITEM= line per folder. The keep list: lab clean keep <path>… adds paths, lab clean keep --remove <path>… takes them out, lab clean keep alone shows them; a folder at, under or above a kept path is never removed, in every kind with paths (counted as listed, its size left out of the total), and the list is read again just before each removal; Docker, with no path, stays outside the list. By itself: the menage module of Treelab Core runs lab clean --auto <daily|disk_low|session_end> every day, when the disk runs under 15% free (one hour apart at least) and 6 hours after a lane session ends. It is a real pass: TRIGGER= says why, one line goes to the clean-auto log of lab’s state folder. lab clean auto off stops it (ACTION=off, nothing read nor touched), lab clean auto on brings it back, lab clean auto alone says the setting, whether the module is installed and the last pass by itself (AUTO=, AUTO_MODULE=, AUTO_LAST=); lab clean by hand always works, and so does lab clean --auto asked, the pass you ask for (the “clean now” button of the app), even when it is off. The running total: every real pass, by hand, asked or by itself, adds what it frees to a total kept in lab’s state folder; a dry run, a pass that is off, postponed or busy adds nothing. lab clean auto says it (TOTAL_FREED_BYTES=, TOTAL_PASSES=, TOTAL_SINCE=, the date of the first pass); a total that cannot be read, or a link in its place, starts again from the next pass, and lab says so. It also says whether the pass by itself fails now (AUTO_FAILING=, with AUTO_FAILING_SINCE= and AUTO_FAILING_WHY=, read in the memory of the menage module) and where the rest is shown: lab top for the memory and the programs that use the most, lab security for the items that start with the Mac. The first failure of the pass by itself wakes the towers of this Mac and one of them shows it, once (CLEAN_FAILED= in lab tower); the failures that follow and a success never do; a pass that succeeds, or off, ends that episode. Never during a Time Machine backup: every real pass, by hand too, reads tmutil status first; a backup running answers ACTION=postponed and removes nothing (the module tries again 15 minutes later), a backup that starts during the pass keeps the kinds left, with the reason (TIME_MACHINE=), a state that cannot be read counts as a backup running; --dry-run is never postponed.
upstream · Watch other projects: one issue per idea worth taking
Reads the stable releases (no draft, no pre-release) of the repositories listed by upstream= in the project config, written by hand: owner/repo, separated by spaces. Only release metadata is read on GitHub; their code is never fetched nor run. Each repository once a day at most, --now reads again; one that cannot be read (READ_FAILED=) is read again at the next run. The first read of a repository is its baseline: nothing new. Then each stable release not seen yet is listed (NEW=<owner/repo>@<tag>) until it is sorted.
--draft writes the issue in its fixed format to a file, never showing the notes: source, why it may be worth taking, the release notes quoted as data in a code block (4000 characters at most), next step. --open opens it in the project repository, never twice; --skip sets the release aside with its reason. --why takes plain words: no @ (a mention would notify someone), no ` ~ < > [ ] # (outside the quoted block they would come alive). The tower runs it once a day and sorts each release; nothing written in the notes is followed.
Deploys a target declared in the project configuration, always from the up-to-date main branch; from a lane, its branch is added, and --with adds others. --dry-run shows the plan and what would be lost (LOST=). --record registers what is live without deploying. --add declares a target from a worker, rsync or cloudrun template; --include names private files copied before each deployment.
A registry records what is served. If the target serves an unmerged lane you do not include, lab refuses and names it: include it with --with, or remove it with --retire. The probe then checks the served revision. In a project that declares a target, a direct deployment is refused: use lab deploy. One go-live per target at a time: in a project with a tower, a lane’s request is queued (DEPLOY=queued) and the tower deploys it in turn with --queue; without a tower, a busy target is waited for 30 minutes at most, then lab gives up naming the lane holding it. After a verified go-live, the prod check (prod_check.<target>=, written by hand) runs and is recorded: PROD_CHECK=green or red; when red, nothing is rolled back, the served lanes are blocked and the tower is warned. --check runs it again on the served revision without deploying anything.
watch · The delivery watcher
lab watch <project> <lane> <branch>
Internal command: you do not run it. merge and close start it in the background to wait for automated checks, then merge.
Internal command: Claude Code and Codex call it with JSON on standard input, at the start and end of a session, and before a risky command. session-start provides context and the lock; session-end releases the session; notify records a question or a permission and alerts the lane tab; guard-bash and guard-tool refuse common dangerous operations by default, with the safe alternative.
An internal automation error never blocks your work. Codex asks for a one-time hook approval (/hooks); doctor checks they are in place.
help prints the commands grouped by moment (install, start, move forward, finish); help <command> explains what it is for, its syntax and an example; help glossary lists each of lab’s words with its former French name. --help and -h print the complete technical reference on stderr and exit 2. --version prints VERSION=… from the running copy.
--json converts any command’s KEY=value output to JSON; explanations stay on stderr. Interpret a non-zero code in the command’s context; doctor distinguishes 1 and 2.
Troubleshooting
Missing tool
Check and action
Run the installation command again: it offers to install Git and jq through Homebrew; lab setup offers cmux. Also check macOS and command -v for your agent.
Expected result
Each tool prints a path; installation resumes without a new trial or purchase.
Key not received
Check and action
The key, for a trial or a subscription, always arrives by email, usually within a minute: check your spam folder and the address you gave. A subscription without a request for immediate access receives its keys when the withdrawal period ends. Then run the installation command again and choose “Paste the key from my email” (trial already requested on this Mac) or “I have a key”, or write to support from the address you gave.
Expected result
The tl_key_ key is pasted and activated; no second trial nor second payment.
lab name occupied
Check and action
Compare command -v lab and command -v treelab. Use treelab without replacing the unrelated command.
Expected result
treelab --version identifies the right copy for direct calls. Automatic startup still calls lab: if occupied, preserve the other tool and contact support.
Unregistered repository
Check and action
From the intended Git root, check lab list, then run lab onboard again, or lab init with --root.
Expected result
PROJECT and ROOT match the intended repository.
Missing tab
Check and action
Check lab status, open cmux, then use lab open with the existing lane name.
Expected result
The lane tab is found or recreated.
Session still alive
Check and action
Return to the owning tab and end the session normally. For automatic continuation by its agent, save the handoff first, then run lab next from that session.
Expected result
Only one session works; maintenance is possible after it ends. Do not delete its lock.
Failed diagnostic
Check and action
Read NOTE in the local doctor output, fix the reported check and rerun the same diagnostic. --freeze is not a way to hide the failure.
Expected result
The check passes without artificially moving the baseline.
Blocked delivery
Check and action
Check the pull request target, remote checks, conflicts, gh permissions and final-batch acceptance; lab close --dry-run lists the obstacles. Fix the cause before retrying; preserve the lane.
Expected result
Checks and diagnostic pass, then the pull request is actually merged.
Update refused
Check and action
Read RESULT, REASON and FILE printed by update. Check connectivity and this Mac’s licence, then retry; --resume continues an interrupted update.
Expected result
No replacement on failure; update only after a verified archive.
Previous version absent
Check and action
Read the update --rollback refusal; preserve the current version and backups. Do not fabricate previous-release.
Expected result
Installation preserved; a reviewed report can accompany a support request.
Interrupted operation
Check and action
Fix the reported permissions or integrity issue, keep backups, then use update --resume for updates or uninstall --resume for removal requested by the diagnostic.
Expected result
Transaction completed or restored; check doctor before resuming work.
In your terminal, run lab doctor --report. Review stdout and stderr before sharing: this mode anonymises the existing diagnostic, not comments you add. The regular diagnostic without --report may contain private paths. Do not attach it unchanged.
lab doctor --report
Optional variant from a private local folder: choose a new filename, because > replaces an existing file. Exit 1 means a failed diagnostic check, not failed anonymisation; exit 2 means an error to resolve before sharing. The file receives stdout JSON; stderr stays in the terminal and must also be reviewed.
lab doctor --report --json > treelab-report.json
Check for names, personal paths, addresses, keys and project content. Remove unnecessary information, then add the report manually if you wish. This site does not read, receive or retain the file. The email link contains no diagnostic; only your email application can send it after your action.