# Leg > A local wrapper for coding-agent CLIs. Type `leg claude`, `leg codex` or `leg agy` instead of the bare command and you get the same interactive agent with a board beside it, usage tracking per agent and account, a context handoff bundle kept current, and an automatic handoff to the next agent in the same terminal when the usage limit hits. Zero runtime dependencies, Node 22+, binds 127.0.0.1, never edits your own config files. Commercial license, source readable in the package. No trial: Personal $79 once or Team $12 per seat per month, with a 30-day money-back guarantee. Site: https://legcli.com/ npm: https://www.npmjs.com/package/legcli ## Install ``` npm install -g legcli pip install -U context-handoff-bundle cd leg claude ``` Prerequisites: Node 22 or newer, git, Python 3 with pip, and at least one logged-in agent CLI (`claude`, `codex` or `agy`). Anything after the agent name passes straight through (`leg claude --model opus`, `leg codex -m gpt-5.3-codex-spark`). ## What runs alongside the agent 1. A board in the browser at http://127.0.0.1:4747, opened once and reused. It opens with one sentence saying what to do next: which login your terminals are on and how much of it is left, with the age of the reading when it is stale. Under it each login is a panel sized by how much it matters, carrying its 5h and 7d gauges. Each live terminal is one row: state, repo and branch, the prompt, the files being touched, how long it has run, and its buttons (Land, Hand off now, Details, End). Finished terminals and what landed on trunk are counts at the bottom that open on click. 2. Usage tracking per agent and account, read from what each CLI already exposes. Claude Code: the usage endpoint the built-in status line uses, polled every 60 s, and the `StopFailure` hook for the wall. Codex: rate limits from the session's rollout file, `usage_limit_exceeded` for the wall. agy: no percentages exposed; `RESOURCE_EXHAUSTED` in the log for the wall. Nothing is screen-scraped. 3. A context handoff bundle (context-handoff-bundle on PyPI) refreshed every two minutes: the task, the last messages, `git diff --stat`, dirty files, files edited this session, recent commits, why it stopped. 4. The handoff. At 85 percent of a window the gauge crosses its reserve notch and the terminal bell rings once. At the limit Leg saves the bundle, stops the agent, and starts the next option in the same terminal from that bundle: another login of the same agent if one was added, otherwise the next agent in the order you saved. That order is a priority list, not a rotation: an agent you put last is the last option from every starting agent. The default new terminals copy lives in the board's Settings, and Change order in a terminal's details repoints one running terminal. The next agent's first turn reads `.leg/RESUME.md`, checks `git status` and `git diff`, and continues; nothing is retyped. When every option is out, the terminal prints each reset time, waits with a countdown, and starts that agent when the reset arrives. ## Background cards Background cards run work with no interactive terminal, each in its own worktree, and appear as a count on the board rather than beside the live terminals. Build stops with the changes in that worktree and merges nothing. Build-land and Factory run the tests and merge on their own. You pick the first agent; the fallback agents are the same handoff order. ## Two sessions in one repo A second `leg ` in a checkout that already has a live session gets its own git worktree (`.leg-worktrees/` on branch `leg/`). Its row has a Land button: commit what the agent left, rebase onto the base, run the repo's tests, fast-forward the base. When a step fails nothing lands and the row says why (`rebase-conflict` with the files, `tests-red`, `dirty-trunk`). Two live sessions touching the same file are flagged on both rows. Nothing is merged and nothing is pushed. ## More than one human Off by default. `leg share on` binds the board to a Tailscale or LAN address and gives every human their own token; guests see redacted rows and can request a handoff. ## What is never touched `~/.claude/settings.json`, `~/.claude.json`, `~/.codex/config.toml`, agy's files, the repo's settings. Claude Code gets hooks through a per-session `--settings` file under `~/.leg`; codex and agy get nothing injected. `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL` and `OPENAI_API_KEY` are stripped before any agent starts (subscription logins only). `leg uninstall --yes` removes `~/.leg` and nothing else. ## Verified Live on 2026-09-11 against Claude Code 2.1.268, codex-cli 0.153.4 and agy 1.2.0. 473 tests. ## Docs The source repository is private, so these pages are the public copy of the documentation that ships inside the npm package. - All docs: https://legcli.com/docs - Install and first run: https://legcli.com/docs/getting-started - How it works (sessions, bundles, the wall): https://legcli.com/docs/concepts - The board, panel by panel: https://legcli.com/docs/board-guide - Configuration and environment variables: https://legcli.com/docs/configuration - What Leg reads from each agent CLI, with sources: https://legcli.com/docs/cli-contracts - Agent adapters: https://legcli.com/docs/adapters - FAQ: https://legcli.com/docs/faq - A real run, limit to handoff: https://legcli.com/docs/real-run - Vocabulary: https://legcli.com/docs/vocabulary - Full README: https://legcli.com/docs/readme - Changelog: https://legcli.com/docs/changelog - Support and refunds: https://legcli.com/support - License: https://legcli.com/license - Package: https://www.npmjs.com/package/legcli