CLI reference

Every lk command with its usage, options and exit codes, generated from the CLI itself so it always matches the installed version.

lanekeeper and its short name lk are the same program (version 0.2.0). Every command accepts -C <dir> to run as if in another directory and --help; commands that list a --json option below print machine-readable output with it. Commands exit 0 when they succeed and 2 on a usage or runtime error;lk check exits 1 when there are high-severity clashes, lk claim when the claim is refused, and lk doctor when a check fails.

Lanes and clashes

lk status

Lanes, agents, open clashes grouped by severity, and active claims.

lk status [--json] [--watch]
OptionDescription
--jsonPrint machine-readable JSON.
--watch -wRedraw every two seconds until interrupted.

lk check

Analyze every lane now. Exit 0 = no high clashes, 1 = high clashes, 2 = error. For scripts and pre-commit.

lk check [path] [--json]
OptionDescription
--jsonPrint machine-readable JSON.

lk claim

Reserve code for the current lane so other agents steer around it. Symbols are written file#name.

lk claim <symbol|glob> -m "<intent>" [--exclusive] [--ttl 30m]
OptionDescription
--message <value> -mWhat you are doing (shown to other agents).
--exclusiveRefuse overlapping exclusive claims; other lanes' edits become high clashes.
--ttl <value>How long the claim lasts, e.g. 30m or 2h (default: claims.defaultTtl, 30m).
--jsonPrint machine-readable JSON.

lk release

Release one claim, or every claim of the current lane.

lk release [claimId | --all]
OptionDescription
--allRelease all claims held by this lane.

lk clashes

List open clashes (--all includes acknowledged and suppressed ones).

lk clashes [--all] [--json]
OptionDescription
--allInclude acknowledged and suppressed clashes.
--jsonPrint machine-readable JSON.

lk ack

Acknowledge a clash: it stops repeating until either lane changes the code again.

lk ack <clashId>

lk suppress

Suppress a clash permanently.

lk suppress <clashId>

lk plan

Suggested merge order for the local lanes, with the reason for each dependency.

lk plan [--json]
OptionDescription
--jsonPrint machine-readable JSON.

lk explain

Everything about one clash: both lanes, symbols, files and lines, and what to do.

lk explain <clashId> [--json]
OptionDescription
--jsonPrint machine-readable JSON.

Setup

lk doctor

Check git version, Node version, daemon health, config, permissions and integrations.

lk doctor [--json]
OptionDescription
--jsonPrint machine-readable JSON.

lk telemetry

Anonymous usage stats: command name, duration, exit code, version, OS (never paths, symbols, arguments or code). Off by default; DO_NOT_TRACK=1 always wins.

lk telemetry on|off|status

lk mcp

Run the Lanekeeper MCP server on stdio (for Cursor, Codex and other MCP clients).

lk mcp [--agent <kind>]
OptionDescription
--agent <value>The agent using this server (e.g. codex), so its lane names it and agent policy rules apply.

lk init

Set up this repository: config, Claude Code hooks, MCP for Claude/Cursor/Codex, agent instructions. Safe to re-run.

lk init [--yes] [--plugin] [--ci] [--json]
OptionDescription
--yes -yDon't ask; apply everything (init never overwrites your content).
--pluginUse the Claude Code plugin instead of project hooks and the CLAUDE.md section.
--ciAlso add .github/workflows/lanekeeper.yml (the Lanekeeper GitHub Action).
--jsonPrint machine-readable JSON.

lk uninstall

Remove everything lk init added and restore the files it changed, byte for byte.

lk uninstall [--json]
OptionDescription
--jsonPrint machine-readable JSON.

Daemon

lk daemon start

Start the daemon for this repository in the background.

lk daemon start

lk daemon stop

Stop the daemon for this repository.

lk daemon stop

lk daemon status

Whether the daemon is running, its pid and socket.

lk daemon status

lk daemon logs

Print the last 200 lines of the daemon log.

lk daemon logs

lk daemon run

Run the daemon in the foreground (normally started automatically).

lk daemon run [--repo <path>]
OptionDescription
--repo <value>Repository root (defaults to the current directory).

Team (v1)

lk login

Sign in to the team service with a code you confirm in the browser.

lk login [--server <url>]
OptionDescription
--server <value>Team server URL (or LANEKEEPER_API_URL; default: the one server you signed in to). There is no hosted server yet.

lk logout

Forget this machine's token for the team service.

lk logout [--server <url>]
OptionDescription
--server <value>Team server URL (or LANEKEEPER_API_URL; default: the one server you signed in to). There is no hosted server yet.

lk whoami

Show the signed-in account and its organizations.

lk whoami [--server <url>] [--json]
OptionDescription
--server <value>Team server URL (or LANEKEEPER_API_URL; default: the one server you signed in to). There is no hosted server yet.
--jsonPrint machine-readable JSON.

lk sync

Link this repository to a team so lanes on teammates' machines see each other. `lk sync key` turns on hashed sync: names and paths leave this machine hashed with the team's key (.lanekeeper/sync.key; commit it). Hashing then stays on for this clone until `lk sync plain`. `lk sync intents on` shares a one-line intent of your prompts with the team; it is your own choice for this clone, never the repository's.

lk sync on --org <org> | key | plain | intents on|off | off | status
OptionDescription
--org <value>The team (organization) to sync with.
--server <value>Team server URL (or LANEKEEPER_API_URL; default: the one server you signed in to). There is no hosted server yet.
--jsonPrint machine-readable JSON.

Enterprise (v2)

lk policy test

Check the policy in force (your organization's rules, then .lanekeeper/policy.yml): list the rules and any error, and, with a file, what an edit to it would trigger now.

lk policy test [file] [--agent <kind>] [--json]
OptionDescription
--agent <value>Evaluate as this agent kind (e.g. claude-code, human).
--jsonPrint machine-readable JSON.

lk usage

Estimated agent token cost from Claude Code transcripts (PLAN.md §25). Estimates, not a bill.

lk usage [--by model|agent|lane|day|session] [--json]
OptionDescription
--by <value>Group by model (default), agent, lane, day or session.
--jsonPrint machine-readable JSON.

lk usage import

Add token usage from a file: a Claude Code transcript, or JSONL lines of { model, inputTokens, outputTokens, cacheRead, cacheWrite }.

lk usage import <file> [--session <id>]
OptionDescription
--session <value>Record it under this session id (default: import-<file name>).

lk audit verify

Check the local audit log's tamper-evident hash chain (PLAN.md §24).

lk audit verify [--json]
OptionDescription
--jsonPrint machine-readable JSON.

lk audit export

Write the audit events to stdout (JSONL by default, or CSV) for a SIEM or archive.

lk audit export [--format jsonl|csv] [--after <seq>]
OptionDescription
--format <value>jsonl (default) or csv.
--after <value>Only events after this sequence number.