Hooks, a brain MCP server, scripted gates and test tools for the lean-agent skills.
lean-agent-tools is a Claude Code plugin that adds the parts of lean agent that run by themselves: hooks that note (and in the strict profile block), the brain database and MCP server, scripts on the agent's PATH, and the test queue. It needs the lean-agent skills plugin, which holds the method, the adversarial review, the ticket shape and the retro as plain Markdown. The tools skill in this plugin maps each plain step in those skills to the tool here that does it.
The default is the standard profile: hooks give a note or say nothing instead of refusing. Three things still block: a real key in a file Claude writes (when the scanner runs), the opt-in LEAN_LOOKUP_MODE=block and LEAN_IMAGE_MODE=block, and the git hooks you install. Set LEAN_PROFILE=strict for the full set of blocks. See Profiles.
The numbers here are mine, at list prices, on one .NET codebase. Treat them as a shape, not a benchmark.
Install both plugins:
/plugin marketplace add arnelirobles/lean-agent
/plugin install lean-agent@lean-agent
/plugin marketplace add arnelirobles/lean-agent-tools
/plugin install lean-agent-tools@lean-agent-toolsThe same from a shell:
claude plugin marketplace add arnelirobles/lean-agent
claude plugin install lean-agent@lean-agent
claude plugin marketplace add arnelirobles/lean-agent-tools
claude plugin install lean-agent-tools@lean-agent-toolsNothing else is needed. In the standard profile the hooks do not refuse your commands for style or workflow: a bad commit message, a direct npm test or a sleep loop gets a short note or nothing. LEAN_PROFILE=off turns every hook off.
Without a brain database or a test queue, the skills in lean-agent still work on their own: /lean-agent:shape-ticket and /lean-agent:adversarial-review need only git and gh.
lean-stats collects on its own: when a session ends, the SessionEnd hook starts lean-stats collect --transcript for that session and its subagents in the background. It never blocks the hook, and LEAN_STATS=off stops it. Each run stores counts only (no prompt, code or command text): peak context, turns over 80k, read-only lookup calls, image results, errored tool results and wait-loop calls. lean-stats report turns them into an Avoidable section. Each signal shows its share of the period's tokens and list price, and Haiku's share of runs is shown against the share of runs the method gives it. A turn counts toward a signal in whole, so the shares overlap and are an upper bound. Lookup calls are the coordinator's on Opus only. The next lean-stats collect reads a file again when any of its runs has no signals, so runs from an older lean-stats fill in; until then they are left out, not counted as zero. The fast model row is named after LEAN_MODEL_FAST.
While a session runs, a hook tells the coordinator when it is costing the most. Once context passes LEAN_CONTEXT_WARN it adds a note on every turn: the size, what the turn costs at list price, the running total since it passed the threshold (a lower bound, since turns without a tool call are not counted), and to /compact or file what is open in brain and start a fresh session. After LEAN_LOOKUP_WARN read-only lookups by an Opus coordinator in one session it adds one note to send them to lean:search on the fast model. Right after each compaction it checks the size against the next auto-compaction (CLAUDE_CODE_AUTO_COMPACT_WINDOW less about 33k, the gap measured on 1,633 compactions, or a 200k model window less the same when it is not set). When less than LEAN_COMPACT_ROOM is left for work, it says so once, to the coordinator and to you: that is how "Autocompact is thrashing" starts, and only you can raise the window or turn off plugins and MCP servers. Above LEAN_IMAGE_CONTEXT tokens it adds one note per turn after an image result (a Read of a png, jpg, jpeg, gif or webp file or of a pdf with pages, or a tool with screenshot or thumbnail in its name). Subagents never get a note or a refusal. Notes block nothing. Two settings turn them into refusals (exit 2 from a PreToolUse hook): LEAN_LOOKUP_MODE=block refuses the next Grep, Glob or Bash grep, rg, find or cat once an Opus coordinator has made more than LEAN_LOOKUP_WARN lookups since it last started an Agent. Read, ls and git or gh state checks count but are never refused, since an Edit needs a Read first and a state check is not a search. Starting an Agent resets that count; the note mode's count is per session and its note fires once, and LEAN_IMAGE_MODE=block refuses the image tools above LEAN_IMAGE_CONTEXT. Only searches already counted as read-only lookups can be refused, never a Read, a state check or a write. The counters live in ~/.lean/context-cost (next to the database, private to you) and stay when a session is resumed, so a resumed session keeps its lookup count and does not repeat what it was told.
The method (tiers, the cascade of models, the critic, the retro) lives in the lean-agent skills plugin: github.com/arnelirobles/lean-agent, with the full write-up in its wiki. This plugin supplies the tools those skills point to. Which model plays which role is set under Settings.
lean-agent-tools is installed next to lean-agent, not instead of it. See Quickstart for both. Update with claude plugin update lean-agent-tools@lean-agent-tools. Claude Code picks up a change only when the plugin version moves.
| Part | What it does | Reference |
|---|---|---|
tools skill |
Maps each plain step in the lean-agent skills to the tool here that does it. The agent loads it with the lean-agent skills. You do not call it. | skills/tools/SKILL.md |
Scripts in tools/ |
Preflight, holdout, needs-review, cost, hygiene and more. Each has a --self-test. Holdout claims one hunk per binding (edits with no context between them count separately), uses HOLDOUT_BASE or the remote default branch, treats every changed file that is not a test, doc or lockfile as production, and takes space-separated HOLDOUT_PRODUCTION and HOLDOUT_NOT_PRODUCTION globs. |
Scripts |
test-phase |
Drains the test queue in brain through heavy.sh with a stall watchdog, one drainer at a time. Takes a plan file too (one project per line). Sorts failures into flaky and real, logs every command as a run, and writes the failures to brain. |
The cycle |
brain |
A local SQLite list of open failures, deferred minors, questions, blockers, running agents and next steps, plus the test queue, with tags, runs and stats. brain resume prints what is open for a project, and brain digest a 2 KB summary of it (counts, blockers, questions, running jobs, stale agents). |
The cycle |
brain-mcp |
An MCP server (the plugin registers it as brain) that gives a session eleven tools over the brain database: brain_list (open items, newest first, 50 lines unless limit says otherwise), brain_show, brain_add, brain_close, brain_queue_list (queued and running unless status says otherwise), brain_queue_add, brain_queue_cancel, brain_queue_bump, brain_queue_route, brain_digest and brain_stats. It runs the brain CLI, sends a body on stdin, and does not expose queue next or queue finish, which only the drainer uses. |
The cycle |
vscode/ |
The Lean Brain VS Code extension: a read-only dashboard, status bar and trees over the brain database. Build it with npm run package in vscode/. |
vscode/README.md |
| Hooks | In the strict profile these block (attribution and slop in public text, a bad commit author, files in a scratchpad root, background shells, sleep loops, direct test runs, keys and tokens in a commit, push or written file); in standard only a key in a written file blocks. The rest add a note and never stop the call. One of them hands the session a brain digest for its project at startup and after a compaction. Each has an off switch. |
Hooks |
lean-stats |
One local SQLite file of tokens, reviews, merges and hook fires. Nothing leaves the machine. | Measure every batch |
tools/credit-run runs one brief as a headless Agent SDK job paid by API credits, and tools/credit-batch sends single-shot briefs at batch prices, so a person on a subscription can spend credits without changing how they sign in. Setup, settings and limits are under Jobs on API credits below. Edit and Write are limited to the worktree and denied in git metadata, but an edit job is not a sandbox: the key is scrubbed from Bash and hook environments, yet git commit still runs the repository's hooks as you, so run jobs only in a repository you trust. The tool's cost figure does not prove which balance paid.
The lean-agent skills work without this plugin. Without it, run the scripts from tools/ by path (for example tools/holdout.sh).
Code everything first, with builds only. Then run one test phase, load balanced. Failures go to brain. Then one fix round.
brain queue add ~/repos/app tests/App.Tests/App.Tests.csproj --cycle c1 --by me # prints the job id
brain queue add ~/repos/app tests/Api.Tests/Api.Tests.csproj --after 1 --cycle c1
test-phase # drains the queue; start it once, as a background task
test-phase plan.txt # same, after enqueuing the plan (<repo-dir> <test project path> [fast-filter])
brain list --cycle c1 # what the phase found
brain list --open # what the fix round works from
brain close 12 --resolution fixed --commit abc1234
test-phase # again, to see the list empty
brain stats # flaky rate, lane wait and duration per test projectThe scripts live in the plugin's tools/ directory. At session start the plugin appends that folder to PATH in $CLAUDE_ENV_FILE, once per session (a resume after an upgrade adds the new version's folder), so a bare brain or test-phase works in the session's shell and the hooks' notes use bare names. PowerShell reads the file only when every line is a plain assignment, so a PowerShell command loses the LEAN_SESSION_* variables because of the PATH line. Where CLAUDE_ENV_FILE is not set, the notes keep the absolute path, and in a skill or hook you can call ${CLAUDE_PLUGIN_ROOT}/tools/brain list. In your own shell, put the folder on PATH in your profile, for example export PATH="$(ls -d ~/.claude/plugins/*/lean-agent/lean-agent/*/tools | sort -V | tail -1):$PATH" (it picks the newest installed version each time a shell starts), or symlink the tools you use into a folder already on PATH.
Upgrading from 1.15.0 or earlier: bin/ is gone. Anything you scripted against bin/<name>, or against the old bare names that Claude Code put on PATH, needs the tools/ path. Permission allow rules that name a bare tool, such as Bash(brain:*), stop matching and need the tools path. The brain MCP server and the hooks move on their own.
Nobody waits in a loop. A session adds jobs with brain queue add (it returns at once) and ends its turn. The orchestrator starts one test-phase as a background task and gets one notice when it exits. test-phase takes the oldest job whose --after job is done, runs it, records the run and the failures, and repeats until nothing is ready. A second test-phase while one drains says so and exits 0. A job whose dependency failed or was cancelled is cancelled with the reason. brain queue list and brain resume show queued and running jobs; brain queue cancel ID drops a queued one. brain queue bump ID moves a queued job, and the queued jobs chained after it with --after, to the front; the last one bumped runs first, and the list marks bumped jobs bumped. brain queue move ID up or down swaps a queued job with its neighbour in run order, and refuses to put a job ahead of the job it waits on. brain queue list --status queued lists jobs in the order they will run. Adding a job that is already queued (same folder, project, filter, tier, --after and arguments) prints the queued job's id instead of adding a second, so agents that ask for the same run share one build. A fast filter can name several classes joined by |, for example --filter 'OrderTests|InvoiceTests'; test-phase passes one --filter-class per class under MTP (xunit v3 runs the union of repeated ones) and one FullyQualifiedName~ term per class under VSTest. Under MTP it then lists each class alone, and a class that matches no test fails the job and is named, since the union hides it while another class matches.
Gradle: a test path that is a settings.gradle.kts or settings.gradle, or the folder holding one, is a Gradle job (named by its folder). test-phase runs only the repo's own ./gradlew with --console=plain --continue --no-daemon, default task check; --args="jvmTest iosSimulatorArm64Test" names other tasks. --rerun follows every test task so an unchanged tree still runs its tests, and the fast filter becomes --tests on each test task. A rerun of a failed class uses the task that wrote its results, even under check. Only task names and these options are accepted in --args: --tests, -x, --rerun, --rerun-tasks, --info, --warn, --quiet, --stacktrace, --offline, --continue, --dry-run, --max-workers, --warning-mode, --build-cache, --parallel, --fail-fast and --refresh-dependencies; -P, -D, -I, -g, -c, -b, --include-build and the rest are refused. The child gets an allowlisted environment (PATH, HOME, USER, JAVA_HOME, ANDROID_, LC_, GRADLE_OPTS and JAVA_OPTS without -Dorg.gradle.project.*, and a few more), so tokens, passwords and signing keys in the shell never reach the build. Results come from build/test-results/**/TEST-*.xml written during the run. A run with no passed or failed test is reported as ran-no-tests (skipped tests do not count; a test task that Gradle reports UP-TO-DATE or FROM-CACHE keeps its earlier results, which are read as they are), and a failing non-test task is a run-failed item that names it. Any output line counts as progress, and a Gradle job's default stall is 3600 s (--stall or TEST_PHASE_STALL overrides it). The job stays on the local lane (route --to remote|any and --platform none are refused), and an iOS test task makes it Apple-only. Gradle still reads ~/.gradle/gradle.properties and ~/.gradle/init.d on the local lane, so signing keys belong only in the environment of the publish script.
Go: a package pattern such as ./... or ./cmd/x in a repo with a go.mod is a Go job: go build, then go test -json, with the fast filter as -run (| stays regex alternation). A -run that matches nothing counts as ran no tests. The job stays on the local lane.
Remote lanes: list SSH hosts in ~/.config/lean/remotes.ini and test-phase runs one job per host at the same time as the local lane, in a capped docker container on the host. Apple-platform test projects and npm projects with a private registry in .npmrc stay local. A lost connection puts the job back in the queue, not in brain as a failure. The host keeps one build folder per repository, commit, hash of the copied files and contents, image and build arguments: the first job on that key copies and builds, later jobs skip both and run dotnet test --no-build there, and a new commit or any changed file builds again. The newest 3 folders per repository stay (build_keep); reuse_build = no in the [remote ...] section goes back to a fresh folder and build per job. Setup, the copy rules and cleanup are in docs/remote-lane.md.
Activity from other tools, such as BaryoVM, goes into brain with brain activity add or brain activity import-baryovm, and shows on the dashboard Activity tab. Commands and the line format are in docs/activity.md.
test-phase runs every command in the dotnet lane of heavy.sh, so sessions on one machine take turns instead of loading Docker together. It stops a command that shows no test progress for HEAVY_STALL seconds (exit 76, "likely load, not code"). Progress is a Microsoft Testing Platform counter line ([+passed/xfailed/?skipped]) whose counts changed, or a passed or failed result line, so a repeating counter where only the elapsed time moves does not count. It reruns each failing class alone, and labels the test flaky if it passes alone and real if it fails again. Ask whether a lane is free with heavy.sh status dotnet, never with a pgrep loop: the loop matches its own command line and never ends.
A job holds its lane from its full run to its last rerun. A command ended by a signal is recorded as killed, files nothing, and the job is queued once more. A run that adds only failures for --fail-stall seconds (default 1200) is stopped as stalled-failing (exit 78). Stall notes carry the passed and failed counts and the last test seen. A local .NET run also gets a hang timeout 60 s under --stall (half of it when --stall is short), so the test host names the tests still running before heavy.sh stops it: --blame-hang-timeout on VSTest, --hangdump --hangdump-timeout on Microsoft.Testing.Platform. The MTP flags are added only when the project file, a Directory.Build.props or .targets above it, or a Directory.Packages.props above it has a PackageReference or PackageVersion whose name contains HangDump, or sets a HangDump property to true; a comment or other text mentioning it does not count. The VSTest hang timeout is per test, so a single test that runs longer than it is dumped and the host is killed, even while other tests pass. To make the hang timer and the stall clock start together, the project is built first (dotnet build) and the tests run with --no-build. If the extra arguments already set --results-directory, a logger, a collector, --settings, --blame or --diag, or include an argument dotnet build does not take, the hang arguments are left off and the stall note says so. VSTest hang detection was checked against a real hang (SDK 10.0.103: the Sequence file and a mini dump land in a GUID subfolder of the results folder, and the output also says the host crashed, which does not stop it being read as a hang). Microsoft.Testing.Platform hang detection is unverified: with xunit.v3 3.0.0 and HangDump 1.8.0 the extension never fired in a 200 s capture at a 30 s timeout, so the MTP output format is a guess, and the MTP hang arguments go before -- because the SDK rejected --results-directory after it. A run counts as a hang only when the hang timer fired (a dump file in the results folder, or the hang line in the output); a crash that leaves a Sequence file is a crash. A hung run is recorded as stalled even when its exit code is 1. A failing class that hangs when rerun alone is filed as a hang and its failures are unverified, not flaky. Each named test is filed as a test-fail tagged hang that says it hung, instead of a stalled: note. A test that hangs on a second run is also tagged hang-repeat: that is a hang, not load. The dump is written under the run's log directory and deleted once the names are read. When no name is found (no package, a remote lane, TEST_PHASE_HANGDUMP=off, a dump with no names) the stalled: note stays and says why. When more than --isolation-over tests (default 10) fail in one run and all pass alone, one isolation item lists them instead of flaky items. A test that fails in a full run and passes alone again on the same branch and test project becomes a test-fail tagged order-dependent. brain flaky-clear closes a flaky item with no new occurrence in 5 passing unfiltered full runs of its test project as flaky-cleared (runs carry no branch); a passing full run calls it. A job killed twice fails with a killed twice note.
A rerun is flaky only when it exits 0 or passes tests without the name; a rerun that proves nothing is unverified. A job whose failures are all flaky finishes done, so its dependents run. Extra dotnet arguments come from TEST_PHASE_DOTNET_ARGS, an args=EXTRA field on a plan line or brain queue add --args=EXTRA, for example -p:ValidateXcodeVersion=false for Mac Catalyst desktop tests. The brain project of a job is the main repository's name, so worktrees share it. Secrets in test output (passwords, bearer tokens, JWTs, api keys) are masked before they reach brain.
Test prerequisites: a repository can list what its tests need in .lean/test-needs, one per line: docker (the daemon answers docker info), path ../sibling (a folder or file exists, relative to the main checkout, the folder holding .git, so a worktree job looks in the same place), env NAME (set and not empty; the value is never printed), command NAME with an optional gnu or >=22.11 (on PATH, and NAME --version says GNU or is at least that). # starts a comment, also at the end of a line, and an unknown line counts as a missing prerequisite. Before a local job starts, test-phase checks the list and runs check-runtime.sh on the repository (--doctor does the same, and both skip everything when the file is absent). If anything is missing the job fails with each missing piece named, a blocker item goes to brain, and no test runs, so nothing lands as a test-fail. test-phase --doctor [DIR] runs the same checks alone and exits 1 when something is missing. A later passing full run of that test project closes the blocker. Nothing is installed. Remote lanes skip the check, since the files and variables it reads belong to this machine. Without a .lean/test-needs file nothing is checked before a run.
Environmental runs: when at least 3 failures in a run, and more than half of them, come from the machine (DockerUnavailableException, the Testcontainers ResourceReaper failing to start, Npgsql Failed to connect to; the causes are added together), test-phase files one blocker for the run with a count per cause instead of one test-fail per test. Those tests are not rerun, so none of them can become a flaky item. A run of 1,800 Docker failures is one blocker and no test-fail items. Other failures in the same run are filed as unverified and worded as not rerun. A remote lane rests after such a run, like after any lane problem. A passing full run closes the blocker.
Waiting without polling. brain queue wait ID... blocks until every named job ends and prints one line per job: id, status, passed and failed of its run, and the brain item ids the run filed. It exits 0 when all are done, 1 when any failed or was cancelled, 2 for an unknown id and 3 on --timeout (default 7200 seconds), printing each job still pending and its state, so a job no lane ever took shows as queued. It reads the database every 15 seconds (--interval). pr-wait <pr> [--repo R] does the same for a pull request's checks: exit 0 and one line when green, 1 with the failed check names and the last 40 lines of each log (after any known environmental cause why-red.sh finds) when red, 3 on timeout. pr-wait --provider azure <run id> --org O --project P waits for one Azure Pipelines run. Without --provider it follows the origin URL of the current folder, and GitHub when that says nothing. On an Azure origin the target is a pipeline run id, not a pull request, and the first output line says which provider and target it is waiting on. Zero checks reported yet (right after a push) counts as pending, a poll that fails is retried until the timeout (the last error goes in the timeout line) or until --max-errors polls fail in a row (default 5, exit 2), and a check or run that ends in anything but success, partiallySucceeded included, counts as failed. A failed check with no Actions log prints its link. --interval and --timeout are at least 1 second. A timeline or log call that az refuses prints its exit code and first stderr line to stderr, and the Azure log fetch (az devops invoke --out-file) is unverified against a live Azure DevOps organization. Start either with run_in_background and end the turn.
Adding a hook. Write hooks/<name>.py with a HOOK literal that lists its events, matcher, group, order and timeout, then run tools/lean-agent build. It regenerates hooks/hooks.json and hooks/dispatch.json from every hook file; commit both. tools/lean-agent build --check fails when they are out of date, and tests/run-all.sh runs it.
Adding a pr-wait provider. A provider is one class in lib/forge.py with label, checks() (one CLI call, returns checks with a name and a state of pass, fail or pending) and failed_log(check, tail), taking its CLI options in the constructor and a capture(argv) function for the CLI call. Register it in CI_PROVIDERS under the name kind_of returns, and add <name>_ci_test next to github_ci_test in the same file: a fake CLI in a temp folder on PATH, no network, and a check that the other providers' tools are never called. The interface is written out in the forge.py docstring.
Add a code host. Every script and hook reaches a host through lib/forge.py (reads) or the command table in lib/hookkit.py (the commands hooks recognise). The host comes from the origin URL (gitlab must be a whole label of the host name, so gitlab.mycorp.com is GitLab and mygitlabfoo.com is unknown), or from LEAN_FORGE=github|gitlab|azure. tools/orient and hooks/review-log-check.py read through the same module; if forge.py cannot be imported the hook still handles gh. User info in a remote URL is dropped before anything is printed, and an Azure remote prints as https://dev.azure.com/ORG/PROJECT/_git/REPO. A host whose CLI is not installed gives one line naming the CLI and exit 2. To add one:
- Provider class in
lib/forge.py, next toGitHub,GitLabandAzure, withmerged_prs,commits_after,failed_checksandescaped_refs. They return the same TSV rows for every host; a value the host cannot give isNone, printed asunknown. Page every list and stop at a cap, saying so on stderr. Pass host text (titles, bodies, logs) only inside argument lists, never to a shell. Register it inPROVIDERSand teachdetectits URL. - Fake CLI fixture: a shell script in the same file (see
FAKE_GH,FAKE_GLAB,FAKE_AZ) that answers the calls with canned JSON, used throughmake_sceneso it sits first on PATH. No network. - Self-test: extend
hosts_testso the new host returns the row shape the others return, include a title holding$(id), and check the other hosts' CLIs are never called. - For hooks, add its create, merge and note commands and body flags to
FORGE_COMMANDSandFORGE_FLAGSinlib/hookkit.py, and a slop-body case to thepublic-text.pyself-test.
Writing a rule set. The house-style lists are JSON files in rules/, read by lib/rules.py. attribution.json holds the agent attribution patterns and plain-prose.json the dashes, arrow glyph and filler words. A set looks like this:
{"name": "extra", "applies_to": ["prose"],
"rules": [{"id": "jargon-word", "pattern": "\\bsynergy\\b", "flags": "i", "say": "the word synergy"}]}flags is any of i, m, s. say is optional; without it a hit is reported as the matched text. Write ids so the file does not match its own patterns (an id of synergy would). A pattern that does not compile is reported on stderr as lean-agent rules: <set>/<id>: <error> and skipped, and the rest of the set still loads. LEAN_RULES=extra adds the set, LEAN_RULES=-plain-prose drops one; it is read from the environment only. public-text, style-note and tools/style-scan all load the same sets. In an installed plugin rules/ sits in the versioned cache and is wiped on upgrade, so a custom set there does not last. Custom sets wait for extensions (spec step 5) or a fork. Add a case to lib/rules.py --self-test for a new shipped set, and check own_files_clean still passes.
Azure DevOps cannot list failed checks or escaped references through az, so those two columns print unknown for it.
Known limits:
- The watchdog's orphan cleanup records a process group only when
HEAVY_STALLis on, so a killed caller without the watchdog leaves its command running. - A rerun runs a whole class, so one flaky test in a large class costs the class's runtime.
- The drainer's options (
--stall,--lane,--cycle) apply to every job it drains, including jobs queued by others. - A job left
runningby a drainer that died is only cleaned up when the next drainer starts.
What goes where:
- brain holds anything whose status changes: test failures, flaky classes, deferred minors, open questions for the user, unfiled or filed tickets, security findings, blockers, running agents, next steps.
- Markdown ledgers keep rulings (decisions, with the cost if wrong), task complete lines and user decisions. A ledger points to open items with a line like
open items: brain list --project X --status open. - Memory files keep standing preferences.
- Run logs are scratch. They can expire once their failures are in brain.
Brain never holds secrets, tokens or passwords.
brain's code lives in lib/brain/, and tools/brain only starts it. Reads of merged pull requests (lean-stats collect and retro-signals.sh) go through lib/forge.py, which supports GitHub (gh), GitLab (glab) and Azure DevOps (az with the azure-devops extension). lean-stats collect also counts merged Azure DevOps pull requests through az (they are stored as ORG/PROJECT/REPO), for the Azure repositories your transcripts already name. Naming repositories on the command line collects only those, and a line says when Azure ones were skipped. Fix rounds, failed checks and escaped refs stay empty for Azure rows. forge.py can also count the commits on an Azure pull request, but nothing calls it yet. Once a day collect rewrites old _git/NAME and org/project repo names to ORG/PROJECT/REPO from what az repos list shows for your default organization, so cost joins the changes. A three-part name counts as Azure only when its organization is your az default or one seen in an Azure remote.
brain serve serves a page over the brain database at http://leanagent.localhost:8770 (also http://127.0.0.1:8770, printed at start). Use --port N or LEAN_SERVE_PORT for another port. It listens on 127.0.0.1 only and accepts only the Host values leanagent.localhost, localhost, 127.0.0.1 and [::1]. Chrome, Edge and Firefox send *.localhost to your machine with no setup. The plugin never edits your hosts file.
The page is meant for a single-user machine. Another local user who takes port 8770 before you could serve a fake page, and the server does not guard against that.
Three modes, set with the plugin's serve_mode setting:
manual(default): you runbrain serveyourself.session: the SessionStart hook starts the server when a session opens. It stops after 30 minutes with no open session. A session that started more than 12 hours ago and never closed does not count as open.always: the server starts at login. Runbrain serve --install alwaysonce to write the login entry: a launchd agent on macOS, a systemd user unit on Linux, or a Startup folder.cmdon Windows. No admin rights. Until that entry exists, the SessionStart hook starts the server when a session opens and leaves it running.brain serve --uninstallremoves the entry.
worktree_roots is a comma-separated list of folders the page searches for git worktrees, besides the repositories brain already knows. brain serve --roots A,B does the same for one run.
The session button on an item starts Claude Code on it. On macOS it opens Terminal. On Windows it opens a Windows Terminal tab; if that fails, or claude is a .cmd shim, the page shows the command to copy, with a note to paste it into Command Prompt. On Linux the page shows the claude command to copy.
The VS Code panel is deprecated. It shows a notice once per version and Lean Brain: Open brain page opens the page.
Set these in the env block of your Claude Code settings. The defaults run the method as written.
| Variable | Default | Effect |
|---|---|---|
LEAN_PROFILE |
standard |
strict keeps every block. off turns every hook off. An unknown value counts as strict. See Profiles. |
LEAN_AGENTS |
many |
one runs everything in one session: no subagents, one ticket at a time. |
LEAN_MODELS |
mixed |
one keeps every step on the session's model: no cheap drafter, no escalation. |
LEAN_MODEL_CHEAP |
sonnet |
The model that drafts and critiques. |
LEAN_MODEL_STRONG |
opus |
The model that takes what the cheap steps could not close. |
LEAN_MODEL_FAST |
haiku |
The model for agents that read and report: code search, running the gates, the retro's fact collection. It never judges code. |
LEAN_RULES |
attribution,plain-prose |
Which rule sets the style checks load. name adds rules/name.json, -name drops one. -attribution is a user setting: public-text puts the set back when it comes from a repository's own settings. See Writing a rule set. |
LEAN_HOOK_<NAME> |
the hook's profile default | One switch per hook: off, note or block. note and block only change a hook that refuses; a hook that only gives a note (verify-claim, test-before-push, style-note, docs-containers) takes off alone. NAME is the hook file name in capitals with underscores. Resolution order and guards are under Profiles. |
LEAN_SKIP_<NAME> |
off | 1 counts as LEAN_HOOK_<NAME>=off. Read for every hook. ATTRIBUTION, SLOP and WIDE_CHARS are not hooks: 1 skips that one check. |
LEAN_STATS |
on | off stops every lean-stats write. |
LEAN_CONTEXT_WARN |
100000 |
Context size, in tokens, where the coordinator gets a cost note. off turns it off. |
LEAN_COMPACT_ROOM |
40000 |
Tokens that must be left for work after a compaction before the next auto-compaction. Less gets one note, shown to you too. off turns it off. |
LEAN_LOOKUP_WARN |
10 |
Read-only lookups by an Opus coordinator before it is told to use lean:search, or refused with LEAN_LOOKUP_MODE=block. off turns both off. |
LEAN_LOOKUP_MODE |
note |
block refuses the next Grep, Glob or read-only Bash search (never Read) of an Opus coordinator past LEAN_LOOKUP_WARN since its last Agent start, naming lean:search. |
LEAN_IMAGE_CONTEXT |
60000 |
Context size, in tokens, above which an image result is noted, or refused with LEAN_IMAGE_MODE=block. off turns both off. |
LEAN_IMAGE_MODE |
note |
block refuses tools that return an image (Read of an image file or a pdf with pages, screenshot and thumbnail tools) above LEAN_IMAGE_CONTEXT, so a subagent looks and reports in text. |
LEAN_BRAIN_DB |
~/.local/share/lean/brain.db |
Where brain keeps its database. |
LEAN_BRAIN_RESUME |
on | off stops the startup hook from printing the brain digest. |
LEAN_SKIP_SECRET_SCAN |
off | 1 turns off secret-scan, the Claude hook and the git hooks it installs, in every profile. A line with allow-secret on it is skipped without this. |
LEAN_SCRIPT_NOTE |
on | off stops the note that names the script behind a hand-written command. |
LEAN_DIRECT_TEST |
block in strict, nothing in standard |
on stops the block on a direct dotnet test, npm test, npx vitest or vitest run where test-phase can take the job. Tests go through brain queue add and test-phase. A package.json that uses jest and not vitest is left alone, and so is a pnpm -r, --filter, turbo or nx script, since the queue has no jest runner. |
LEAN_NPM_REGISTRY |
npm config get registry, else https://registry.npmjs.org |
The npm registry pkg-version asks. |
LEAN_NUGET_REGISTRY |
https://api.nuget.org/v3-flatcontainer |
The nuget flat container pkg-version asks. |
LEAN_CREDIT_RUNS |
off | on lets credit-run start a job. Anything else exits 2 and starts nothing. |
LEAN_CREDIT_TOTAL_USD |
unset | The most credit-run may spend in total. Required to start a job. |
LEAN_CREDIT_TURN_USD |
0.50 |
Added to each job's budget as its reservation, since the SDK stops a job only after a turn. |
LEAN_CREDIT_KEY_ITEM |
lean-api-credit |
The keychain item (macOS) or service attribute (Linux) that holds the API key. |
LEAN_CREDIT_ADVISOR |
off |
opus gives jobs the Opus advisor. --advisor overrides it. |
LEAN_CREDIT_CACHE_TTL |
5m |
Prompt cache lifetime for jobs, 5m or 1h. --cache-ttl overrides it. |
LEAN_CREDIT_FAST |
off | on allows --fast, and only with an Opus model. Fast mode switches any other model to Opus at double Opus rates. |
LEAN_CREDIT_BATCH |
off | on, together with LEAN_CREDIT_RUNS=on, lets credit-batch submit send a batch. status and results work without it. |
LEAN_CREDIT_UNTIL |
unset | The last day to spend the total, as YYYY-MM-DD (UTC, the last day counts). credit-run --pace needs it. |
LEAN_CREDIT_CODE |
off | on routes lean:draft coding work to credit-run edit jobs. A routing setting for the method and --pace; credit-run takes edit jobs either way. |
LEAN_CREDIT_ASK |
off | on makes the coordinator ask once, with a cost estimate, on a case the routing does not settle. A method rule only. |
Every off switch for a hook is in Settings.
LEAN_PROFILE goes in the env block of Claude Code settings, like the other settings. It is read case-insensitively and trimmed. Unset means standard. A value that is not strict, standard or off counts as strict, so a typo never loosens a check, and the session start note warns about it. Set it in ~/.claude/settings.json, not only in your shell: a repository's settings env overrides a value exported in the shell, and a guard cannot see the shell value then.
strict: every check blocks, as before this release.standard: a check that was a matter of taste or of this workflow gives a note or says nothing. A key in a written file still blocks.off: every hook exits at once, before it reads the event, so nothing is read, written or started. Skills, scripts, brain and the MCP server are not hooks and stay.
| Check | strict |
standard |
|---|---|---|
| public text: attribution, slop, dashes, arrows | blocks | note |
| commit author email | blocks | note |
| scratchpad root file names | blocks | nothing |
background shell without bounded |
blocks | nothing |
sleep loops, pgrep waits |
blocks | note |
gh pr ready or merge with no logged review |
blocks | nothing |
direct dotnet test, npm test, vitest where test-phase can take it |
blocks | nothing |
| a key or token in a Write, Edit, MultiEdit or NotebookEdit (scanner runs) | blocks | blocks |
| a commit or push that turns the git hooks off | blocks | note |
| a commit or push in a repository without the git hooks | blocks | note |
git init or clone and a commit in one command |
blocks | nothing |
| a commit in a repository the hook cannot determine | blocks | nothing |
| the secret scan hook crashed or is missing, Bash command | blocks | nothing |
| the secret scan hook crashed or is missing, Write or Edit | blocks | note (the key scan did not run) |
LEAN_LOOKUP_MODE=block, LEAN_IMAGE_MODE=block |
refuses | refuses |
The explicit settings win in every profile: LEAN_SKIP_*, LEAN_HOOK_*, LEAN_DIRECT_TEST=on and the other off switches behave as before. The two opt-in refusals keep refusing under standard because you asked for them.
A direct test run gets no wait-loop note under standard either, unless LEAN_DIRECT_TEST=on is set, which is the one case that note already covered.
Switch names no longer say "allow". LEAN_HOOK_COMMIT_AUTHOR=off, LEAN_HOOK_SCRATCHPAD_ROOT=off, LEAN_SKIP_ATTRIBUTION=1, LEAN_SKIP_SLOP=1, LEAN_SKIP_WIDE_CHARS=1, LEAN_HOOK_PUBLIC_TEXT=off (the whole public-text hook) and LEAN_DIRECT_TEST=on replace LEAN_ALLOW_COMMIT_AUTHOR=1, LEAN_ALLOW_SCRATCHPAD_ROOT=1, LEAN_ALLOW_ATTRIBUTION=1, LEAN_ALLOW_SLOP=1, LEAN_ALLOW_WIDE_CHARS=1 and LEAN_DIRECT_TEST=allow. The old names keep working until the next major release.
Every hook has one switch, LEAN_HOOK_<NAME>, where NAME is the hook file name in capitals with underscores (commit-author.py is LEAN_HOOK_COMMIT_AUTHOR). It takes off, note or block; any other value is ignored and named on stderr. A hook that only gives a note and never refuses takes off alone, because note and block change a hook only where it refuses. LEAN_SKIP_<NAME>=1 and the old LEAN_ALLOW_* names count as off. First match wins:
| Order | Source |
|---|---|
| 1 | LEAN_PROFILE=off turns every hook off |
| 2 | the env prefix of the command (LEAN_HOOK_COMMIT_AUTHOR=off git commit ...); a guard ignores a loosening here |
| 3 | the environment (the env block of Claude Code settings); a guard ignores a loosening that the repository's .claude/settings.json set |
| 4 | reserved for extensions, not built yet |
| 5 | the hook's default for the profile |
The dispatcher resolves layers 1 to 3 once per hook, skips a hook that is off, and hands the result to the hook as LEAN_HOOK_MODE=<NAME>:<mode> (a bare value, or another hook's name, is ignored). A prefix note or block only counts in hooks that read the command line, and a prefix off is honoured where a hook already did so.
secret-scan, commit-author, public-text, test-before-push and verify-claim are guards ("guard": True in the hook's HOOK literal). Only you can loosen a guard. A loosening is off (always, even where the profile default is already off), or note over a block default, and a guard ignores it when it comes from:
- the command's own env prefix (
LEAN_HOOK_SECRET_SCAN=off git push,LEAN_SKIP_SECRET_SCAN=1 git commit ..., or an oldLEAN_ALLOW_*name), because the agent writes that prefix, not you; - the
envblock of the repository's.claude/settings.json, because a cloned repository could otherwise switch a guard off. This coversLEAN_PROFILEtoo: a repository'sLEAN_PROFILEthat is looser than your own is ignored by a guard, which then resolves under your profile (theLEAN_PROFILEin your~/.claude/settings.jsonenv block or a managed policy,standardwhen you set none).
The guard says so once per session and name, and tells you to set the value in ~/.claude/settings.json. Tightening works from anywhere. The repository's settings are read in the project directory (CLAUDE_PROJECT_DIR, the current directory when there is none) and in every parent up to the git root. A managed policy value, a value your own ~/.claude/settings.json sets to the same thing, and a .claude/settings.local.json that git does not track, count as yours and keep working. A settings.local.json that git tracks, or that sits in a symlinked or submodule .claude, counts as the repository's. A repository settings.json that cannot be read counts as the repository's too, as does any check that fails. A repository-set LEAN_PROFILE looser than your own is ignored, and so is a repository-set LEAN_RULES that drops a default rule set (public-text loads the default sets anyway). If the attribution set cannot load, public-text says so once per session. When a guard blocks, the note goes to stderr as well. The same rule covers LEAN_SKIP_ATTRIBUTION and LEAN_SKIP_SLOP in public-text. The git hooks that secret-scan install writes still read LEAN_SKIP_SECRET_SCAN from their own environment, so secret-scan treats a LEAN_SKIP_SECRET_SCAN that would reach them from the command (a prefix or an export) or from the repository's settings like --no-verify: under strict it refuses the commit or push, under standard it gives a note, as --no-verify does. Your own value in the environment or your user settings keeps working for both.
The git hooks that secret-scan install writes do not read LEAN_PROFILE. A person has them only after running install, so they keep blocking a key in a commit or push in every profile. LEAN_SKIP_SECRET_SCAN=1 or an allow-secret line is how to get past them.
credit-run runs one brief as a headless job through the Claude Agent SDK, paid by an API key, with a dollar cap. Your session stays on your subscription. It is meant for read and judge work (spec review, hunting, refuting, analysis) and for drafts, so --read-only --role hunt returns the result text on stdout.
credit-run --setup # once: installs the pinned SDKs (agent and batch) under ~/.lean/credit-sdk (needs node)
credit-run --key-help # prints the keychain command for you to run; the key is never an argument
export LEAN_CREDIT_RUNS=on LEAN_CREDIT_TOTAL_USD=20
credit-run --brief brief.md --worktree ../app-wt --budget 2 --model sonnet
credit-run --brief brief.md --worktree . --budget 1 --read-only --role hunt
credit-run --spentThe key goes into the worker's environment only. ANTHROPIC_AUTH_TOKEN and CLAUDE_CODE_OAUTH_TOKEN are removed from it, because the auth token outranks the key, and so are ANTHROPIC_BASE_URL and the Bedrock, Vertex and Foundry switches, so the key only goes to the Claude API. The job loads no user settings and only this plugin. Tools are Read, Glob, Grep, Edit, Write and git status, diff, log, add, commit; everything else is denied, and git push is refused even through --allow, and so are --allow entries that run git with an option before the subcommand, a wildcard in the git subcommand, or a shell or runner such as sh, env or python. Reading /proc is denied. A job that edits needs a clean linked worktree. --read-only gets Read, Glob and Grep only, with no Bash and no edits, so put any diff in the brief.
Each job reserves its budget plus LEAN_CREDIT_TURN_USD in ~/.lean/credit-runs.jsonl before it starts and is refused when spent plus reserved plus that reservation passes the total. A job that dies without a final line keeps counting at its reserved amount. A cap hit exits 3 and prints the session id for --resume. These figures are a local estimate from total_cost_usd, and a cost figure does not prove which balance paid. The only hard limit is the spend limit on the Console workspace. credit-run --spent also names older single-line rows with no known cost (counted at their budget) and ledger lines it had to skip.
export LEAN_CREDIT_TOTAL_USD=200 LEAN_CREDIT_UNTIL=2026-12-01
credit-run --paceIt prints total, spent, reserved, remaining, days left, the amount per day (remaining over days left) and what was spent today (UTC), then behind or ahead, and ends with one line naming the next move. Behind means today's spend is under the amount per day. It needs neither the key nor LEAN_CREDIT_RUNS, and exits 2 on a missing total, a missing or bad date, or a date already past.
credit-batch sends read-only briefs (retro digests, ticket shaping, spec review) as one Message Batch at 50% off. There is no tool loop, and a batch can take up to a day. It is off unless LEAN_CREDIT_RUNS=on and LEAN_CREDIT_BATCH=on.
credit-batch submit --brief a.md --brief b.md --shared rules.md --max-tokens 4000 --model sonnet
credit-batch status msgbatch_...
credit-batch results msgbatch_... --dir out/Each brief is one request, named by its file. --shared is one text block sent first in every request with a 1 hour cache breakpoint. submit reserves the estimated cost (input tokens plus --max-tokens, at batch rates) in the same ledger and under the same total as credit-run. results writes one file per request, works out the real cost from the token counts, and closes the reservation. It refuses until the batch has ended and exits 1 naming any request that errored, expired or was canceled. A batch whose results are never fetched stays reserved. If results holds a different number of requests than submit reserved, it writes no final line, names both counts and exits 1, and a later run closes it. A result file that is a symlink is refused and not followed. If submit fails or times out after it reserved, the reservation stays and the batch may exist with an unknown id, so check the Console Batches page. The model is sonnet, opus, haiku or one of claude-sonnet-5-5, claude-opus-5-5, claude-haiku-5-5. Request size is estimated as UTF-8 bytes divided by 2. Batch costs are computed from token counts, not a billed figure. credit-run --setup installs the SDK it uses.
The scan runs in git's own pre-commit and pre-push hooks, so a commit or push is checked however it is made: by Claude, by you in a terminal, through an alias, with a pathspec or -a. Install them per repository:
secret-scan install [REPO] pre-commit and pre-push in one repo
secret-scan install --force-shared also when the hooks folder is shared
secret-scan install --all DIR every git repo under DIR
secret-scan uninstall [REPO] (or --all DIR) take them out
secret-scan status [REPO] are the hooks working, is the scanner copy current
pre-commit checks the lines the commit adds, from the index git is about to commit. pre-push checks the commits the push sends that the target remote does not have, merges included (what a conflict resolution adds), and a tag that points at a blob or a tree. A commit that sits only on another remote is checked again on its way to a new one, unless that other remote is public (an anonymous git ls-remote over https works), so a fork of a public repo does not rescan its history. The edge of a shallow clone counts as already known. Diffs are read as text even when .gitattributes or config marks a file binary; a file's text ends at its first NUL byte.
The patterns: Google AIza, GitHub ghp_/gho_/ghu_/ghs_/ghr_/github_pat_, AWS AKIA, Slack xox, Stripe sk_live_/rk_live_, npm npm_, Anthropic sk-ant-, OpenAI sk-proj-/sk-svcacct- and the classic 48-character sk-, GitLab glpat-, Hugging Face hf_, SendGrid SG., Groq gsk_, private key blocks, and an Azure DevOps PAT when it sits next to a name like token or pat. When gitleaks is on PATH its rules run as well, once per scan, with a time limit (LEAN_SECRET_SCAN_TIMEOUT, 20 seconds), and not at all for a scan over 8 MB. If it is skipped, fails or times out the hook prints a warning and the pattern result stands. The output names the file, line and pattern, never the value. A line with allow-secret on it is skipped, that line only. Git runs with fsmonitor, textconv, external diff, signature checks and clean filters off, so a repository's own config cannot run code during the scan.
The secret-scan Claude hook does not scan commits. Before a Bash command that commits or pushes (including an alias, a git command it does not know, and calls inside bash -c, eval, braces, if and xargs), it checks that the repository has both git hooks and the scanner copy they run, and, in the strict profile, blocks with the install command when not (standard gives a note with the install command). It also blocks a command that skips them in strict (a note in standard): --no-verify, commit -n, core.hooksPath, include.path or includeIf set with -c, --config-env or git config, GIT_CONFIG_*, HOME or XDG_CONFIG_HOME set in the command, and git send-pack. Git commands that run other commands count as a commit, and the command they run is checked for the same flags: submodule foreach, rebase --exec and -x, bisect run, filter-branch (--env-filter, --tree-filter, --index-filter, --parent-filter, --msg-filter, --commit-filter, --tag-name-filter, --setup), difftool and mergetool (-x, --extcmd), and for-each-repo (its arguments are read as a git command). A $( ) or backtick substitution is read too, also inside double quotes (a heredoc inside it is cut out first). Some external commands pass only in read-only forms: lfs (pull, fetch, install, update, prune, version, ls-files, status, track, but not with --force), svn (log, fetch, rebase, info, clone), p4 (sync, clone), machete (status, discover), flow (init, start, list). The rest of lfs, svn, p4, machete and flow, and absorb, send-email, gui, citool, filter-repo, fast-import, subtree and unknown commands, need the hooks, like commit. request-pull, instaweb, daemon, scalar, delta, last-modified, update-server-info, sh-setup and quiltimport pass. A command that never says git is checked when a variable that looks like git ($GIT, ${G}) is followed by commit or push. When the folder is a variable, a command or a cd target that does not exist yet, it checks the starting repository, and blocks when that is not one. Write, Edit, MultiEdit and NotebookEdit are scanned directly when the file is tracked or would be (a gitignored .env.local and files inside .git are fine). A key blocks in every profile while the scanner runs; if it crashed or is missing, standard gives a note that the scan did not run. A block in a repo whose hooks folder is shared or tracked (husky, any core.hooksPath) names --force-shared. A hook that was edited after install does not count as installed. Every block is a hook_fires row in lean.db.
An existing hook is kept and still runs after the scan, and a core.hooksPath for that repo is respected. The hooks call the python that ran install by its full path (python3 from PATH if that file is gone). If a framework overwrites the hook after it was chained, install again chains the new hook and moves the older chained one to <hook>.pre-secret-scan.bak001 (older ones move up to .bak002 and so on); the chained hook runs first, then .bak001, .bak002 and the rest, newest to oldest, so every foreign hook still runs. Uninstall puts the chained hook back and lists the .bak files it leaves. A hooks path that is tracked inside the work tree, or set in global, system or command-line config, is shared by other people or repos, so install refuses it unless you pass --force-shared. Uninstall keeps a hook you edited and says so, reports a leftover .pre-secret-scan, and says when there was nothing to remove. The scan exits 0 clean, 1 on a finding and 2 when it could not run (a git error, a bad range); the git hooks block on both. Install copies the scanner to ~/.local/share/lean/secret-scan, so the hooks keep working after a plugin upgrade; if that copy is gone the hooks block and say to run install again. The copy carries a scanner rev; a hook check replaces a copy with a lower rev (or none) from the plugin, atomically, and never replaces a copy with a higher rev, so an older plugin cannot downgrade it. A copy with the same rev but other bytes counts as stale. A copy that is unreadable, or lower and outside the scan home, blocks with the install command. secret-scan status [REPO] says whether the hooks work and whether the copy is current, and exits 1 when not. LEAN_SKIP_SECRET_SCAN=1 (not SKIP, which belongs to other tools) skips the git hooks and the Claude hook.
Not covered:
- the commit message and the command text
- variable flags and options that are not expanded:
$g -c core.hooksPath=... commit,a=-n; git commit $a - a substitution inside double quotes nested more than three deep
git lfs installin a repo with our hooks refuses or, with--force, replaces our pre-push hook; the Claude hook then blocks pushes (instrict;standardnotes it) untilsecret-scan installruns again- anything after the first NUL in a file
- commits made by
rebase,cherry-pick,am,stashandmerge, which do not run pre-commit (the push check gates them) - the changes inside the commits at a shallow clone's edge, and an edited
.git/shallow - a hand-made
refs/remotesref, which makes the push scan skip a commit - hooks turned off outside the command (an exported variable from an earlier command, a global config edited by hand), which the Claude hook cannot see
- tampering with the hook, the scanner copy or
core.hooksPathinside the same command as the commit - a commit made outside Claude with
--no-verify gh repo sync,gh apicontents PUT, andgh pr create --bodyholding a key- libgit2 and scripts that call git
- the public-remote check contacts whatever host a remote URL names, and needs the network; when it fails the other remote counts as private and the commits are scanned
lean-agent has no service of its own and keeps nothing off your machine. What it stores stays local: the brain database (~/.local/share/lean/brain.db), test-phase logs (~/.local/share/lean/test-phase), stats (~/.lean/lean.db) and which script notes a session has seen (~/.local/share/lean/script-note, deleted after 14 days). The commit-author hook reads the git author email to check it and stores nothing. The secret-scan git hooks read the lines being committed or pushed and store nothing; the Claude hook reads the text being written and stores only that it blocked. The push check asks a remote's https address, without credentials, whether it is public.
It sends data to other services only through tools you already run, and only where you point them:
- GitHub, through your
ghlogin: the adversarial review posts review threads,lean-statsandpr-blockersread pull requests and checks. The hooks only read the command an agent is about to run; they call nothing. - GitLab, through your
glablogin:lean-stats,retro-signals.sh,pr-blockers.shandpr-waitread merge requests and pipelines the same way they read GitHub's. - GitHub and Azure DevOps, from the brain page, through your own
ghandazlogins. The page stores no credentials. A CLI that is missing or logged out shows as such in its section. - Your own SSH hosts, when
~/.config/lean/remotes.ininames any:test-phasecopies the repository there with rsync and runs the tests in Docker. Without that file, no code is copied off the machine. - A URL you pass to
check-deployed-sha.sh, which it fetches with curl. - A package registry, when you run
pkg-version: it sends the package name to the nuget flat container (api.nuget.org, orLEAN_NUGET_REGISTRY) or the npm registry (LEAN_NPM_REGISTRY, else your npm config, else registry.npmjs.org). Credentials in a registry URL are dropped before the call. - Azure DevOps, through your
azlogin, when you runpr-wait --provider azureor run it in a folder whose origin is Azure DevOps: it reads a pipeline run, its timeline and the failed logs.
- Claude Code with plugin support.
python3andgiton PATH, and the CLI of your code host:gh,glab, orazwith the azure-devops extension.- Linux, or macOS with its stock bash 3.2.
heavy.shuses util-linuxflockon Linux. On macOS it takes the lock with python3 and names holders withlsof.
A change to skills/, hooks/, tools/orlib/moves the version in.claude-plugin/plugin.json, and the merge is tagged v. tests/run-all.shruns every--self-test`, lists scripts that have none, and fails when those folders changed since the current version's tag. CI runs it on Ubuntu for every pull request.
A script that works on any repository belongs here, as a pull request with its test and a line on the Scripts page. See Scripts, not instructions.
MPL-2.0. See LICENSE.