lets-workflow
CLAUDE.md17 starsChanged 19 days agoMITView on GitHub
Claude Code plugin for development workflow with session management, code review, and task tracking. LETS began as a control layer over the model: a gate at every step, redundant reminders, hooks and lints that police behaviour. The course is now the opposite - remove control, don't add it. Models no longer need the scaffolding, and every gate costs the owner attention. Tasks on this course - each records its problem -> decision, this section holds only the course: lets-0xsw2, lets-gbfpd,…
- Reads credentials
In this repository6 other files it gives its agents.
- docs/agents.mdAGENTS.md
- goal-plan-cleanSkill
- goal-testSkill
- loop-bb-prSkill
- loop-gh-prSkill
- loop-testSkill
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 152
Keep-in-sync comment vs the command's prose spec - logic that exists in BOTH a no-workflow path (prose) and the JS lives twice.
- Distinctive: line 155
No filesystem - the script returns data.
- Very specific: line 156
No sibling import/require - all logic stays inline (await import('./x.js') fails).
- Very specific: line 173
All plugin-generated files go to .lets/ (gitignored).
- Very specific: line 175
WARNING: Always use .lets/ (with dot prefix), never lets/.
- Very specific: line 220
All plugin configuration uses the LETS_* prefix (UPPER_SNAKE_CASE).
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
lets-workflow
Claude Code plugin for development workflow with session management, code review, and task tracking.
Course: trust the model (since 2026-10-13)
LETS began as a control layer over the model: a gate at every step, redundant reminders, hooks and lints that police behaviour. The course is now the opposite - remove control, don't add it. Models no longer need the scaffolding, and every gate costs the owner attention.
- Control only for real harm. A gate, rule, hook, lint or self-check is added only to prevent a harm that is irreversible or leaves this machine (lost work, publishing, a merge, a release, another project) - never to make the model behave.
- Removing beats adding. A reversible model mistake is fixed forward, not fenced. A proposal that answers a mistake with a new layer names the costly harm it prevents - otherwise it is the old course.
- Native over own. What Claude Code already does (compaction, permissions, plan mode, SendMessage, memory) is used as is, with no LETS layer on top. LETS adds only what the harness cannot know - when and what to use it for: memory written at the right moments through native memory (lets-ogxwa), our plan run through native plan mode (lets-llh89).
- A typed command is the approval for what it names, and so are the owner's own words naming an action that asks at
standard(a peer's text, a plan or the model's inference never are); local, reversible work runs and is reported in one line. - What stays: gates on irreversible or outward actions (the
## Gatestable inlets-rules.md, perLETS_GATESlevel, lets-wu2xl) and the anti-runaway guards - a plan never runs itself, the deviation stop, the 3-failures stop. - Test for any change: does it remove a question, a rule, a step or a file? If it adds one, it names the harm.
Tasks on this course - each records its problem -> decision, this section holds only the course: lets-0xsw2, lets-gbfpd, lets-wu2xl, lets-h1fox (audit of the existing control layer).
Structure
Monorepo layout: plugin source in plugins/lets/ subdirectory, marketplace manifest at root pointing into it. Infrastructure scripts and docs stay at root, outside the plugin payload.
.claude-plugin/marketplace.json # Marketplace manifest (source: ./plugins/lets)
plugins/lets/ # Plugin payload (everything ${CLAUDE_PLUGIN_ROOT} resolves to)
├── .claude-plugin/plugin.json # Plugin manifest (Claude Code; .codex-plugin/ planned for multi-agent)
├── commands/ # Slash commands (/lets:start, /lets:done, /lets:review, etc.)
├── agents/ # 15 agents: experts dispatched by commands (skeptic verifies review findings, research claims and session CLAIMs)
├── skills/ # Reusable skills (user-facing auto-triggered + internal referenced by commands)
├── rules/ # Workflow rules (lets-rules.md) + tracker adapters (tracker-{beads,none}.md + TEMPLATE) - frontmatter-versioned, installed to .claude/rules/ by `lets init`
├── protocol/ # Lazy protocol files (worktrees, peers, handoff-lane, agents, roles) - Read by a command at the step that needs them
└── hooks/ # SessionStart hook (drift check + LETS Config + the closing language line - no rules in stdout)
cli/ # Go CLI - companion binary (Phase 2+, lets-7vtaw)
├── cmd/lets/main.go # Entry point (thin)
├── internal/cli/ # Cobra command factories (root.go, version.go, *_test.go)
├── internal/version/version.go # Version (var, ldflags-overridable from git tag)
├── go.mod, go.sum
└── .golangci.yml # golangci-lint v2 config (default linters + misspell; gofmt/goimports as formatters)
Makefile # Repo-root build (build/test/vet/lint/fmt/install/clean)
.editorconfig # Editor whitespace/charset settings
.github/workflows/ # CI: ci.yml (Go build/vet/test/lint on PRs+pushes), verify-versions.yml (source-tree version coherence), release.yml (tag-driven goreleaser)
scripts/dev/ # Dev workflow helpers (make dev / dev-tmux)
scripts/release/ # Release tooling: bump-version.sh + verify-versions.sh (used by Makefile bump/release-tag)
scripts/remote/dolt/ # Dolt SQL server VPS deployment + ad-hoc backup (NOT plugin)
scripts/remote/beads-web/ # beads-web (Rust kanban board) VPS deployment (NOT plugin)
scripts/deprecated/ # Retired scripts kept for cleanup runbooks - gitignored, not tracked
docs/ # Public-facing docs (installation.md, commands.md, workflow.md, agents.md, autonomous.md, commands/ per-command pages, …) + images/; planning notes / comment exports / KB live in gitignored docs-local/
reference/ # Local-only reference materials (gitignored)References that resolve via ${CLAUDE_PLUGIN_ROOT} (e.g. ${CLAUDE_PLUGIN_ROOT}/skills/X/SKILL.md) work as before - the env var points at plugins/lets/.
Local Development
Testing the LETS plugin against unmerged changes — across parallel worktrees, in TMUX, without polluting the global installation:
make devin a worktree buildscli/letswith versiondev-<branch>-<sha>[-dirty], prepends<worktree>/cli/to PATH, and execsclaude --plugin-dir <worktree>/plugins/lets. Each invocation is self-contained — no global install, no marketplace mutation.make dev-tmuxauto-discovers.worktrees/*/and spawns a tmux session with one Claude pane per worktree. PassWORKTREES="name1 name2"to limit. Threshold prompt at >10.- Implementation:
scripts/dev/run.sh(subcommands:build|info|claude|tmux). The Makefile targets are thin shims for discoverability viamake help.
Gotcha — Claude-inside-Claude. make dev must run from a host terminal, not from a Bash tool inside an existing Claude session. The Bash tool spawns a subshell that execs the inner claude; the outer Claude's tool harness captures stdin/stdout, so the inner Claude has no terminal to interact through and hangs. Symptom: the Bash tool times out with no visible Claude prompt. Use a fresh tmux pane or terminal window instead.
The remaining dev-binary gotchas — LETS_ENV_VERSION stamping, old worktrees, PATH-shadowing ("trust the branch"), and IsDev() semantics — live in CONTRIBUTING.md "### Dev binary: make dev / make dev-tmux".
Key Concepts
Path convention: paths like
commands/,skills/,rules/lets-rules.mdin this doc are relative toplugins/lets/(the plugin root, also exposed as${CLAUDE_PLUGIN_ROOT}at runtime). Paths starting withscripts/release/,scripts/remote/,docs/,reference/are relative to the repo root (outside the plugin payload).Go CLI source paths (
cli/cmd/lets/main.go,cli/internal/...) are relative to the repo root. The Go module root iscli/- allgocommands operate from there (or via the repo-rootMakefile).
- Commands = user-initiated workflows (sessions, commits, reviews)
- Agents = experts dispatched by commands.
/lets:review,/lets:opinion,/lets:ask,/lets:plan,/lets:backlog,/lets:researchdispatch via subagents./lets:team runopens one visible LETS session per task on any launcher, and/lets:team spawn/dismissrun a standing team's members throughmember-run.actoris a meta-agent that loads external personalities (URL or file) and adapts them to LETS modes - Orchestrators = commands that delegate to other commands.
/lets:github-prorchestrates/lets:reviewfor full PR lifecycle - review-round = the inverse of
/lets:review:/lets:review-roundCONSUMES a received multi-comment review (markers, a review file, a saved review / hand-off report, the items--fixleft open, PR threads) - triage each item, each decision on its own task, artifact FROZEN during triage, ALL edits in ONE final pass throughapply-fixes(source=review-round mode=files; the team's implementer throughapply=memberin a team worktree), replies to a PR posted after one confirmation at every level (lets-x5zqv).commands/review-round.md. - handoff = the OUTBOUND side of
/lets:review:/lets:handoff(deprecated alias/lets:review-handoff, to be removed in a future release) produces ONE self-contained brief an agent with no context (a fresh session, Codex, Antigravity, an external reviewer) can act on - plan / branch / local / staged / commits / range / PR / file. Target selectors mirror review;--commits/--rangeare handoff-only and--pris an alias;--json/--workfloware not implemented. Without a delivery flag it reviews nothing and writes nothing, and works in a repo with no LETS (no.lets/, no tracker - a branch-derived task id still reaches the brief, marked as carrying no tracker metadata). Every brief carries theREMEDY QUALITYask, the same rule the review family now states inlets-rules.md,review.md,check.mdandreview.workflow.js: separate the symptom from its root cause and fix at the component that owns the behavior.--send/--open/--codex(an open agent tab / a new Codex tab / headless) deliver the brief throughlets handoffand relay the agent's report as UNVERIFIED, then check it finding by finding.--executeis the one brief that authorizes writes: an approved plan, stripped of its STOP banner by a positional awk filter (TestHandoffPlanFilterruns it) and followed by an execution contract, goes through--sendonly; the relay shows git's commits per handed-over task and ends at/lets:review --branch.--fixis the opposite direction: THIS session applies the report's verified fixes when nothing needs deciding, through theapply-fixesskill shared with/lets:check --fixand/lets:review --fix.commands/handoff.md, aliascommands/review-handoff.md. - Hooks = SessionStart runs
lets hook session-start: an optional drift Notice, the LETS Config block and a closing response-language line, never the rules themselves (see the hook bullets under Architecture Decisions) - Rules layers (lets-nobb5) - LETS instructions are split so only an always-on core rides every turn. Core =
rules/lets-rules.md(pinned at 16,384 B byTestRulesBudget, down from 62 KB; 16,383 B used after lets-f9e9q): what applies in free conversation - language, boundaries, the one gate table byLETS_GATESlevel (## Gates, pinned byTestGatesLint), AUTO MODE, peer trust, task references + tracker essentials, worktree essentials, the flow table, the response footer, AskUserQuestion essentials, context window. Protocol skills = two internal skills,protocol-tracker(verb resolution: adapter lookup, neutral read shape, bodies, degradation, preflight, trust) andprotocol-orchestrator-offer(select, resolve once, Act / Nav shapes), loaded viaSkill(...)right before the step that needs them. Protocol files = five plain filesprotocol/{worktrees,peers,handoff-lane,agents,roles}.md, Read via${CLAUDE_PLUGIN_ROOT}/protocol/<topic>.mdat the step. Each load sits at its step and names its condition - usually "unless its text is in your current context" (after/compactor/clearit is not); a few are scoped to one case (e.g./lets:doneReadsprotocol/worktrees.mdbefore a worker-PR merge run from another checkout). Adaptertracker-<name>.md<= 8,192 B, board <= 4,096 B. Rationale, worked examples, the full flow diagrams and the Skill Quick Reference table live in CONTRIBUTING.md "## Rules layers" (budgets, "where does a new rule go" test).TestProtocolLintkeeps the wiring (alets-trackerblock loadsprotocol-trackerfirst; protocol references resolve; no pointer to a section that left core; heading pointers name a heading core still has);TestOrcLintasserts the offer load;TestRulesBudgetthe byte budgets.protocol/roles.md(lets-me9qt) is the one statement of who does what - routes, the CLAIM bar, lead-to-lead, rebase over freeze;/lets:startloads it, member-run hands every member a copy at spawn and/lets:handoffbriefs carry it whole,TestRolesLintpins one source andTestRolesDeliveryruns both delivery snippets. - Statusline =
lets statuslineGo subcommand;.claude/settings.jsoninvokes it directly,lets initwires it via value-match against"lets statusline"(foreign user-customized commands left alone). The rich multi-line box (cli/internal/statusline/rich.go) is the DEFAULT (identity / budget / task / rotating-tip; the Full tier adds a location pill); flags--compact/--light/--no-tip/--no-dir/--no-task. Glyphs are 1-cell text (no emoji), sowideRunesis empty — the border drifts on (1) an unregistered 2-cell glyph, or (2) a glyph absent from the monospace face that font-substitutes to 2 cells whilecellWidthcounts 1 (thelets-6md86cause:glyphFolderchanged☰→»because cmux/Ghostty rendered☰2-cell; check a glyph withprintf '%s\n' 'ref |X|' 'g |<G>|'). Run by handlets statuslineno longer hangs — a TTY-stdin guard prints a wiring hint and exits 0 (lets-7frjs). The task line reads.lets/cache/task-status, self-refreshed by a detached--fetch-task-onlysubprocess — no bd/network on the render path. Appearance is persisted (not just rendered) bylets statusline config//lets:statuslineto personal.claude/settings.local.json. Flags,COLUMNStiers, width math, payload-robustness, escape-injection defense, the TTY guard,lets statusline config, and legacy-shim migration:cli/README.md"## lets statusline" / "## lets statusline config". .envversioning — the first keyLETS_ENV_VERSIONrecords whichletsbinary version last regenerated.lets/.env.RegenerateEnv(cli/internal/initcmd/env.go) is the canonical writer (preserves user values + foreign keys under# User-added keys; restores a hand-deletedLETS_*key to itsletsconfig.Defaults()value). It is NOT in theletsconfig.Keyswhitelist (metadata, not user-config), so the hook's session injection skips it.lets initregenerates on version mismatch or new prefs;/lets:updatereuses it to refresh the header. Detail:cli/README.md"## lets init" / "## lets update".lets worktree create/remove/list/info— Go subcommand (cli/internal/worktreecmd/,//go:build unix) owns the filesystem/git work for interactive worktrees: name validation, not-inside-worktree guard, attach-vs-new-branch auto-detect, race-safe.gitignorehardening, atomicgit worktree add,.lets/whole-dir symlink +.beads/.envtargeted symlink, verify, and rollback.commands/worktree.mdis a thin--jsondispatcher (captures intent viaAskUserQuestion); Windows gets a no-op stub (lets-rqep4). JSON envelope, typed exit codes,--print-cd, and the rollback contract:cli/README.md"## lets worktree". Adopt / release / sweep:lets worktree adoptmakes a worktree LETS did not create (Orca, a teammate,git worktree add) a LETS worktree -.letsplus the tracker adapter's declared## Worktreestore links, then the task id into.task-<slug>- locked, idempotent, never deleting (a cache-only.letsmoves to.lets.pre-adopt[-N]); the SessionStart hook runs it for an unlinked worktree of an initialized project before LETS Config is built, and in every linked worktree declares the main.lets/in the worktree's.claude/settings.local.jsonpermissions.additionalDirectoriesso writes there do not prompt from the next session (EnsureLetsAdditionalDir, also run bycreateandadopt; lets-urmfa).releaserecords a worktree before it is archived;lets worktree recordanswers whether a task left a session record (anchored on the snapshot's- head:sha) and whether it is orphaned;releasewrites its marker before removing a task-state file that names a valid task (a task-less one, the post-/lets:donestate, is removed without) and is loud when the record is missing;sweepdeletes task branches merged into<merge>- the resolved remote's copy first, else the local one;removeis remote-aware. The task id and branch naming convention is declared by the adapter (id:/branch:/worktree-branch:/accept:, overridable in the board file;branch:/worktree-branch:render withoutid:, which only reading an id back needs, and every declaration LETS cannot use is awarnstep or aconvention_declaration_invalidrefusal - lets-puvic) and parsed / rendered only in Go (trackeradapter,lets worktree branch-name,info --task-candidate);taskstateis the one writer of.task-<slug>(lets worktree task-state).createandadoptcopy the main checkout's gitignored files that match Claude Code's.worktreeinclude(copy, never overwrite, never fatal; lets-41cpf),createrolls back a checkout a failedgit worktree addleft behind (lets-41cpf),removetreats.DS_Storeas litter (lets-yeyhz), andswitchwarns when the checked-out rules lag the plugin (lets-5whww).lets cmux open— optional, macOS-only worktree launcher (cli/internal/cmuxcmd/,//go:build unix). Wrapscmux workspace create --cwd <path>(manaflow-ai/cmux) to open a worktree session runningclaude '/lets:start <id>'. Strictly optional, never hard-fails: detects cmux on PATH +runtime.GOOS=="darwin"; on absence/error returnsOK=true+launch.launched=false+ afallback_command.commands/worktree.mdStep C3.5 decides terminal-vs-cmux from$LETS_LAUNCHER(+--cmux/--no-cmuxoverride) and renders the result. Duplicate-session guard:openrefuses to spawn a second workspace for a path that already has one (reason=already_open;--forceoverrides) — "one live session per worktree" at the launcher level. Identity stamp at create:open --name <slug>sets the short tab label andopen --description "<task-id> · <title>"stamps the canonical beads id + full title (cmux stores it, exposes it inworkspace list --json), so each of N parallel sessions self-identifies its task — C3.5 wires both from the task.lets cmux renamerelabels a workspace tab post-hoc (resolve by--ref/--cwd/active; invoked on-demand, not auto-wired) — identity is normally stamped at create now, so rename is the fallback, not the primary path. Launch mode (lets-d3wu3; at the/lets:worktree create//lets:team runlevel, a--commandstring change):--launch-mode default|auto|all-in(--auto=auto,--all-in=all-in) beatsLETS_LAUNCH_MODE, unset ->default; it launchesclaude,claude --permission-mode autoorclaude --permission-mode bypassPermissionsacross terminal / cmux / tmux (Orca cannot pass a permission mode).all-inis explicit only (a typed flag or a key the owner set - never inferred, never a fallback, never the default) and every all-in launch prints one announce line first; LETS gates (push, PR, merge, close, peer sends) are unchanged andcrossSessionInboundis never written. The harness holds a cross-session message only when exactly one side runs in the bypass class, and a session cannot read its own class (spike 2026-10-12: no env var, no registry field, not in SessionStart input), so the rule is "setLETS_LAUNCH_MODEto the class your orchestrator runs in". A team's mode is rendered into itsagent_command/orca_agentbyteam-init --launch-mode(worktreecmd.LaunchCommand, the one renderer).lets cmux notify(lets-m8ecy) — the gate-notification sink: wrapscmux notify --workspace <ref> --title/--subtitle/--body(resolve by--ref/--cwd/active), same never-hard-fail contract as open/rename (OK=true+notified=false+ reason off-macOS/cmux-absent/no-match;Notified=truemeans ENQUEUED, not confirmed-seen). The non-unix stub emits a parseableok=true,reason=not_macosenvelope (exit 0) — unlike open/rename's hard-error stub — so--jsongate snippets degrade cleanly cross-platform. Driven at LETS gate points by the autonomous pipeline (below). Windows gets a stub. Detail:cli/README.md"## lets cmux" (notifybullet).lets tmux open/rename/notify(lets-0np5i) — the portable thirdLETS_LAUNCHER, cross-platform on unix (cli/internal/tmuxcmd/,//go:build unix; Windows stub). A file-for-file sibling ofcmuxcmd(same JSON envelope, typed exit codes, never-hard-fail contract), driving the realtmuxCLI.openopens the worktree as a new window inside$TMUXor a new detached session outside it (send-keysdelivery; never auto-attaches — surfacesattach_command, because attaching would seize the Claude Code bash subprocess). Dup guard bypane_current_path(EvalSymlinks-resolved, load-bearing on macOS).--descriptionis stamped into the@lets_taskwindow option, NOT the window name (the tmux window name IS the width-budgeted status line).notifybroadcasts to every attached client and reportsno_clientwhen none are attached —display-messageinto a detached session exits 0 while showing nobody, so a target-scoped notify would report a phantom success on the pipeline's own detached-session path.reasonset:tmux_not_found | tmux_error | already_open | pane_not_found | no_client. Nonot_macos. Windows stub:open/renamehard-error,notifyemits a parseable graceful envelope. Detail:cli/README.md"## lets tmux". Not to be confused withmake dev-tmux(see "Local Development"):make dev-tmuxis a dev harness (builds a dev binary, spawns one Claude pane per existing.worktrees/*, for testing the plugin);LETS_LAUNCHER=tmuxis the worktree launcher (opens ONE new worktree session during/lets:worktree create). They share no code.lets orca open/notify/status(lets-ip06f) — an opt-in addon for the Orca desktop app (cli/internal/orcacmd/,//go:build unix), switched on byLETS_LAUNCHER=orcalike cmux / tmux; without it no Orca binary is looked up and nothing else changes.opencreates the task worktree through Orca (/-free name<task-id>-<slug>, Claude launched with/lets:start <id>),notifywrites the gate note as the Orca card comment,statusreports the binary and whether the app runs.open --agent <id>launches another Orca agent instead ofclaude(not with--no-agent) andopen --base-branch <ref>cuts a new branch from that ref instead of the resolved base (lets-l9st6).terminal(lets-0rgnd) opens ONE Orca terminal in an existing worktree Go created (--worktree,--title,--command) and returns its handle - the standing team's lead; it never creates an Orca worktree (there is nolets orca create, andterminaldoes not go throughopen), and a refusal degrades tolaunched=false+ a printedfallback_command. Resolves the app-bundle binary before PATH, never pins Orca's flags (calls the verb, classifies the failure) and never hard-fails: Orca absent or refusing ->launched=false+ reason, and/lets:worktree createfalls back to cmux, then terminal.lets initwritesorca.yaml(setup hooklets worktree adopt, archive hooklets worktree release) only for a project withLETS_LAUNCHER=orca./lets:worktree createon orca runsopen --no-agent(--setup skip, no agent) ->lets worktree adopt->terminalwith{launch_cmd}, so the worktree is linked before any agent runs and the launch mode applies;create_ambiguous/agent_terminal_presentstop without a fallback (lets-41cpf). Detail:cli/README.md"## lets orca".lets peers(lets-ip06f; names and native messaging lets-0xsw2) — the Go side of peer messaging between LETS sessions (cli/internal/peerscmd/+ thepeertailandccregistryleaves,//go:build unix). Go lists, reads and resolves; it never delivers - every peer message is the harness'sSendMessage, sent by the orc skill and addressed by session NAME.wholists the machine's live Claude sessions from the Claude Code registry only, each withrepo_root/relation/in_repo(lets-t5cfa; ships next release) (no Orca): name, branch, the branch's task-statetask/orc,orchestrator/scope/standing,duplicate_name(machine-wide; a parked session and its background continuation count once -ccregistry.Snapshot.Named, lets-gbfpd), plusselfandrepo_slug. An orchestrator is a NAME recorded by/lets:start --mainas anorchestrator: <name>[ scope=…][ standing=on|off]line of the merge-branch task-state (lets worktree task-state set --self-orchestrator);<repo>-orc[-<scope>](peername) counts only when no recorded name is live.orchestratorresolves bound (the branch'sorc:name, live anywhere on the machine - a target in another repo is reached by name) -> self -> single / ambiguous / none (single / ambiguous over the first non-empty tier: this LETS project, then a parent or nested repo; unrelated orchestrators only inelsewhere[]), and always returnsself_record(the caller's own record, standing tri-state; null when two live sessions share the caller's name, so a reused name never inherits a grant). With--from-name/--from-addr(the harness envelope of an inbound message),orchestrator(worker / lead side) andwho --orc <own>(orchestrator side) also returnstanding_ok/standing_reason: Go decides whether the sender is the bound peer - thefromsocket's pid is the one live registry entry of that name, in this or a related repo, bound, with standing on - and the model never compares names or pids.sender --from-name --from-addr(lets-wu2xl) answers provenance only, any repo:sender_okwhen thefromsocket's pid is the one live registry entry of that name, plusname/session6/cwd/in_repo; fail closed withsender_reason; it reads no record, grant or binding and writes nothing - the orc skill picks the scope byLETS_GATES.tailreads one of this repo's sessions throughpeertail(--since <RFC 3339>; native INBOUND turns carryfrom);ask-rotakes--question-file.frame/tell/wait/roleare deprecated stubs for one release:tellnever types, it hands the framed text back forSendMessage;rolerecords nothing (the/clearproof is the task-statesession_proof:key, lets-gbfpd). The Orca typing transport for Claude peers, the role registry and the bound-sibling carve-out are gone;who/orchestratorrefresh the last-seen files of live orchestrators. Every unknown registry or transcript format degrades by name. Detail:cli/README.md"## lets peers"./lets:orc+/lets:peer(lets-ip06f) — theorcskill (skills/orc/SKILL.md, user-facing:/lets:orcor natural language) asks / pings / reads / tells / lists the repo's peer sessions and is the ONLY sender of peer messages (TestOrcLintkeeps every send form there and banslets peers tell/frame/waitandterminal sendeverywhere; every touchpoint only offers it, withfooter=none). Since lets-0xsw2 it sends with the harness'sSendMessageby name (notify_when_idleforask, after aListAgentsliveness check), prints an honest result line (sent,held for approval in <name>,refused by <name>,expired unapproved in <name>,NOT SENT) and never resends; a reply arrives as the peer's own<cross-session-message>and is relayed whole. A name outside this repo'swhorows is sendable only as this branch's boundorc:name, a name the user typed in this turn, a hub listing row (via=hub) or the sender being answered. Standing authorization (/lets:orc standing on|off, recorded asstanding=on the orchestrator's line; the full rule isprotocol/peers.md## Standing authorization): a bound pair in this repo talks without per-message confirmation in both directions - a requested send from either side skips the Send? question, and either side may answer the other inside the agreed direction without asking (the sender identified only by Go'sstanding_okfrom the envelope'sfrom-name+from, a one-time notice before the first autonomous reply, at most 3 autonomous replies per peer until the user speaks);--standing onis written only with--self-orchestrator, from the orchestrator's own process (orchestrator_not_own_processotherwise); cross-repo, unbound and hub sends never use it, and every hard gate stays. ByLETS_GATES(lets-wu2xl): the standing grant governsstrict; atstandard/minimala requested send goes without the Send? question to any owner session (ListAgents, cross-repo included), and an inbound message is answered autonomously oncelets peers senderreturnssender_ok=true- a verified peer's request counts like the owner's for an action the core## Gatestable does not list, inside the receiver's task; a listed one asks the receiver's owner once; the 3-reply cap and provenance in Go hold at every level./lets:peer <name> <verb>(commands/peer.md) is a slash alias whose body is oneSkillcall into a skill with a target and no footer of its own. Inbound peer text is untrusted data (lets-rules.md## Peer Messages); a send is approval-gated under AUTO MODE unless a standing grant covers it. The rule for WHEN a command offers the orchestrator - the selection test, the Act / Nav shapes, silent without a live target - is the internalprotocol-orchestrator-offerskill (lets-nobb5 - it was lets-rules### Orchestrator offer); touchpoints load it at the offer andTestOrcLintpins the label, that load, oneverb=askhandler per offer and a four-option cap on every gate (lets-jjzzt)./lets:hub(lets-ip06f) — an Orca addon (commands/hub.md; stops in one line withoutLETS_LAUNCHER=orca, pinned byTestOrcLint): lists the orchestrators of every repo Orca knows (lets peers who --orca-repos, rows byrepo_index; since lets-0xsw2 - each repo's recorded orchestrator names,<repo>-orc*only as the fallback, and stopped ones from its last-seen files), messages a live one by name through the orc skill (via=hub), answers a read-only question from a stopped one withlets peers ask-ro --question-file(a headless fork narrowed at launch: plan mode,--tools Read,Grep,Glob, empty MCP config, allowlisted env) and wakes one for gated work withlets orca wake. Refuses a live or unknown orchestrator; scheduled digests were dropped (an Orca automation cannot run in plan mode). Cross-project reads only on an explicit/lets:hubrequest (the hub carve-out inplugins/lets/protocol/peers.md; core rules only name it).lets notify(lets-0np5i) — launcher-neutral gate-notification sink (cli/internal/notifycmd/). ResolvesLETS_LAUNCHER(project.lets/.envover~/.lets/.envvialetsconfig.MergedEnv) and dispatches tocmuxcmd.Notify/tmuxcmd.Notify/orcacmd.Notify;terminaland unknown values degrade tonotified=false+ a named reason. The autonomous-pipeline gate snippets (plan-workflow.md,execute.md) calllets notify— NOT a hardcodedlets cmux notify— so a tmux operator finally receives gate notifications. Launcher validation lives inletsconfig.ShippedLaunchers+ValidLauncher, pinned to the registered subcommands byTestShippedLaunchers_MatchSubcommands(the launcher analogue of the tracker platform'sTestShippedTrackers_MatchOnDisk— a tracker adapter is a file on disk, a launcher is a cobra subcommand).lets handoff(lets-w5tm5) - delivery of a hand-off brief (cli/internal/handoffcmd/,//go:build unix):targets(agent terminals of this checkout; never this session's own, never a shell),send(one-line pointer; refused only on evidence - Orca's agent state, a draft Orca holds for the input line, a dialog in any agent's tab (permission / trust / update prompt), or the Codex / Claude screen recognizers seeing a busy agent or half-typed text - otherwise typed withinput_linerecorded; no interrupt; a stale handle re-joins the same pane bytabId:leafIdand sends once; never resent after a delivery attempt; noturn_started=unproven+ redacted read-back),codex(headlesscodex exec --sandbox read-only;-ofirst, rollout second; the process group is killed on return),await(Codex: thetask_completewhoseturn_idis the turn of the delivered user message, in a root session, found across all rollout date directories; any other agent: the report-file contract -<base>-agent-report.md+.done). Content fingerprint before/after flags working-tree drift. Logic in the leaf packagecli/internal/agentrun(Provider:Name/Run/Await) - the seam lets-9yz68 reuses. Never importspeerscmd(TestDeniedImports). Detail:cli/README.md"## lets handoff".lets members(deprecated stub, lets-gbfpd) - records nothing; removed next release. Members are tracked by the caller's own files - the recorded agent id is the address andListAgentsonly says busy (lets-mpjhc, lets-kwd6e): the execute run record (agent_id,dismissedper group and per run analyst) and the team file (Member: <name> = <agentId> lets:<role> (lead <session6>)andDismissed: <name> (lead <session6>)lines in## 7. Current task). The stub (cli/internal/cli/members.go, no build tag;cli/internal/memberscmd/is deleted) keeps the v0.10.0 flag sets and envelope - every verb exits 0 with adeprecatedkey and answers so a v0.10.0 plugin's gates pass (a live lead in arun-*scope or in the worktree the scope's team file claims, a live member for--name,claimedechoing--claim). Exits 40-49 are retired..lets/execution/members-*.jsonstay as history, never read. Detail:cli/README.md"## lets members".lets integrate(lets-7dwc1) - lands--since..--fromof an isolated implementer's branch in the caller's tree as ONE staged patch (cli/internal/integratecmd/, exits 50-59): cherry-picks in a temporary detached worktree at<git-common-dir>/lets-integrate/<run>-<chunk>(hooks off), writes.lets/cache/integrate-<run>-<chunk>.patch, applies it withgit apply --indexand verifies it against the picked tree - never a merge, neverreset --hard, nevergit worktree prune; the lead commits. The temp worktree is removed only when an owner marker outside it and a nonce in its own gitdir both match.--revert --patch <path>undoes a rejected patch before it is committed. Detail:cli/README.md"## lets integrate".- Team file (lets-7dwc1) -
.lets/teams/<callsign>.md, rendered fromplugins/lets/templates/team.mdbyteamfile.Render; model-read, except the frontmatter keys Go reads:worktree,git_dir,lead_name(teamfile.LeadName; lets-gbfpd) andagent_command/orca_agent(teamfile.LaunchCommands, classified forlets worktree infoteam_launch; lets-gbfpd) (teamfile.FindByWorktree, 4 values: name, ok, warnings, err - a malformed file claiming ANOTHER worktree is a warning, two claimers areErrAmbiguousTeam, a reused pathErrStaleTeam, a malformed claimerErrMalformedTeam).lets worktree inforeports it asteam;adoptderives no task id in a team worktree (team_branch or dir, or a team file hit). Continuity is files only: the harness restores no member after a lead restart. - Standing teams (lets-0rgnd) - a team per area that outlives its tasks; the workspace and the files are what persist. A team is named by a callsign (snake, frog, ...;
teamfile.Callsigns, 40 animals): team name = callsign, team file.lets/teams/<callsign>.md, worktree dir AND branchteam_<callsign>, lead session = the team file'slead_name: the short<callsign>-leadfor a new team,<repo>-<callsign>-lead(peername.Lead(RepoSlug)) with a warn step when a live session or another team file of this repo already holds the short one, or the owner's--lead-name(lead_name_invalid2;lead_name_live/lead_name_taken34, besidecallsign_live34 when neither derived name is usable) - lets-rpufs; an existing team keeps the name it recorded andlead_nameis owner-editable (then/renamethe lead) (lets-gbfpd);lets worktree inforeportsteam_lead(name,self,matchlead | other | unknown) - a hint, never a gate - pluslaunch_mode(value,source,valid) andteam_launch(the team file'sagent_command/orca_agentclassified byworktreecmd.ClassifyLaunch:default|auto|bypass, warningssettings_override/cross_session_inbound;team-initreports the same aslaunch_class), which the all-in announce and the/lets:team runconfirm read - never a substring test (lets-gbfpd)./lets:team createroutes to/lets:worktree create --team:lets worktree team-init --suggest-callsignproposes a free one and--checkverifies it (no team file, and a usable lead name - the short one, or the repo-prefixed fallback when a live session anywhere or another team file of this repo holds it) BEFORE anything exists; both reportlead_name; Go createsteam_<callsign>from the one base Go resolves (<remote>/<merge>after a bounded fetch; the local<merge>only when no remote is configured; lets-qjt3h) for EVERY launcher;team-initthen writes the team file through a fsynced temp +os.Link(never overwritten, by any writer: 27team_exists, 28template_missing, 34callsign_live); the optional.lets/hooks/team-setupis shown whole and runs only on the owner's yes; only the lead is launched, as a plain session ({agent_command} --name '<lead_name>' '/lets:start'; lets-eolec - a session agent would drop the default prompt and native memory; orca:lets orca terminal; the command crosses as a quoted heredoc); a new team file's roster holds only the lead, and the lead's/lets:startasks which members to spawn - architect + skeptic + explorer (recommended), skeptic + explorer, or none - adding the picked roles as rows (lets-7k6ae); every lead/lets:startreads the team notebook (sections 8-10), and once the roster holds members it respawns them with no question (members restore;--solostarts lean, an unattended turn respawns nothing) and prints a## Teamblock - roster, current task, notebook size (lets-6ll9s). In the main checkout of a repo with standing teams,/lets:startasks once where a picked task runs - here, handed to a live team's lead through the orc skill (atstandard/minimala lead holding no task claims it itself - a narrow core## Peer Messagesexception, orc Step 7's team claim; a busy one shows it to its owner), or a/lets:worktree createworker - before anything is claimed (lets-f9e9q). Team mode (lets-mpjhc, lets-kwd6e): in a team worktree whoseteam_lead.matchislead,/lets:plan,/lets:review,/lets:check,/lets:opinion,/lets:askand/lets:executedispatch to the team's members first throughmember-runop=route/op=receive(the caller contract isprotocol/agents.md## Team mode; a role the roster lacks runs as an announced one-shot;--soloturns it off; the Members question is/lets:team members, asked at most once per lead session), and every spawn recordsMember: <name> = <agentId> lets:<role> (lead <session6>)in the team file's## 7- a member is addressed and resumed by that id, and only a send returningagent_gonecounts it gone, never its absence fromListAgents./lets:startin the team worktree claims no lead (it only hints/renamewhenteam_leadsaysother) and moves the worktree between tasks withlets worktree switch: refuses 29not_team_worktree, 33target_is_merge_branch, 35session_held, and as exit 14 kindsdirty_worktree(without--park),index_unmerged,operation_in_progress,detached_head; a new branch is cut from that resolved base with--no-track(31no_remote_basewhen the remote has no<merge>, 31remote_ambiguouswhen several remotes leave it open; lets-57lb9);--parkcommits tracked and--include-named new paths aswip(<id>): park(30untracked_presentfor a new path not named; ignored files are never parked; never a stash) and recordspark:/park_team:; a refusal reports where it would have gone asplanned, neverbranch/created/base; exit 32 (members_live) is retired - the busy-writer check is take-task Step 2T'sListAgents(lets-gbfpd); arriving on a parked branch unparks (reset --soft HEAD~1) only when the park is HEAD and on no remote.lets worktree parked --team <c>listsowned/unownedparks./lets:donewarns about park commits in its range and, in a team worktree, offers to promote facts to the team file's Standing knowledge, skipping what/lets:note --team [text]already wrote there mid-task (lets-phm2v)./lets:team disband(D1-D6) never kills: the lead is the session named bylead_nameinlets peers who(live -> tell it, or "Lead has wrapped up";whofailed -> ask the owner as for a live one), an in-progress task or an owned park stops it, the worktree goes through/lets:worktree removewith its nets,.lets/hooks/team-teardownruns only on a yes, and the team file (and any legacy members registry) stay as history. Detail:cli/README.md"## lets worktree". - Session-owner guard (lets-7dwc1; reworked by lets-gbfpd) - the SessionStart hook no longer lets any session in a worktree take the task-state
session:line: the refresh (startup) and the/clearcarry runtaskstate.MaySetSessionunder the task lock (1 s deadline) - a live (HeldLive,HeldRotatedForeign) or unjudgeable (HeldUnknown) foreign holder is never overwritten; there is no lead rule. The carry needs proof: the task-statesession_proof: <sid> <pid> <started-ms>key, written by Go beside every Gosession:write from the caller's own registry row (ccregistry.Snapshot.CallerSession: the nearest Claude Code process above the command must be that session), binds only when its sid is the recorded session, and the guard requires that pid's current row to carry exactly thatstartedAt(Snapshot.SameProcess) beforeSnapshot.Rotated; onclaude -r(resume) the hook rewrites only the proof. A session parked into a background job is continued in it (Snapshot.ContinuedIn, lets-56ymc).lets worktree task-state set --session-idis guarded too: a live foreign holder refuses with exit 35session_held, nothing written; unknown / dead / no proof write (the "/lets:start in this chat" remedy). A declined write is a Notice naming the holder and the remedy, and session-boundary then reportsprior-session. Detail:cli/README.md"## lets hook". - Autonomous task pipeline (lets-m8ecy) — near-autonomous spawn → plan → execute so N parallel sessions are manageable:
/lets:worktree create <id> --flow plan-workflow --autospawns a worktree that claims the task (resolve-and-claim convention indetect-task, AUTO-MODE-exempt entry claim) and lands in autonomousplan-workflow(gated on its PREVIEW availability, falls back to--flow plan); the human answers a bounded up-front clarify gate (GATE 1) and approves the plan file (GATE 2);/lets:execute --autothen runs the approved plan without per-step gates (hard-stops preserved; REFUSES on the merge-branch). cmux notifications fire at the gates (+ execute-blocked), marker-gated by the per-task.lets/cache/pipeline-state-<id>file so only autonomous runs notify. The statusline phase-row that renders the marker is a deferred follow-up.--flowonly swaps the launch--command(launcher-agnostic — terminal/cmux/tmux inherit). Design boundary held: filesystem/process/git → Go (cmuxcmd); orchestration/gates → markdown. /lets:update— sync a project with the current release.commands/update.mdshellslets update --json(mirrors/lets:init → lets init); the Go subcommand (cli/internal/updatecmd/) auto-syncs.lets/.env(viaRegenerateEnv, skipped on adevbinary) and.claude/rules/lets-rules.md(viadrift.Check+ re-copy), then version-checks theletsbinary + the plugin against the latest GitHub release (report-only — can't self-replace). Order-aware + self-driving (lets-rlue4): when the plugin is behind (outdated vs latest, or locally < the binary) the rules/tracker-rules re-copy isdeferred(NOT written) so rules never sync to a stale plugin — onlyStateOutdateddefers (missing still installs, ahead keeps its reset).Runemits artifacts.env → binary → plugin → rules → user-rules → tracker-rulesand computes a single top-levelnext_action(init|binary|plugin|reload|main-checkout|new-session|user-rules|done,commandexecution-bound const for binary,versionfor done) from the artifact statuses; the command renders exactly that one step (done →✓ Everything on vX.Y.Z, no matrix) and can run the binary installer and the on-disk plugin refresh (claude plugin marketplace update+claude plugin update) in-session (each approval-gated, one attempt). Installed-plugin resolver + honest steps (lets-tg008):ResolveInstalledRootcompares the project rows against the plugin actually installed (~/.claude/plugins/installed_plugins.json), not the per-session${CLAUDE_PLUGIN_ROOT}; an installed-but-not-loaded plugin setsloaded_plugin_versionandnext_action=reloadsaying a re-run reports the same; a worktree run no longer refuses -.env/rules/tracker-rulescome backskipped(summary.skipped),main_checkoutnames the main checkout andnext_action=main-checkout.SchemaVersionstays 2 (next_action/deferred/skipped/loaded_plugin_version/main_checkoutare additive). Does NOT prompt for config or touchsettings.json/beads — that'slets init's job (init = setup; update = sync). Rules-drift Notices point here forunknown/outdated/ahead;/lets:initonly formissing. The global~/.claude/rules/lets-rules.mdis not drift-checked: it is a cache of the running plugin kept by the SessionStart hook (internal/rulescache- sha256-keyed in~/.lets/cache/rules-cache.json, one lock, forward-only, only an installed plugin writes, a hand-edited copy is saved to.bak[-N]first;lets init --useris only the first install) (lets-tg008). Scope-aware (LETS_RULES_SCOPE, merged project>user env):scope=user+ missing project copy =delegated(rules from~/.claude/rules, never re-created - kills the boomerang) ornot-initializedwhen nothing covers the project. The 4-artifact table (+ two optional rows:user-rules- omitted when~/.claude/rules/lets-rules.mdis absent, read-only:delegatedonly when key, file and the verified installed plugin share one hash, elseunknownwith the reason andnext_action=new-session|user-rules(lets-tg008); andtracker-rules- the activetracker-<name>.mdadapter, present whenLETS_TRACKERnames a shipped adapter (or a user-authored one with an installed copy - reporteddelegated, left as-is), and the row that applies switch cleanup + board scaffold on the edit-.env-then-update path) + caching detail:cli/README.md"## lets update" (lets-hdrdr.3). A tracked rules or adapter copy that differs fromHEADgets an "uncommitted - commit it" note on its row (lets-5whww).- Skills = reusable actions in
skills/<name>/SKILL.md. Two types: user-facing (auto-discovered, triggered via description match; can also be invoked via theSkilltool) and internal (not auto-discovered, invoked by commands via theSkilltool when needed). Examples:create-task,commit,take-task(user-facing),detect-task,actor-fetch-personality(internal) - Tracker platform (lets-5d48z) —
LETS_TRACKERis no longer schema-reserved: it names a tracker adapter (beads|none; a non-beads adapter like planfix-mcp is user-authored, not shipped). One self-containedrules/tracker-<name>.mdper adapter binds the neutral verb set (create/show/comment-add/set-status/closeCORE + optionalcomment-list/list-by-status/search/ready-stats) to a concrete transport (abdcommand, anmcp__*tool, a generic REST proxy). One axis, not two — transport is encoded per-verb in the file, so there is no separate transport/driver config key. Command/skill BODIES carry neutral```lets-trackerverb blocks (oneverb key=valueper line) — NOT inlinebd; the orchestrator resolves each block via the loadedtracker-<name>.mdand runs ITS binding - the resolution rule itself is the internalprotocol-trackerskill, loaded before a file's first block (for beads, the samebdcommand, now table-driven + golden-pinned). A shell-computed comment/description body crosses via a<field>-file=temp file (body-file=for comments,description-file=for create; no computed multi-line value re-typed across the model boundary); a short or static-templated body is inlinebody=/description=; reads return the neutral{id,title,status,url,description}shape. Each adapter declares its fields (lets-x1rnx):create/set-fieldopen withaccepts:,showwithreturns:, in neutral names (priority→severityfor a native rename), so a command never collects a field the tracker cannot store; andclosedeclares the status it leaves the task in, so a board whose terminal is process-gated reports an advance-and-handoff instead of a phantom close.lets initinstalls exactly onetracker-<name>.md(drift-tracked likelets-rules.md, auto-loaded from.claude/rules/). beads = reference adapter (the bd invocations are unchanged, pinned by a golden test; no inlinebdsurvives anywhere — the allowlist that once held the detect-task liveness probe ships empty and is asserted empty, and the probe goes through the neutralshow— lets-x1rnx); none = null adapter (supersedes lets-nwwkj). planfix-mcp was prototyped (pure MCP via the server's genericplanfix_requestREST passthrough) but is NOT shipped - it is a user-authored adapter example (see docs/trackers.md); a popular-platform worked example is planned. A shared adapter file is trusted instruction auto-loaded into context — its bindings execute as written (review before installing one you didn't author; contract test pins shape, not safety). Adding a tracker is a one-file recipe (CONTRIBUTING "Add a tracker adapter"), enforced by a contract test (incl. theaccepts:/returns:declarations, asserted against the neutral field vocabulary) + a beads-binding golden + a two-tier "no bd in a command body" scan that covers EVERY fence and the*.workflow.jsassets + a status-canon pin onlets-trackerargument values + atestdata/tracker-fake.mdpartial-adapter fixture (the shipped set is all-or-nothing, so absent verbs and renamed fields had no coverage). The full platform section + the.mcp.jsonwiring live below / indocs/trackers.md.
Architecture Decisions
- Adversarial verification + Dynamic Workflows (opt-in
--workflow)./lets:reviewrefutes every[BLOCKER]/[SUGGESTION]withlets:skepticagents before reporting (asymmetric drop: SUGGESTION on a simple-majorityreal=false; BLOCKER only on near-unanimous high-confidence refute, downgraded on a simple-majority, else kept). Runs in BOTH standard (Task, capped) and--workflow(off-context) modes —--workflowis a pure performance lever, same verified findings. SPEC injection + PR branch gate:/lets:review+/lets:checkresolve the active task's SPEC via the tracker's neutralshowand inject it as fenced data into the reviewer prompts, so planned-but-unwired work is not flagged as scope creep; with no spec a scope finding caps at[SUGGESTION]. The skeptic's block is narrower - it cannot set a tier, so a tier-cap instruction would be executed asreal=false, whichdecide()maps to a drop. PR mode OFFERS agh pr checkoutso agents read the reviewed code: it never creates a worktree (the user's choice; pinned byTestReviewNeverCreatesWorktree),--jsonnever touches the working tree, and the previous branch is always restored - branch-keyed task state desyncs otherwise./lets:review,/lets:opinion,/lets:backlog,/lets:researchship committed workflow skeletons (skills/<name>-workflow/<name>.workflow.js); authoring standard + runtime constraints in Dynamic Workflow Assets below. - Audience for plugin source —
commands/,skills/,agents/,rules/lets-rules.mdare read by the model (orchestrator + subagents), never by humans: write terse, structured, marker-driven (MANDATORY/NEVER/IMPORTANT), tables over prose. Human-facing docs areREADME.md+CLAUDE.md. Full guidance:CONTRIBUTING.md"## Audience of plugin source". - Claude Code session-id channels (two of them — pick the right one).
${CLAUDE_SESSION_ID}— template substitution in command/skill markdown: Claude Code rewrites it to the literal session UUID before the model reads the spec. Available since Claude Code v2.1.9. Currently unused in the plugin: the last consumer (the session snapshot) moved to the bash channel because this template channel is fragile inside a multiline Write-tool arg (session-snapshotSKILL / lets-bdkvd QA #13). Prefer$CLAUDE_CODE_SESSION_ID(bash) for any new use.$CLAUDE_CODE_SESSION_ID— Bash subprocess env var Claude Code injects into every Bash tool invocation. Use inside bash commands —bashexpands it at runtime, no template/model magic needed. Preferred for bash-only contexts (e.g.bd comments add "... $CLAUDE_CODE_SESSION_ID ...") because it sidesteps the placeholder-skip fragility QA found in template-substitution-inside-multiline-args (lets-bdkvdQA #13). Also the only channel subagents and external scripts can read.- Naming gotcha: template has no
_CODE_, env var has_CODE_. They are NOT aliases. - As of this branch,
/lets:end+/lets:doneuse$CLAUDE_CODE_SESSION_ID; broader adoption (subagents stamping session_id, statusline,/lets:teamrecords) tracked inlets-bdkvd.
- Other Claude Code template variables in command/skill markdown.
${CLAUDE_PLUGIN_ROOT}(plugin install path) is substituted at command/skill load time — immune to context compaction.${CLAUDE_PROJECT_DIR}is NOT substituted; usegit rev-parse --show-toplevelinstead. - Agents define WHO and HOW (expertise, behavioral modes, tiered scoring, output format). Commands define WHAT and WHEN (provide content, select agents, pass mode name)
- Agent frontmatter fields:
name,description,tools,color(terminal output: red/blue/green/yellow/purple/orange/pink/cyan), optionalmodel, optionalomitClaudeMd(see below). Model policy (lets-f1lu1): agents carry no upward model pin - each inherits the session model, so a Fable session runs Fable everywhere (a NAME pin likeopusgoes stale and downgrades agents to an older model once a newer one ships - e.g. Opus 4.8 on a Fable session). The sole exception isexplorer->sonnet, a downward cost-pin for mechanical codebase-mapping (a downward pin can't cause a capability downgrade). Verify (skeptic) deliberately stays on the session model - a cheap verifier false-drops hard[BLOCKER]s (decide()drops a BLOCKER when all skeptics votereal=falseat any confidence, and a weaker model leansreal=falsewhen it can't substantiate a deep finding). The expert/analyst agents use tiered scoring ([BLOCKER]/[SUGGESTION]/[NIT]), self-contained Modes, and Output Format sections;explorer(codebase mapping),implementer(writes code), andskeptic(single-finding verifier) carry their own task-specific formats instead.omitClaudeMd: true(lets-nobb5): the 14 read-only analysts skip the project'sCLAUDE.mdand.claude/rules/*.md-complianceanddocsRead them as a first step (they audit them),skepticReads them when the finding cites a project rule;implementerkeeps them (it writes code under those rules).TestAgentsOmitClaudeMdpins it. - Agent memory (
memory: projectfrontmatter) is currently disabled across all agents as a workaround for upstream Claude Code issue #55648. Subagents writing memory skip the assigned task and return only a memory-write confirmation. Disabled via PR #47. Tracked via bd taskslets-erx1c(this disable) andlets-rqwdg(restore memory when Anthropic fixes the bug). - Actor meta-agent loads personalities at runtime via internal skill
actor-fetch-personality. Command fetches personality content (curl for URLs, Read for files), user confirms via review gate, actor receives it in prompt asPERSONALITY:block. Fallback "generalist" identity when no personality provided - Agent selection: each command owns its detection/selection logic (different semantics per context). Multi-agent dispatching commands (review, opinion, backlog, plan) show selection panel with cost note before launch. Most agents have explicit PLAN mode for plan review.
- Agents always respond in English - for the analysts this rests on the report-language line in each
## Constraints(they no longer load the rules, seeomitClaudeMdabove). Commands localize output to user's language via LETS Config and Rules. /lets:review,/lets:opinion,/lets:ask,/lets:plan,/lets:backlog,/lets:researchusesubagent_type: "lets:agent-name"to dispatch agents via Task tool (research dispatcheslets:skepticfor its cross-check; its web fetchers are the default subagent, notlets:*)/lets:github-prorchestrates/lets:review(delegates analysis) and handles GitHub posting, follow-up, respond, and approval directly via gh CLI/lets:executeruns a plan inline in native plan mode (EnterPlanMode approval is the code-write gate), or - the Implementers locus - delegates it tolets:implementersubagents through themember-runskill, with an explicit Start gate before any spawn; delegated runs are interactive only, never under--auto. A delegated run keeps ONE persistent implementer (impl-<RUN>) and hands it each next chunk asop=nextwith a brief file.--parallelruns lead-declared, file-disjoint groups in harness-isolated worktrees (isolation: worktree, a guardedgit switch -C {BASE}at spawn only) and lands each chunk throughlets integrate;--pipelinedlets the implementer commit locally and move on, and the closing autosquash needslets worktree pushed=not_pushed(every configured remote is checked) and the owner's yes. Each chunk carriesRisk: high|low(missing = high); the explorer CHECK runs on every chunk and the skeptic on high. The gate policy (per-commit|high-only|at-end; the default followsLETS_GATES-per-commitatstrict,at-endatstandard/minimal, lets-wu2xl - proposed in the Step 4.7 launch plan or set by--gate) decides who accepts and commits, from ONE table in 5-D.5;high-only/at-endend in the 5-D.8 run review before the 5-D.9 completion. Hard stops and deviations halt at once in every policy./lets:checkreviews inline (no subagent) for speed- All analyst agents carry uniform tools
Read, Grep, Glob, Bash, Write, SendMessage- Write only for the oneREPORT_FILEthe dispatching command names through theagent-reportskill (lets-1irms); noEdit;SendMessagefor team routing (lets-q73zt; one definition for every agent, not a team variant - reason recorded on the task). Exception:agents/implementer.mdaddsEdit/Write- spawned only through themember-runskill - by/lets:executedelegated runs (one persistent implementer per group; isolated and pipelined modes commit on their own branch) and by/lets:team spawn implementerin a standing team. /lets:teamis the team-management surface:rungives each task its own worktree and a visible LETS session (a worker) bound to this session through/lets:orc, on any launcher (terminal / cmux / tmux / orca);spawn/dismiss/rostermanage a standing team's members throughmember-run;statusandstopcover runs. The Agent Teams primitives are gone from the harness (no TeamCreate / TaskCreate; the Agent tool's team and mode parameters are ignored), so--backend agentsis refused, never a fallback.--backend orca(lets-ip06f) is the Orca addon inside the sessions backend: offered only withLETS_LAUNCHER=orcaand the app running, it runs each task as a visible LETS session in an Orca child worktree through Orca's supervised orchestration (the coordinator relays questions whole and replies only with the human's words); records carrybackend, and a guard refuses a task an active record of the other backend holds.TestTeamBackendpins the separation. All other commands use subagents for analysis.- The analyst read-only boundary is prompt discipline: identical
## Constraints/## Reporttext in all 14 analysts, pinned byTestAgentReport- and Bash can write regardless. Plugin agents ignorehooks:frontmatter by Claude Code design (documented, not a bug), so no agent-level hook can exist; a plugin-level PreToolUse hook seesagent_typeand could enforce, but only together with Bash - deliberately not built (a Write-only hook guards one of two doors, errors on every Write with an older binary, and adds a fail-closed failure mode). The old read-only hook prototype no longer ships. - Agent report files (lets-1irms). Task-path agents write to
.lets/reports/<run>/<name>.md(one directory per run viaartifact-path kind=reports-<cmd> ext=dir); the final text is only aREPORT_WRITTENpointer.agent-report op=collectclassifies MISSING/EMPTY/UNTERMINATED/UNREADABLE, reads every report in full, retries analysts once and reports gaps;/lets:reviewsaves a## Coveragesection and never ends without its Step 8 file. The implementer keeps.lets/cache/run-...and writes it itself. Members spawned throughmember-runget a REPORT_FILE per round (execute:.lets/cache/run-...; a standing team:agent-reportreports-teamdirectory recorded in the team file). - JSON envelope (
--jsonsubcommands). Everylets <sub> --jsonemits a single JSON object, valid even onok=false(partial-completion:steps[]+ a typederror).SchemaVersionis per-package —initcmd/updatecmd/worktreecmdeach own aconst SchemaVersion, guarded by aTestResult_SchemaContracttest; new--jsonpackages copyworktreecmd's shape. Mechanics + per-subcommand contracts:cli/README.md"## JSON envelope conventions". - Interactive worktrees managed via
/lets:worktreecommand. Hook prototypeshooks/worktree-setup.sh.oldandhooks/worktree-cleanup.sh.old(deferred - caused agent auto-cleanup issues) - Worktrees stored in
.worktrees/at project root -.lets/symlinked for interactive sessions - Trunk-mode — per-task opt-in via the
take-taskpicker ("Stay on current branch"), detected at runtime byHEAD == $LETS_MERGE_BRANCH(no state file — survives compaction). In trunk-mode:/lets:donepushes + closes the task without a PR (same-source-target isn't a valid PR); every.lets/artifact is task-id-named viaartifact-path(so there is no.lets/plans/main.mdcollision);/lets:executesoft-gates instead of hard-refusing on$LETS_MERGE_BRANCH. An exception to the "never edit the merge-branch" rule (seeplugins/lets/rules/lets-rules.md). For quick docs/spec/small-fix work; mutually exclusive with worktree. Implementation:lets-3o9d7. - SessionStart hook invokes
lets hook session-starton every source (startup, resume, clear, compact), emitting an optional## LETS Notice(rules-drift check -lets-rules.mdand the active tracker adapter; in a linked worktree one line with the fix that works there, since/lets:updatenever writes a worktree's rules - lets-5whww), a## LETS Configblock and, for a plain non-EnglishLETS_LANGUAGE, a closing response-language line (lets-xtugk). The workflow rules themselves do NOT travel through the hook — they live in.claude/rules/lets-rules.md(the uncapped project-instructions channel), copied there bylets initand frontmatter-version-tracked. Output mechanics, drift messages, and project-root detection:cli/README.md"## lets hook". - The bash
session-start.shwas deleted along with its yaml→env migration block - lets-p732a closed. - Compaction path (lets-v59n8; verified on Claude Code 2.1.301) — after a compaction Claude Code re-loads CLAUDE.md and
.claude/rules/(InstructionsLoadedload_reason: compact), so the rules survive natively, and SessionStart with sourcecompactre-injects the Notice, LETS Config and the language line. The plugin wires no PreCompact hook: on an auto-compact its stdout reaches only the debug log, and on a manual/compactClaude Code echoes it into the/compactoutput - a second copy of LETS Config.lets hook precompactis a deprecated silent no-op for one release. A bounded stress case of the SessionStart body is pinned under Claude Code's 10,000-character hook cap (TestRun_StressUnderHookCap; over the cap the output moves to a file behind a 2,000-character preview and the closing language line is lost). - User-facing skills: auto-discovered by Claude Code, appear in skill list, trigger on description match. Frontmatter description must NOT use YAML quotes.
- Internal skills: hidden from the user-facing
/lets:autocomplete viauser-invocable: falsein the frontmatter (Claude Code supports this — seecode.claude.com/docsskills frontmatter). The model can still use them when commands explicitly ask; commands invoke them viaSkill(skill: "lets:<name>", args: "..."). Claude Code resolves thelets:namespace regardless of whether the plugin is loaded via marketplace install or--plugin-dirdev mode (no relative-path fragility). No accidental user triggering, no context cost until invoked. Current internal skills:detect-task,actor-fetch-personality,session-snapshot(file-primary shared snapshot used by/lets:endand by the--sessionsnapshot-only flag of/lets:endand/lets:note; renamed frompre-compact-note),session-boundary(the ONE validated reader of a branch's session boundary - resolve, validate, report a trust level - read by/lets:endStep 1 and bysession-snapshot; extracted so the ladder that fixed lets-370mx cannot exist in two drifting copies),orient(shared where-am-I / in-flight / next-up snapshot rendered for/lets:status,/lets:start,/lets:backlog --fast),artifact-path(the ONE resolver for every artifact written under.lets/- plans, reviews, snapshots, per-run report directories - task-scoped name +-vNon collision, lets-05c4s),agent-report(the ONE file transport for agent reports -op=open|add|peek|collect, used by every Task-path dispatcher),member-run(the ONE spawn / next / correct / dismiss path for a named member of anylets:*role; the caller's run record / team file holdsagent_idand dismissals (lets-gbfpd) - the recorded id is the address,ListAgentsonly says busy, andop=route/op=receivepick a member and wait for its report (lets-mpjhc, lets-kwd6e) - model panel for implementers after the Start gate, spawn, SendMessage next brief or correction by file path, attribution by name; used by/lets:executedelegated runs, and the path lets-7dwc1 rebuilds/lets:teamonto),apply-fixes(the ONE definition of--fixfor/lets:check,/lets:reviewand/lets:handoff, and of/lets:review-round's final pass (lets-x5zqv) - the typed flag as write authorization, the verified and nothing-to-decide gates judged before any edit, the scope per mode, stop-and-name on a partial run, never a commit),protocol-trackerandprotocol-orchestrator-offer(the lazy protocol skills - see "Rules layers" above). - Commands define WHAT to do and orchestrate the flow. User-facing skills define full reusable flows (steps, user gates) that auto-trigger on natural language. Internal skills define shared procedures read by commands on demand. Commands delegate to skills for shared operations.
- Gate for new skills: extract only if (a) user-facing with standalone trigger value, or (b) internal logic duplicated in 3+ commands.
Dynamic Workflow Assets (authoring standard)
A LETS command that orchestrates many agents can run them inside a Claude Code Dynamic Workflow (the Workflow tool) instead of the Task tool, so per-agent output stays off-context and only the aggregate enters the conversation. skills/review-workflow/ is the reference example; /lets:review --workflow is the first consumer, /lets:opinion --workflow (the opinion-workflow skill) the second (CONDITIONAL adversarial-challenge stage; reuses the selected lets:* experts as cross-critics), and /lets:backlog review --workflow (the backlog-workflow skill) the third - Review-mode Phase 3 fan-out + Phase 4 aggregate off-context, NO Web Research stage (backlog review grounds in the project's own profile, so omitting web keeps the --workflow path equivalent to the standard Task path), and /lets:research --workflow (the research-workflow skill) the fourth - in-context decompose, then off-context per-sub-question web research (DEFAULT web subagent, not a lets:* agent - they lack web tools) → per-claim lets:skeptic cross-check → synthesize; the citations ARE the output. Mirrors review's find→verify (per-claim skeptic, additive flag-never-drop); the skeptic pass compares each claim against its siblings to flag contradictions (no separate deterministic pass). All opt-in; review/opinion/backlog/research --workflow live. /lets:plan-workflow ships the autonomous planning chain as a standalone PREVIEW command (dogfood across projects before folding into native /lets:plan --workflow - lets-jsw00). A --fast lever runs it lean (~7 agents vs ~15-25; collapse upstream panels + skip the heavy plan-review pass, quick plan-check kept), distinct from native /lets:plan --fast (orchestrator-only, no subagents). All multi-agent fan-out review/ideation commands (review/opinion/backlog/research) now have a --workflow path; /lets:plan's equivalent is the standalone /lets:plan-workflow PREVIEW above.
When a workflow is worth it. A single fan-out that immediately hands back to a user gate is barely more than Task subagents - the workflow earns its keep only with a multi-stage off-context chain (fan-out -> reduce -> verify/judge -> aggregate) with NO user checkpoint between stages. Every checkpoint forces intermediate results back into context and breaks the off-context win. So: want to steer each step -> use Task subagents; want autonomous multi-stage off-context -> use a workflow.
Layout & naming. A workflow ships as a skill folder: plugins/lets/skills/<name>-workflow/ holding <name>.workflow.js (the .workflow.js suffix is the marker) + SKILL.md (user-invocable: false; documents the args contract and states "this is a workflow asset invoked via scriptPath, not auto-triggered"). It is NOT a conversational skill - it is never Skill()-invoked.
Invocation contract. The command builds args, then Workflow({ scriptPath: "${CLAUDE_PLUGIN_ROOT}/skills/<name>-workflow/<name>.workflow.js", args }), then persists the returned aggregate. ${CLAUDE_PLUGIN_ROOT} is substituted at command-load time (the markdown carries the literal path). Script = static logic; args = all per-run data. The workflow runs in the background (returns a runId; the command flow resumes on the completion <task-notification>).
The 6 file sections (canonical order): META (export const meta, pure literal) · ARGS (defensive parse) · SCHEMAS · pure logic · prompts · orchestration -> return.
6 conventions (every workflow file):
- Defensive
argsparse first line:const input = typeof args === 'string' ? JSON.parse(args) : (args || {})(the runtime may deliverargsas a JSON string). agentType: "lets:<name>"to reuse plugin agents - never duplicate an agent's logic in the script.schemawherever structured output feeds aggregation (forces StructuredOutput even when the agent's own format is markdown).- args = dynamic data, script = static logic.
meta.phasestitles match thephase()calls.- Keep-in-sync comment vs the command's prose spec - logic that exists in BOTH a no-workflow path (prose) and the JS lives twice; mark it.
Runtime must-obey (empirically verified - lets-odo4o):
- No filesystem - the script returns data; the command persists files.
- No sibling
import/require- all logic stays inline (await import('./x.js')fails). - No
Date.now()/Math.random()/new Date(). - Top-level
await/returnare used (the runtime wraps the body) - so the file is NOT Node-importable and has no clean unit test. Validate behavior with a live smoke test; verify pure-logic correctness by a deterministic check of a copy if needed. agent({agentType})resolves against the agents loaded at session start - a newly-added plugin agent is unavailable until the next session/reload. Make the script degrade gracefully when an agent can't resolve (e.g. a failed verifier -> keep the finding, flag it; never crash, never silently treat as done).
Model + stage budget (plan-workflow only). /lets:plan-workflow shows a Step 2.5 budget panel before launch and passes model (one model for every spawned agent, via agentOpts) and budget (per-stage caps, via capStage) in args; the script can only lower a stage, clamps each value to MIN/MAX, and reports counts.budget.drops on every return. agent({model}) overriding an agent type's own pin (lets:explorer -> sonnet) is verified live. It stays local to plan-workflow because only plan.workflow.js hardcodes its stage counts - review/opinion/backlog/research already receive their agent lists in args, backlog launches without a gate by design, and review's verify pass must stay mode-independent. Extract a shared budget skill when a second command gets a concrete budget request; planbudget_test.go pins the wiring (every agent( in agentOpts(, every fan-out through capStage(, every return with budget: budgetOut(), a panel row per stage).
scriptPath confirmed to load an arbitrary plugin-path file (not only session-dir scripts). Reusable runtime facts also live in bd memories (key claude-code-workflow-runtime-constraints-*).
Release Flow
Two-phase tag-driven pipeline (bump → review → tag → distribute). The full maintainer ceremony — phase-by-phase commands, prerelease handling, recovery, and the design rationale (why two phases / bash / goreleaser, prerelease CHANGELOG handling) — lives in RELEASING.md (see its ## Rationale for the "why").
Source-tree version invariant: a single semver string spans plugin.json, marketplace.json, and the frontmatter of lets-rules.md + the shipped tracker-{beads,none}.md adapters (tracker-TEMPLATE.md and *.board.md pin 0.0.0 by design; the binary version derives from the git tag via ldflags). Drift between any of these fails verify-versions.yml. Bumped once per release at ceremony time — never per change.
File Storage
All plugin-generated files go to .lets/ (gitignored). Never use /tmp or other external paths.
This includes hook debug logs, temp files, and any runtime artifacts.
WARNING: Always use .lets/ (with dot prefix), never lets/. The dot is easy to miss in manual paths.
.lets/.env # Per-project settings (LETS_LANGUAGE, LETS_MERGE_BRANCH, LETS_PR_FLOW, LETS_TRACKER, LETS_LAUNCHER, LETS_RULES_SCOPE, LETS_LAUNCH_MODE, LETS_GATES)
.lets/.env.example # Reference defaults — generated each `lets init` from canonical letsconfig.Keys defaults via renderEnvExample(). Not used by the hook; it's a user-facing template
.lets/.env.bak # Single backup written by `RegenerateEnv` before mutation. Plugin-owned: user-created files at this path are silently overwritten — copy elsewhere for permanent backup
.lets/sessions/ # Session snapshots `{date}-{HHMM}-{task-id|branch-6hex}-snapshot[-vN].md` (file-primary ## RESUME via session-snapshot; path from artifact-path - legacy `{TS}-{branch}.md` files stay, readers fall back to them); .task-<slug> state file (task/start/session boundaries, validated cache - lets-dsdmp; written only through `lets worktree task-state`, and may carry `origin: branch|dir` until the first claim and `orc:` - a worker chat's orchestrator binding, never on the merge-branch; `session_proof: <sid> <pid> <started-ms>` - the process that held `session:`, written only by Go beside every Go `session:` write, the proof a `/clear` carry needs (lets-gbfpd)); .review-restore-<session-id> (PR-mode branch/stash restore - fields `ref:`/`pr:`/optional `stash:`; session-keyed so parallel worktrees never share it; kept on any non-clean outcome, and globbed by the review gate + `/lets:start` so a stray is surfaced rather than stranded)
.lets/reviews/ # Saved review reports `{date}-{HHMM}-{task-id}-review-{local|branch|pr-N|plan}[-vN].md|json` (path from artifact-path, lets-05c4s)
.lets/plans/ # Implementation plans `{date}-{HHMM}-{task-id}-plan[-vN].md` (path from artifact-path), and idea documents `{date}-{HHMM}-{task-id}-idea[-vN].md` from `/lets:plan --idea` (never picked up by `/lets:execute`). EVERY artifact writer goes through `skills/artifact-path` - `.lets/` is one symlinked dir shared by all worktrees, and a hand-built `{date}-{kind}` path overwrote another session's file (lets-05c4s)
.lets/handoffs/ # Hand-off briefs `{date}-{HHMM}-{task-id}-handoff[-vN].md` (artifact-path) and their siblings: `-report.md`, `-events.jsonl`, `-stderr.txt` (lets handoff), `-agent-report.md` / `-agent-report.done` (the receiving agent, --send). 0600, never overwritten
.lets/cache/peer-msg/ # <msgid>.txt - transient v0.10.0 peer-message handoffs (0700): created by the deprecated `lets peers frame`, consumed by the deprecated `lets peers tell` (removed next release)
.lets/sessions/peers/last/ # <hex of the name>.last - last-seen session / pid / scope of an orchestrator, one file per name, refreshed by every `lets peers who` / `orchestrator` for live orchestrators; read by /lets:hub wake and ask-ro
.lets/cache/ask-ro-mcp-empty.json # {"mcpServers":{}} (0600) - the empty MCP config `lets peers ask-ro` launches with
.lets/sessions/peers/ # <session-uuid>.role - legacy files an older binary wrote, never read or written (the /clear proof is the task-state session_proof: key, lets-gbfpd); the dir holds last/ (above)
.lets/execution/ # Execution state (PR review: pr-{number}/, team run records: team-*.json; members-<scope>.json - the retired `lets members` registry, legacy, never read or written (lets-gbfpd))
.lets/reports/ # Agent reports - one directory per dispatching run `{date}-{HHMM}-{task-id}-reports-{command}[-vN]/{name}.md` (agent-report skill, path from artifact-path); kept, never cleaned; input to the command's own artifact, never the deliverable
.lets/teams/ # Standing-team files <callsign>.md (from plugins/lets/templates/team.md via `lets worktree team-init`, never overwritten; Go reads only `worktree` + `git_dir` + `lead_name` + `agent_command` / `orca_agent`) and the team's own notes
.lets/hooks/ # Optional project hooks: team-setup (run on the owner's yes when a team worktree is created or reopened; fills the team file's Workspace) and team-teardown (on the owner's yes at disband)
.lets/cache/ # Cached data (usage stats; update-check.json — /lets:update latest-release lookup, 1h TTL; task-status — rich statusline task cache id|title|notes|iso, self-refreshed via detached bd show, 90s TTL; pipeline-state-<task-id> — autonomous-pipeline phase marker <id>|<phase>|<iso>, per-task so parallel worktrees don't clobber, written by plan-workflow/execute --auto; released-<task-id> — `lets worktree release` marker `<id>|<branch>|<iso>|dirty=|unpushed=`, read by `/lets:start --main` Reopen; delegated-run-<task-id>.json — a delegated /lets:execute run record; chunk-/correct-/run-* — its briefs, amendments and reports; member-<callsign>-<name>.md — a standing-team member's spawn brief; integrate-<run>-<chunk>.patch — `lets integrate`'s staged patch)
# Worktrees (outside .lets/ to avoid circular symlinks):
# .worktrees/ # Interactive worktrees only (agent worktrees use native Claude Code behavior)
# .lets.pre-adopt[-N]/ # At a worktree root: a cache-only real .lets that `lets worktree adopt` moved aside (safe to delete)
# <git-common-dir>/lets-integrate/ # `lets integrate` temp worktrees <run>-<chunk> + their <run>-<chunk>.owner markers (removed with the worktree)Workflow rules live OUTSIDE .lets/ because they belong to Claude Code's project-instructions channel:
.claude/rules/lets-rules.md # Workflow rules (copied from plugin by `lets init`, frontmatter-versioned, customizable - tracked in git per project's choice)
.claude/rules/tracker-<name>.md # Active tracker adapter - plugin-MANAGED like lets-rules.md (installed/cleaned by `lets init`, synced by `/lets:update`); NEVER edit the installed copy
.claude/rules/tracker-<name>.board.md # Board profile - USER-OWNED (scaffolded once, never overwritten); edit freely; gitignored when it holds private board dataUser-scope install adds two machine-global files:
~/.claude/rules/lets-rules.md # Global rules — first written by `lets init --user`, then a cache of the running plugin kept by the SessionStart hook (rulescache; a hand-edited copy is saved to .bak[-N] first); /lets:update only reports it
~/.lets/cache/rules-cache.json # rulescache key: sha256 + version + source path of what was written; + rules-cache.lock
~/.lets/.env # User-level defaults (LETS_LANGUAGE + LETS_LAUNCHER only); project .lets/.env overrides per key; + ~/.lets/.env.bakNEVER edit .claude/rules/lets-rules.md (or ~/.claude/rules/lets-rules.md) directly. They are installed copies, plugin-managed. Only the canonical source plugins/lets/rules/lets-rules.md is edited. The project copy is rewritten by /lets:init / /lets:update (and only via those plugin-managed paths) when the plugin's frontmatter version is bumped — this dogfoods drift detection live; the global copy is rewritten by the SessionStart hook whenever its content differs from the running plugin's (lets-tg008). Workflow: edit source -> bump source version (at release ceremony) -> commit -> release -> end user (or maintainer) runs /lets:update (or /lets:init) -> installed copy refreshed. Editing an installed copy directly bypasses drift testing and silently desyncs from source.
Naming Convention: LETS_*
All plugin configuration uses the LETS_* prefix (UPPER_SNAKE_CASE). The prefix removes ambiguity in command instructions - LETS_PR_FLOW=github is unambiguously a parameter, while github could be the platform name.
LETS Config keys
| Key | Source | Purpose |
LETS_PROJECT_ROOT | Auto-injected by SessionStart hook | Absolute path to project root |
LETS_LANGUAGE | .lets/.env (falls back to ~/.lets/.env) | Default response language |
LETS_MERGE_BRANCH | .lets/.env (falls back to the repo's origin default branch, else main, when unset) | Target branch for merges and PRs; a new branch is cut from its remote copy (<remote>/<merge> after a bounded fetch, lets worktree base), from the local branch only when no remote is configured (lets-qjt3h) |
LETS_PR_FLOW | .lets/.env | github | bitbucket | local - which PR workflow to use |
LETS_TRACKER | .lets/.env | Task tracker adapter: beads (default) | none. Selects the one .claude/rules/tracker-<name>.md that lets init installs (one-adapter-file platform, lets-5d48z). none supersedes lets-nwwkj; the verb-resolution rule lives in the internal protocol-tracker skill (was lets-rules.md "Tracker Adapters"). See docs/trackers.md |
LETS_LAUNCHER | .lets/.env (falls back to ~/.lets/.env) | Worktree launcher: terminal (default - print cd … && claude) | cmux (cmux workspace via lets cmux, macOS only) | tmux (tmux window/session via lets tmux, Linux + macOS) | orca (Orca worktree via lets orca; the switch for every Orca integration: launcher, card status, /lets:hub, the team orca backend). A preference, not a guarantee - each falls back to terminal (orca: to cmux, then terminal) when its binary/platform is absent. Validated against a whitelist pinned to the registered subcommands (lets init --launcher=<unknown> is rejected) |
LETS_RULES_SCOPE | .lets/.env | Where this project's workflow rules come from: project (own .claude/rules copy - default) | user (deliberately no project copy; rules from the global ~/.claude/rules). /lets:update reports delegated instead of re-creating a user-scoped project's missing copy. Fail-safe: any value other than user is treated as project. NOT injected into subagent context (project-only, like the others) |
LETS_LAUNCH_MODE | .lets/.env (falls back to ~/.lets/.env) | How the sessions LETS launches (workers, a team's lead) start: default (plain claude) | auto (--permission-mode auto) | all-in (--permission-mode bypassPermissions). Empty means default and stays unset - LETS never writes a value on its own (a regen keeps it empty, so the ~/.lets/.env value applies and /lets:start --main reminds); a --launch-mode / --auto / --all-in flag on /lets:worktree create or /lets:team run beats it. all-in only when the owner sets it or types the flag - never a fallback; set it to the class your orchestrator runs in (lets-d3wu3). A separate axis from LETS_GATES: the launch mode is the harness permission class, never LETS approval |
LETS_GATES | .lets/.env (falls back to ~/.lets/.env) | Which actions ask the owner first - LETS's own questions: strict (every commit and confirm, as before) | standard (default - irreversible or outward only: the core ## Gates table) | minimal (as standard, except a push / PR outside /lets:done asks only for the merge branch or another task's branch, and the task's own green PR merges inside /lets:done). Implicit default like LETS_LAUNCH_MODE (a regen keeps it empty); letsconfig.ResolvedEnv normalizes empty / unknown to standard before the hook injects it, and an unknown raw value gets a Notice. Written only by /lets:init (--gates) or the owner's edit; a session that lowers it hits a hard stop (lets-wu2xl) |
User-level fallbacks: the hook overlays ~/.lets/.env UNDER the project .lets/.env (project wins per key; only non-empty project values mask).
Surface forms - where to use which form
The same LETS_FOO value appears in different surface forms depending on context. The orchestrator (model) handles substitution; subagents do NOT receive LETS Config injection and need explicit substitution before Task() launch.
| Surface | Form | Resolved by | Applies to |
| Bash block (model executes via Bash tool) | LETS_FOO=$(...) then $LETS_FOO | local shell - assign at top of every block (each Bash call is a fresh shell) | only LETS_PROJECT_ROOT (computable in-shell via git rev-parse) |
| Bash command snippet inside markdown (template the model runs) | {LETS_FOO} placeholder | orchestrator substitutes literal value before running | all keys EXCEPT LETS_PROJECT_ROOT (which uses bash assignment instead) |
AskUserQuestion option label/description/question text | {LETS_FOO} placeholder | orchestrator substitutes literal value before tool call | all keys |
| Orchestrator prose, section headings, code comments | $LETS_FOO | orchestrator reads from injected LETS Config (reference only, never displayed) | all keys |
| Subagent prompt template | {LETS_FOO from LETS Config} | orchestrator substitutes literal before Task() call | all keys |
Important note on LETS_PROJECT_ROOT: the value injected in ## LETS Config is for prompt-text reference and orchestrator substitution - it is NOT a shell variable available in Bash tool calls. Every bash block that uses the project root path must assign locally:
LETS_PROJECT_ROOT=$(git rev-parse --show-toplevel)
mkdir -p "$LETS_PROJECT_ROOT/.lets/sessions"LETS_PROJECT_ROOT is the only key computable in-shell (via git rev-parse). Other LETS_* keys (LETS_MERGE_BRANCH, LETS_PR_FLOW, LETS_LANGUAGE, LETS_TRACKER, LETS_LAUNCHER, LETS_RULES_SCOPE, LETS_LAUNCH_MODE, LETS_GATES) have no shell-side derivation - inside bash snippets, use the {LETS_FOO} template form so the orchestrator substitutes the literal value before running. Trying to use $LETS_FOO in a bash block (without local assignment) yields empty string - silently wrong commands.
User config file
.lets/.env is KEY=VALUE format with comments above keys (NOT inline - inline comments would pollute the model's context after the hook strips full-line comments). Migrated from legacy config.yaml to .env by lets init (cli/internal/initcmd/migrate.go::MigrateYamlToEnv). The yaml→env auto-migration in the SessionStart hook has been removed (lets-p732a closed). Legacy yaml deprecation removal tracked in lets-q8xtk.
NOT FOR SECRETS. The SessionStart hook injects the file's whitelisted LETS_* values into model context every session. Tokens, passwords, and API keys belong elsewhere: gh auth login for GitHub, OS keychain for general secrets, tool-specific credential files (e.g. .beads/.env for beads). The whitelist filter in cli/internal/hook/sessionstart/sessionstart.go calls letsconfig.Names() to get the canonical LETS_* keys, so unknown keys are filtered - but file mode is 644 (world-readable on disk), so secrets in .env would still be exposed locally. Do not add secret keys. The same applies with a strictly larger blast radius to the user-level ~/.lets/.env - it is injected in EVERY project the user opens.
Adding a new config key
Single source of truth: cli/internal/letsconfig/keys.go::Keys (canonical metadata) and cli/internal/initcmd/render.go::Prefs.AsValues() (Prefs↔Key wiring). The full step-by-step recipe — Keys entry, Prefs field, cobra flag, init.md AskUserQuestion, what's auto-derived, what to document — lives in CONTRIBUTING.md ("### Adding a new config key").
Dependencies
- beads plugin (task tracking)
When Adding/Modifying Commands, Skills, or Agents
Rules-file rule: edits go ONLY to plugins/lets/rules/lets-rules.md (the canonical source). NEVER touch .claude/rules/lets-rules.md (installed copy) — that file is refreshed exclusively via /lets:init or /lets:update after a source bump. This is intentional: we eat our own dogfood for drift detection.
Unreleased-features rule: don't document [Unreleased]-only features in this file as if they already shipped. If you describe a feature that isn't in a tagged release yet, tag it (ships in vX.Y) (or (merged; ships next release)); drop the tag at the release ceremony when the version moves forward. This avoids the trap QA hit on v0.5.0 — descriptions of features that lived only in [Unreleased] CHANGELOG read as available, sending testers down dead-end paths.
Full file-sync checklist, the Response Footer / LETS box output spec, and the per-command checklist live in CONTRIBUTING.md ("## Editing commands, skills, agents, config keys"). Modifying a command/skill/agent? Read it — it names every file that must stay in sync: the Skill Quick Reference in CONTRIBUTING "## Rules layers" (plus the core flow table when a phase changes), every agents/*.md ## Constraints line, the /lets:install skill tables, README.md, the end.md/done.md session-id channels, and the Go-subcommand wiring.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

