CLI reference
All repository commands accept --repo <path>; the default is the current directory.
har onboard
Section titled “har onboard”Sets HAR up in a repository in seven steps, one screen each. Each step explains itself in at most three lines, shows the default and the current state with each question, and links the page with the details.
| Step | Asks (default) |
|---|---|
| 1. Welcome to HAR | Nothing: slots and worktrees, verify → complete, the commit gate, proofs, Mission Control and HAR HQ. --skip-guide skips it. |
| 2. This repository | Harness profile (an Xcode project suggests ios, else default), agents in parallel (5, 3 for cli/ios). Not asked: the plugins for the verification tools the repository already uses are added (detection). |
| 3. Your agents | Agents to set up (the ones installed on this machine). No skills question: the HAR workflow goes into AGENTS.md, the agent config file every agent reads; add skills with har agents install. |
| 4. Telemetry, a feature for you | Record agent sessions (yes), how much (Outline; Full or Usage), where: Mission Control on this machine (yes when Docker runs). Declining Mission Control offers the hosted HAR HQ instead. |
| 5. Commit gate and proofs | Commit gate (warn), proofs (off), where proofs go. |
| 6. Apply | Nothing: every write happens here, with one line per change. |
| 7. Help us improve HAR | Send crash reports to the HAR maintainers (yes; published builds only). |
Nothing is written before step 6, except the HAR HQ sign-in when you choose it in
step 4. Step 6 writes in this order: .har/, the commit gate and proofs (git-factory,
the notes refspec and notes.rewriteRef, the git hooks), AGENTS.md, skills, the
telemetry consent, the agent hooks and otel-hook (for the agents chosen in step 3
only), HAR HQ, then Mission Control.
har onboard [--repo .] [--yes] [--skip-guide] [--skip-init] [--profile default|cli|ios] [--telemetry full|outline|usage|off] [--hq-trajectory|--no-hq-trajectory] [--control|--no-control] [--plugins playwright,cypress,rocketsim,kerno,gitleaks,trivy,semgrep|--no-plugins] [--agent-slots <n>] [--error-reporting on|off] [--force] [--agents claude,cursor,codex] [--no-agents] [--cursor-rule|--no-cursor-rule] [--commit-gate off|warn|block] [--gate-mode block|warn] [--gate-scope worktrees|all] [--proofs off|notes|notes+trailers] [--proofs-push|--no-proofs-push]Onboarding probes Docker first (docker --version + docker info). Docker is
required — Mission Control runs as a container and harness infra uses Docker
Compose — so a missing CLI or stopped daemon is warned about, reported in the
summary, and Mission Control is not offered by default until Docker works.
What each answer records, so har env maintain and har env launch follow it:
- Agents (step 3). Skills go to
.claude/skills/,.cursor/commands/and, for Codex,~/.codex/prompts/. An installed agent you leave out gets no telemetry hook (skipAgentsin the consent), also from a laterhar telemetry enable,har env launchorhar env maintain. One you install later is asked about by the nexthar env maintain(the agents answered areagentsAnsweredin.har/manifest.json).--agentsanswers both questions for this onboarding;--no-agentsinstalls no skills. Without a choice in this run (--yeswithout--agents), the agents left out earlier stay out.har telemetry enable --agents codexhooks a left-out agent later and leaves the others as they are. - Telemetry (step 4): consent to install HAR’s hooks into the global settings of
the agents chosen in step 3 — Claude Code, Codex and Cursor, each counted as installed
when its
~/.claude,~/.codexor~/.cursordirectory exists. A no recordsdeclined, installs nothing and skips “how much” and “where”. The answer is machine-wide (agentHooksin~/.har/telemetry.json, originonboard). The level offered is the one already chosen on this machine, elseoutline, the default everywhere.--telemetry <level>answers without asking (offdeclines;onmeansfull). Choosing HAR HQ runs the browser sign-in ofhar hq connectat once, and step 6 adds this repository to HQ with everything — agent telemetry, runs and proofs — at the scope of the chosen level (har hq repos add . --scope <level>). With neither Mission Control nor HQ, it says the sessions are recorded nowhere yet, with the fixes:har control up,har hq connect,har telemetry destination add. HQ matches agent sessions to a repository by its remote URL: choosing HQ for a repository with no URL remote (noorigin, or a local path) says at once that HQ gets its runs and proofs but not its agent sessions, with the fix (git remote add origin <url>, orgit remote set-url origin <url>, thenhar hq repos add . --scope <level>); the hand-off’s “Traces go” line says it again. - Commit gate —
off,warnorblock— recorded in.har/stages.json(commitGate, withrecordedBy: onboard).--commit-gate off|warn|blockanswers; the olderprompt/always/neverstill work. - Proofs —
off,notesornotes+trailers(theWork-Unit,Factory-RunandFactory-Attestationtrailers) — recorded asHAR_FACTORY_PROOFin.har/harness.env. A proof lets a reviewer or CI check that this exact commit passed a full verify, bound to its work unit. Each note holds the stage names, results and timings, digests of the stage logs, the git tree, the work unit and the HAR version: no code and no log text. When proofs are on, it asks where they go: local notes are always kept; you can also push them with the repository (HAR_FACTORY_PROOF_PUSH=on:har env completerunshar proof sync;--proofs-push/--no-proofs-push) and send them to HAR HQ, already on when step 4 chose HQ. - Crash reports (step 7, published builds): asked last, apart from telemetry.
Sent: the error, its stack trace, the command or tool name, the HAR version and the
OS. Never sent: arguments, repository content, file contents or prompts.
--error-reporting on|offanswers.har onboarddoes not print the first-run crash-report notice other commands show: its question covers it.
--yes asks nothing and applies the documented defaults: telemetry on (the level
already chosen on this machine, else outline; a declined recorded earlier is
kept), HAR skills for the detected agents, proofs off, commit gate warn on a newly
scaffolded harness, crash reports on; Mission Control starts when Docker is
available; plugins for the verification tools the repository already uses. --plugins a,b
names the plugins instead (full scaffold), --no-plugins adds none. When nobody had answered the telemetry question yet, --yes
records the consent with origin onboard-yes (not onboard), prints that --yes
granted it with the commands that undo it, and — when stdin is not a terminal — adds
a warning that --telemetry off (or a level) chooses explicitly. A later interactive
har onboard or har env maintain asks the question again. Without --yes, without
a terminal and without --telemetry, onboarding records no consent and installs no
hooks.
The hand-off lists each choice with the command that owns it — har telemetry …,
har hq …, har env maintain --commit-gate / --proofs / --proofs-push,
har proof disable / sync, har error-reporting on|off — so changing one answer
never means onboarding again. Then the next steps: commit .har/, adapt it with your
agent, launch, verify. The adaptation prompt is written to .har/ADAPT-PROMPT.md
(one line points to it, and onboarding offers to copy it on a terminal where a
clipboard works; --yes never copies), not printed.
This is the first-run command for a new repository — do not substitute har env init in user-facing copy.
--agent-slots <n> sets how many agents may run in parallel (1–10), written to
.har/stages.json as agentSlots.max. Step 2 asks this when the flag is omitted
(the practical limit depends on machine resources and stack cost). With --yes and
no --agent-slots, the profile template default is kept.
har env
Section titled “har env”| Command | Purpose |
|---|---|
init |
Mechanical scaffold of .har/ (fixtures / --force). Humans use har onboard. |
maintain |
Validate, compare templates, and prepare or finalize an upgrade |
add-plugin [plugin] |
Install a plugin (bundled id, path, npm, or git — registers stages) |
add-stage [id] |
Deprecated plugin alias for add-plugin (--custom removed in 1.0 — see har plugin create) |
preflight <id> |
Check ports, processes, Docker, slot occupation, and untracked worktree paths |
setup-infra |
Set up shared infrastructure (Docker services, template DB, or the iOS toolchain) |
launch <id> |
Start a fresh session (new worktree from --repo HEAD) |
recover <id> |
Resume a failed or partial launch |
verify <id> |
Run quick or full verification |
complete <id> |
Reuse last matching full validation, teardown, keep branch (--verify to re-run) |
teardown <id> |
Free a slot without a completion validation; keep branch |
doctor |
Validate the harness contract (schema, stages, scripts, port lanes, env.template) |
eject |
Vendor the runtime into .har/runtime/ for offline ownership |
adopt |
Return an ejected harness to the packaged runtime |
status |
Inspect all slots |
logs <id> [service] |
Show recent logs for a slot (optionally one service) |
agent <id> <command> |
Per-slot ops: status, logs, restart, psql, health, url, reset-db, slow-queries, exec, attach |
run-stage <id> <stage> [args..] [-- args..] |
Run one registered harness stage by id, as verify runs it: in the slot work dir with WORK_DIR, AGENT_ID and the slot env file; args after -- pass through verbatim |
artifacts |
List result files under .har/artifacts/ |
cleanup |
Discover stale sessions and orphan worktrees across registered repos |
runs list |
List persisted run records |
runs get <runId> |
Return one run record |
Initialization
Section titled “Initialization”First-time humans should run har onboard. har env init is the mechanical
scaffold (same initHarness core as onboard and har_init_harness) — use it
for fixtures and --force wipes, not as the advertised first-run command.
har env init [--profile default|cli|ios] [--yes] [--smoke] [--force] [--verbose] [--agents claude,cursor,codex] [--no-agents] [--cursor-rule|--no-cursor-rule] [--commit-gate prompt|always|never] [--gate-mode block|warn] [--gate-scope worktrees|all]--force replaces an existing harness and is destructive.
Maintenance
Section titled “Maintenance”har env maintain [--yes] [--finalize] [--summary <text>] [--agents <targets>] [--verbose] [--cursor-rule|--no-cursor-rule] [--commit-gate off|warn|block] [--gate-mode block|warn] [--gate-scope worktrees|all] [--proofs off|notes|notes+trailers] [--proofs-push|--no-proofs-push] [--telemetry on|off|full|outline|usage] [--error-reporting on|off]Besides validating .har/, maintain runs the steps of
har onboard whose answer is not recorded yet, in the same order and
with the same screens, and skips the rest: your agents (only the installed agents this
repository never answered about — a 1.x repository, or an agent installed since; the
agents already set up keep their skills), telemetry (consent, also when it was only
inferred from hooks an earlier HAR installed, origin grandfathered; the level only
when none was chosen, default Outline; then where, as in onboarding: Mission Control
on this machine, else the hosted HAR HQ portal, else “recorded nowhere yet” with the
fixes), the commit gate, proofs and where they are stored, then crash reports last.
When the consent is already answered, the telemetry step is skipped unless telemetry
is on and recorded nowhere (no Mission Control set up on this machine and no
destination, HAR HQ included): then it asks only where, so an existing install gets
the HAR HQ offer. HAR HQ chosen for a repository with no URL remote counts as an
answer: maintain then prints why HQ gets no agent sessions, and the fix, instead of
asking again. A --telemetry level that turns recording on with nowhere to send
it asks where too. It asks before it changes anything and before it
prints the maintenance or migration prompt (saved to .har/ADAPT-PROMPT.md or
.har/MIGRATE-PROMPT.md; maintain prints the path, the length and what it does, then
offers the clipboard on a terminal where one works, never under --yes), then records each answer (origin
maintain). A recorded answer is never asked again nor changed, unless a flag names a
new one: a gate turned off stays off, and hooks you removed are not reinstalled.
maintain is also how one answer changes later: --commit-gate, --proofs,
--proofs-push, --telemetry, --error-reporting.
On a repository last maintained by HAR 1.x (cliVersion in .har/manifest.json),
it first prints a short 2.0 announcement with the breaking changes that apply to
this repository and lists the open questions, and it ends with a checklist (commit
.har/, CI files that use removed variables, har hq connect).
--yes, or a run without a terminal, asks nothing, keeps every feature as it is and
turns on nothing new; explicit flags still apply. The summary prints one line per
feature with its state and how to change it. maintain creates
.cursor/rules/har-workflow.mdc only on --cursor-rule; it refreshes one that
exists.
Plugins and stages
Section titled “Plugins and stages”har env add-plugin --listhar env add-plugin playwright [--force] [--with-ci]har env add-plugin cypress [--force] [--with-ci]har env add-plugin rocketsim [--force]har env add-plugin kerno [--force] [--with-ci]har env add-plugin gitleaks [--force] [--with-ci]har env add-plugin trivy [--force] [--with-ci]har env add-plugin semgrep [--force] [--with-ci]har env add-plugin ./my-plugin [--force]har env add-plugin @org/har-cypress [--force]har env add-plugin github:org/har-plugin [--force]har plugin create <id> [--kind <kind>] [--description <text>] [--package-fragment] [--force]har plugin listadd-plugin installs a framework bundle that registers one or more stages
(bundled id, local plugin id, path, npm package, or git URL). Installs are
recorded in .har/plugins.json with their source kind. Bundled plugins are
discovered from disk — no core enum edit is required to ship a new id.
har plugin create scaffolds a project-owned plugin at .har/plugins/<id>/
(manifest, contract-compliant stage script, README); implement its TODO, then
install it with add-plugin <id>. har env add-stage playwright remains as a
deprecated alias of add-plugin playwright; add-stage --custom was removed
in 1.0 — one-liner checks are plain command stages in .har/stages.json. See
.har/STAGES.md in every generated harness and the Plugins
guide.
A factory line is the other bundle kind: it registers stages but never adds
them to verificationStages. add-plugin refuses a line bundle and points at
har line add — see har line.
Launch and recovery
Section titled “Launch and recovery”har env preflight 1 [--json]har env launch 1 [--no-worktree] [--claude] [--resume] [--work-id <id>] [--work-source <name>] [--work-url <url>] [--work-title <title>] [--parent-work-id <id>] [--work-link <source|url|label> ...]har env recover 1har env work-link --work-id <id> [--link <source|url|label>] [--source <name> --url <url> [--label <text>]]har env work-bind [<id>] --work-id <id> [--work-title <title>] [--work-url <url>] [--work-source <name>] [--parent-work-id <id>] [--work-link <source|url|label> ...] [--json]Every launch creates a new session from the current HEAD of --repo (the
main checkout). Occupied slots always block a new launch — the error message
prints the upcoming base so you can confirm it before freeing the slot.
An occupied slot must be freed before relaunching: har env complete 1 (or
teardown 1), then har env launch 1. Launch never chooses main for you.
If the worktree has uncommitted changes, commit or discard them in the
worktree first. Use --resume / recover only for a failed or starting
launch — it is not a way to replace an active session.
Work metadata is optional and backward compatible. Bind when the task names a
tracker issue or ticket: pass a short repo-scoped --work-id, plus --work-source,
--work-url, and --work-title when known. Add secondary links with repeatable
--work-link source|url|label, or later with har env work-link. A fresh bound
launch creates an immutable attempt UUID; --resume preserves the failed session’s attempt.
When the work id is only known after launch (a slot started from a panel, an
agent that learns the ticket by reading the task), bind it to the running slot
with har env work-bind. Without <id> it binds the slot whose work dir
contains the current directory, so an agent can run it from its worktree:
har env work-bind --work-id FE-2071 --work-title "Bind work after launch" \ --work-url https://linear.app/acme/issue/FE-2071A binding always mints a new attempt and writes it to the slot (har env status shows the unit). A first binding’s attempt covers the slot since its
launch. Rebinding to another unit starts a new attempt from now: the previous
unit keeps its attempt, run records, validations and usage, and is closed as
abandoned. Binding the unit the slot already carries only merges metadata.
A unit already bound to another slot is refused. The .env.agent.<id>
attribution is rewritten for processes started afterwards; agents already
running are attributed through the slot record.
A worktree only materializes what is in HEAD. Preflight and launch warn when
untracked (not gitignored) paths will be missing from the session worktree —
the count plus a few examples. Track them, or launch with --no-worktree. The
check is skipped when worktrees are off (see har worktree) and
for a --no-worktree launch. The same warning appears in har env status --json, MCP launch
stderr, and har env launch.
Verify and finish
Section titled “Verify and finish”har env verify 1 [--full] [--json] [--line <id> --station <id>]har env complete 1 [--verify]har env teardown 1 [--delete-branch]complete reuses the last passing full validation for the current tree. Pass
--verify to re-run full verification if the worktree may have changed. When proofs
are on and .har/harness.env sets HAR_FACTORY_PROOF_PUSH=on, a successful
complete then runs har proof sync to push the factory notes; a
failed sync is a warning, not a failed complete.
--skip-verify is a deprecated no-op (skip is the default).
Verify runs the harness definition of the tree it verifies: the slot work
dir’s own .har/stages.json, its stage scripts and its
.har/hooks/pre-verify.sh, whichever checkout you run it from. A harness
change committed (or just edited) on the session branch is the one verified,
and the factory run and the Factory Commits proof list that file’s stages and
its digest. run-stage and har line gate --agent <id> (with the slot’s line
programs) do the same. Only when the work dir has no .har/stages.json — a
harness not committed yet — do they read the main checkout’s. What belongs to
the machine rather than the tree stays in the main checkout: the slot registry,
run records and validations, harness.env (ports, infrastructure,
HAR_FACTORY_PROOF), shared infrastructure state under HAR_HARNESS_DIR, and
personal local/ scripts and overlay stages. The verify banner prints the
stages.json it runs.
Default verify output is the live progress lines on stderr (and a one-line
summary). It does not reprint the machine JSON contract — that blob
duplicates step logs already shown. Use --json when a script needs the
structured result. Passing steps omit output; failed steps keep a truncated
excerpt. MCP har_run_verification returns the same slim shape.
Each verify keeps every stage’s combined stdout and stderr, capped to the last
1 MiB (a longer log starts with one [har] <N> bytes dropped, last <K> bytes kept line; the cap includes that line), in
.har/artifacts/<factory-run-id>/<stage-id>.log in the slot. Every verify is
a new factory run with its own id, log directory and trace, even when the tree
was verified before, so a failed verify followed by a passing one leaves two
runs. The validation record of the tree points at its latest run. The factory
run lists each stage’s log and the files the stage wrote under
.har/artifacts/ with their SHA-256, and a full verify’s Factory Commits proof
lists the same digests in stages[].artifacts[]. The factory run also records
the agent sessions that worked on the attempt up to the verify (plus those of
earlier runs of the same tree) and, with --line and --station (MCP line,
station), the factory line station it ran at.
har env launch records which agent session launched the slot in
~/.har/sessions/<agent-tool>/<session-id>.json (attempt, work unit, slot,
repository URL and branch; never paths). teardown and complete close the
attempt’s open segments in every session file, whoever runs them.
Factory lines after verify. Verify never runs a line and never asks about one. When lines are installed and verify passes, it lists them as an optional next step, each with the command that runs every station against the slot it just verified:
Optional next step — factory lines installed (not run by verify): alpha-line Alpha (S1 → S2, next: S2) har line gate S2 --line alpha-line --agent 1 example-line Example factory line (S1 → S2 → S3, all stations green) har line gate S3 --line example-line --agent 1 --forceWhat a line checks: har line describe <id>--force appears for lines that declare an opt-in env var. --json and MCP
har_run_verification return the same data as lines (lineId, title,
stationIds, nextStationId, allGreen, runAll: { station, force, command }).
Use har line describe <id> (MCP: har_line_describe) to decide whether a
line covers your change.
Doctor
Section titled “Doctor”har env doctor [--json]doctor validates the harness contract and exits 0 on pass, 1 on errors
(so it slots into CI): the running CLI is not older than manifest.cliVersion,
harness.env against the schema, stages.json against
the registry schema, every registered stage’s script/command file exists and is
executable, the lifecycle stages (launch/verify/teardown) resolve,
verificationStages ids resolve to registered stages, infra port lanes are
coherent (no overlaps, defaults inside scan ranges), env.template only
references variables launch substitutes, as plain $VAR / ${VAR} (anything
else — including ${VAR:-default} and other shell parameter syntax — is written
literally to .env.agent.<id>, reported as a warning), and slot registry entries point at
existing worktrees. Every finding carries a remedy. Doctor also runs
automatically inside har env maintain and before every launch — a broken
adaptation blocks the launch instead of failing mid-session. A stale CLI vs a
newer harness is a single upgrade error, not a list of missing lifecycle
scripts. Pre-1.0 harnesses
report contract findings as warnings until they migrate. On an ejected
harness, doctor additionally checks the vendored runtime exists and the
user-owned scripts are executable. MCP twin: har_doctor.
Eject and adopt
Section titled “Eject and adopt”har env eject [--yes]har env adopteject is the explicit, supported path for power users who want to own the
runtime: it vendors the complete HAR runtime bundle into .har/runtime/ —
no har on PATH, no npx fallback. Invoke it as
node .har/runtime/har.cjs env …. The choice is recorded in
.har/manifest.json (ejected, ejectedVersion). From then on the vendored
runtime is user-owned: maintain reports no upstream drift for it, and
upstream fixes reach it only by re-ejecting. Support covers issues
reproducible with the packaged runtime; changes made to an ejected runtime
are yours to maintain. Config surface files (harness.env, stages.json,
stages/, docs) stay managed either way.
adopt reverses it: removes .har/runtime/ and clears the manifest record,
preserving the config surface. Both commands are deliberately CLI-only (no
MCP twin) — runtime ownership is a human policy decision with an interactive
confirmation (--yes for automation).
Status and runs
Section titled “Status and runs”har env status [--json]har env logs 1 [service]har env run-stage 1 <stage> [args..] [--json]har env artifacts [--stage <id>] [--json]har env cleanup [--dry-run] [--yes] [--repo <path>] [--keep repo:agentId,/path/to/worktree] [--stale 7] [--orphans] [--include-review] [--json]har env runs list [--stage <id>] [--limit 50] [--json]har env runs get <uuid> [--json]status has one implementation on every surface: the structured collector
behind --json is the source, the text view is rendered on top, and MCP
har_get_status returns the same object. Status is a pure read — it writes no
run records. run-stage executes any stage registered in .har/stages.json
(the CLI twin of MCP har_run_stage). On a launched slot it runs a project
stage the way verify does: from the slot’s work dir with .env.agent.<id>
sourced (pinned Node, ports) and WORK_DIR / AGENT_ID / ENV_FILE exported.
artifacts is the twin of
har_list_artifacts.
cleanup scans every repo in ~/.har/repos.json (plus --repo when set),
classifies active slots and orphan directories under ~/worktrees, and runs
full harness teardown for approved rows. Use --dry-run to preview the plan;
pin live sessions with --keep har-portal:4 or a worktree path.
har line
Section titled “har line”har line create <id> [--stations S1,S2,S3] [--title <text>] [--description <text>] [--opt-in-env <VAR>] [--no-gate-stage] [--personal] [--force]har line add <id|./path|@org/pkg|github:org/repo> [--personal] [--force]har line promote <id> [--json]har line require <id> [--station <station>] [--json]har line unrequire <id> [--json]har line list [--scope team|personal] [--json]har line describe [id] [--json]har line gate <station> [--line <id>] [--agent <slot>] [--force] [--json]A factory line is a program: an ordered set of stations plus a cumulative gate. It composes what HAR already has — work units, slots, stages, plugins, skills, MCP — and is installed through the same channels as a plugin (path → git → bundled id → npm).
The difference is the apply path. Installing a line registers its stages in
.har/stages.json and records the install in .har/lines.json, but never
touches verificationStages. Default har env verify --full takes exactly as
long as it did before. Line gate stages run on demand:
har line gate S2 --line my-linehar line list is the inventory: each installed line’s title, first sentence
of its description, stations, progress and the command that runs every
station, plus the lines available to install. har line describe <id> shows
what a line checks and where it stands — description, stations with gate
progress, each gate stage with its description and last run, registered
stages, any stage that leaked onto the verify plan, and slots in flight — so
you (or an agent) can decide whether a line covers your change before running
it. Without an id it describes every installed line.
After a passing har env verify, the installed lines are listed as an
optional next step (see Verify and finish).
gate.stages[].fromStation is the ratchet: a stage tagged at a station is
required at that station and every later one, so growing a line can never
drop an earlier station’s checks.
har line create scaffolds a publishable bundle at .har/lines/<id>/
(line.manifest.json, line.json, an off-verify gate stage, README);
har line add <id> installs it. Publishing to git or npm later needs no format
change.
Lines have a scope. A team line (the default) lives in .har/lines/<id>/
and .har/lines.json, both committed. Pass --personal to create or add
to keep a line for your own workflow instead: it lives in .har/local/lines/<id>/
and .har/local/lines.json, its stage scripts are copied to
.har/local/stages/, and .har/local/ is gitignored (har env maintain adds
the rule to older harnesses). list, describe, gate and the line offer
after har env verify read both scopes and tag each line [team] or
[personal] (scope in --json). har line list --scope personal (or
team) shows only that scope. add and create say who will see the line:
only you, or your team and CI once you commit it. An id may exist in only one
scope; installing the same id in both is refused, and har env doctor reports
one made by hand.
A personal line’s stages go to the gitignored overlay .har/local/stages.json,
never to .har/stages.json, so installing one leaves every committed file
unchanged. HAR reads both files, so har line gate and har env run-stage run
overlay stages. The overlay can hold only stages, and har env verify reads
the committed file alone, so overlay stages never run on verify. A stage id in
both files is an error, never an override. Reinstalling a personal line from an
older HAR (har line add <id> --personal --force) moves its stage from
.har/stages.json into the overlay. har env doctor warns about any that are
left.
Git does not copy gitignored files into a new worktree, so a worktree slot has
no .har/local/ of its own. Inside a slot, HAR reads and writes the main
checkout’s .har/local/ instead, just as run records already live in the main
checkout. A personal line you install once shows up in every slot, and
installing one from a slot puts it in the main checkout. Its gate still runs in
the slot: the stage script comes from the main checkout, and it runs with the
slot’s work dir as its working directory.
har line promote <id> shares a personal line with the team. It moves the
line from .har/local/ into .har/lines/<id>/, copies its stage scripts to
.har/stages/, moves its stages from the overlay into .har/stages.json, and
moves its ledger entry into .har/lines.json. verificationStages is not
touched. The result is an ordinary diff; the command prints the files to
commit. It checks everything first and rolls back on a failed write, so a line
never ends up in both scopes. A line you only scaffolded with
har line create --personal can be promoted too. Promoting runs one way: there
is no demote, because teammates and CI may already rely on a team line.
har line require <id> [--station S] marks a team line as required up to
station S (default: its last station); har line unrequire <id> drops it.
The policy is a required block on the line’s entry in the committed
.har/lines.json — not in the line program, which is a shared bundle — and
har line add --force keeps it. har line list and describe show it. Only
team lines can be required: har env doctor fails on a required personal
line, on a required station the program does not have, and on a gate stage up
to the required station that is not registered in the committed
.har/stages.json.
Poka-yoke runs both ways: har env add-plugin refuses a line bundle, and
har line add refuses a verification-plugin manifest. If a check should gate
every verify, it is a plugin, not a line. har env doctor fails if a line
stage ever appears in verificationStages.
See the Factory lines guide.
har agents
Section titled “har agents”har agents install [--claude] [--cursor] [--codex] [--agents <targets>] [--force]har agents remove [--claude] [--cursor] [--codex]Without target flags, HAR detects supported agent directories.
har preferences
Section titled “har preferences”har preferences show [--json]har preferences configurehar preferences configure --cursor-rule <auto|on|off> --agents <auto|none|claude,cursor,codex> --commit-gate <prompt|always|never> --gate-mode <block|warn> --gate-scope <worktrees|all>Preferences are user-level defaults stored in ~/.har/preferences.json.
Repository policy remains visible and versioned in .har/stages.json.
har hooks
Section titled “har hooks”har hooks install [--repo .] [--force | --managed]har hooks uninstall [--repo .]har hooks status [--repo .] [--json]
har hooks install --claudehar hooks uninstall --claudeThe default installs the Git commit gate. When core.hooksPath points at a
managed directory (husky), it installs the workers and the proof setup, reports
the hooks that are not active and prints the block for each; --managed adds
those blocks to husky’s tracked .husky/<hook> files instead, and --force writes
into the core.hooksPath directory. See
Husky and other managed hooks.
--claude selects the Claude Code main-checkout edit guard instead. har hooks check and har hooks record-commit
are internal hook workers invoked by Git, not day-to-day commands. So is
har hooks commit-msg <file>, which is installed only when .har/harness.env
(in the main checkout) sets HAR_FACTORY_PROOF=notes+trailers.
Proofs are opt-in: install installs git-factory and runs git factory setup only
when HAR_FACTORY_PROOF is notes or notes+trailers; unset means off, whatever
git-factory is on the machine. When the mode no longer uses them, install
removes, and prints, what HAR added for proofs: the notes fetch refspec and
notes.rewriteRef (mode off), and the trailer commit-msg worker and HAR’s block in
the commit-msg git runs or in husky’s (any mode but notes+trailers). It never
touches refs/notes/factory. uninstall also removes that git config. status
shows the mode, and lists what is left from an earlier mode.
har proof
Section titled “har proof”har proof show [rev] [--repo .] [--json]har proof verify [rev|A..B] [--min-level L0|L1|L2|L3] [--allowed-signers <file>] [--accept-carried] [--repo .] [--json]har proof carry <original> [rebased] --base <rev> [--old-base <rev>] [--repo .] [--json]har proof sync [remote] [--no-push] [--repo .] [--json]har proof disable [--repo .]show and verify are read-only wrappers around the git-factory executable (HAR_FACTORY_PROOF_BIN,
else the copy HAR installs in ~/.har/factory-proof, else PATH) for Factory Commits
proofs. --json passes git factory’s JSON through. Otherwise HAR prints the
level and problems for each commit. --min-level defaults to L1, for a range
too. Exit codes come from git factory: 0 ok,
1 verification failed (a commit below --min-level, or problems), 2 usage or environment error (including a missing
git-factory). See Record Factory Commits proofs.
--accept-carried also accepts proofs carried across a rebase: level L1, printed as
(carried from <commit>). carry carries the passing proof of <original> onto its
patch-identical rebase (default HEAD) and writes it to the local note. --base is
the branch the rebased commit is based on. --old-base is the one the original was
based on (default: --base). carry exits 2 when it refuses. Both need
git-factory 0.3.0 or newer. See
Rebases and stacked pull requests.
sync runs git factory sync with the git-factory HAR manages (installing it
first if needed), so factory-proof need not be on PATH: it fetches the remote’s
factory notes (default origin) into refs/notes/remotes/<remote>/factory, merges
them into refs/notes/factory and pushes without force. --no-push stops after the
merge; --json passes git factory sync --json through. Its exit code is
git factory’s. It needs proofs enabled: with HAR_FACTORY_PROOF unset or off it
says so, installs and runs nothing, and exits 1; it exits 2 when no usable
git-factory 0.4.0 or newer is available. If you installed factory-proof yourself,
git factory sync does the same. With HAR_FACTORY_PROOF_PUSH=on in
.har/harness.env, har env complete runs it after each session. See
Push and fetch notes.
disable sets HAR_FACTORY_PROOF=off in the main checkout’s .har/harness.env
(commit it) and removes the notes fetch refspec, notes.rewriteRef and the trailer
commit-msg hook HAR added, printing each. Existing notes are kept. See
Turn proofs off.
har hq
Section titled “har hq”har hq connect [--portal <url>] [--api-key <key>] [--repo <path|url>]... [--scope off|usage|outline|full] [--content none|redacted|masked|raw] [--no-backfill] [--yes] [--json]har hq repos [list] [--json]har hq repos add [<path|url>...] [--scope off|usage|outline|full] [--content none|redacted|masked|raw] [--no-backfill] [--yes] [--json]har hq repos remove [<path|url>...] [--json]har hq status [--json] # alias: har hq listhar hq disconnect [--json]HAR HQ receives only the repositories you choose, each at its scope:
| Scope | HAR HQ receives |
|---|---|
off |
nothing |
usage |
records, proofs (verification verdicts), and the agent’s spans and metrics (tokens, cost); no stage logs or artifacts |
outline |
usage plus evidence (stage logs and artifacts) and the event records (every step and its timing), no agent text |
full |
outline plus the text, per --content: none (default), redacted, masked, raw |
connect logs in (on a TTY it asks Production, Development or a custom URL, then
opens browser SSO; --api-key stores a key instead). On a TTY it then asks which
repositories — this repository, the registered ones, and the ones attached in 1.x;
the current one and the 1.x ones pre-selected — and one scope for all of them, or one
per repository. With --scope, it chooses without asking: the --repo repositories
(repeatable; default the current repository). Without --scope on a non-TTY, or with
--yes, it only logs in and prints the exact har hq repos add command.
--content applies to --scope full only.
repos add adds or changes repositories (default: the current one), repos remove
removes them; add asks the scope on a TTY and fails with the exact command
otherwise. A local path is matched by its main checkout (worktrees and harnesses in a
subdirectory included) and by its origin; a URL by host and path. Agent telemetry
is matched by the repository URL only, so a repository without an origin sends
records and verification only.
Records are queued when they are made, and only for a repository HAR HQ receives at
that moment. So choosing a repository (repos add, connect with a choice, or
connect keeping the repositories chosen before) also sends what it ran in the last
14 days from the local records: the factory runs of har env verify with their
proofs, commit bindings and the stage logs and artifacts still on disk, plus the
attempts, work units and agent session segments. Each goes only at the chosen scope
(no evidence at usage). Receivers upsert by natural key, so what HAR HQ already has
is a no-op when it is sent again. The command says how many verify runs and sessions it sent.
--no-backfill sends only what runs from now on, and the command says so. Agent
telemetry (spans, metrics) is not backfilled. When the machine is not logged in,
nothing is queued; har hq connect sends it later.
HAR HQ identifies a repository by its remote, and so does the choice: every
checkout of a remote on the machine is sent, at one scope. repos add in a second
clone of a repository already chosen keeps the first clone and lists both; if it
names a different scope (or --content), that scope becomes the remote’s, for every
checkout, and the command names the other checkouts and the scope they had. repos remove in any checkout removes the remote, so every checkout of it stops sending,
and the command names them. status lists each remote once, with its checkouts: the
ones added and the registered harnesses with the same origin. A checkout without an
origin is its own entry, matched by path.
The CLI holds one HAR HQ org login at a time. Logging in to a different org
removes the previous org’s credentials and forgets the repositories chosen for it.
status shows the login (org + portal host, never tokens), the chosen repositories
and the local level, which caps every destination. disconnect removes the login and
its credentials and keeps the choice; agent telemetry stops going to HAR HQ at once
(the hook’s config and key file are rewritten). The first 2.0 command on a machine logged in by
1.x logs it out once (see Upgrading to 2.0).
Credentials stay in ~/.har/ and are never committed into .har/. The MCP server
has a read-only har_hq_status; logging in and choosing are human-only.
There are two ways to log in:
- Browser login (the default) is for a person at their own machine.
- A portal API key is for CI, a server, or any machine without a browser.
Create the key on the portal’s API key page; the key decides the org.
har hq connect --api-key <key>checks the key with the portal, prints the org it writes to, and saves nothing when the key is rejected (or when the portal cannot be reached to check it). The key is thehqdestination’s credential; it is never refreshed, so when it is revoked or expires, create a new one.
Either way, logging in sends nothing by itself: HAR HQ still receives only the
repositories you choose (--repo / --scope / --content, or
har hq repos add). In CI, HAR_PORTAL_URL and HAR_PORTAL_TOKEN (the key)
replace a stored login, and the repository still has to be in the hq
destination’s list.
har control login remains a deprecated alias for har hq connect.
har control
Section titled “har control”har control up [--build] [-d|--detach|--no-detach]har control downhar control register [--repo .] [--api-url <url>] [--dry-run] [--force] [--portal|--no-portal]har control unregister [--repo .] [--api-url <url>] [--yes] [--delete-worktrees] [--dry-run] [--json]har control reset [--yes] [--no-scrub-local] [--keep-registry] [--api-url <url>] [--dry-run] [--json]har control sync [--select] [--api-url <url>] [--dry-run] [--json]har control check-usage [--repo <path|id>] [--api-url <url>] [--json] [--limit 20]har control watch [--repo .] [--interval 10] [--api-url <url>]har control login [--portal <url>] [--api-key <key>] [--repo .]har control trajectory [on|off]login is a deprecated alias for har hq connect. Prefer har hq connect.
sync --select interactively chooses repositories, saved in
~/.har/sync-selection.json; once saved, automatic syncs also touch only those
repositories. register and opting into Mission Control during har onboard
add the repository to a saved selection. A repository left out is named once
(har control register or har control sync --select), and only while Mission
Control is running.
sync registers each repository with local Mission Control and sends its live slot
view, Mission Control’s two local endpoints outside the ingest contract; it no longer
sends anything to HAR HQ. --cloud (the 1.x upload to HAR_CLOUD_API_URL) was
removed in 2.0: passing it fails and points at har hq connect /
har telemetry destination add. Runs, work units,
factory runs, commit bindings, usage and the trajectory reach every receiver,
Mission Control included, as ingest v2 records and otel-hook OTLP. The CLI sends records and telemetry to HAR HQ
directly for the repositories chosen for it (har hq repos add).
Before syncing, sync moves a default har-control container that runs an
older released image up to this CLI’s image. It never downgrades: a container
on a newer release is left running, with a hint to upgrade the CLI. With
HAR_CONTROL_DISABLED=true, sync (and the background sync a slot change
starts) leaves the container alone and sends nothing.
trajectory only points to har hq repos in 2.0.
check-usage is read-only: Mission Control checks the usage invariants over
everything it holds (I1 a request is stored in one repository,
I2 a legacy session total is stored once, I3 a session’s rows hold exactly its
requests, I4 a slot is not the main checkout, I5 Cursor cache reads are counted
once), listing each violation with its keys, tokens and cost. It exits 1 on a
violation.
register --no-portal keeps the repo local-only: nothing of it is sent to HAR HQ
even when HQ is a destination; --portal lifts that.
trajectory records whether the connected HAR HQ org should receive the full
trajectory (agent prompts, tool arguments and tool results). The setting belongs
to the connected org and is stored with it in ~/.har/portal-targets.json;
switching org starts with it off. HAR_PORTAL_TRAJECTORY=on|off overrides it.
unregister removes the repository from Mission Control and ~/.har/repos.json.
Interactively it lists session worktrees and asks whether to delete them; pass
--delete-worktrees (with --yes in non-TTY) to remove worktrees via harness
teardown. Re-add later with har control register.
reset clears all Mission Control data (every repository and cascaded
rows), clears the unregister blocklist, scrubs local
.har/{runs,validations,state,slots} under registered repos (default), and
clears ~/.har/repos.json so the next register starts clean. Use
--no-scrub-local / --keep-registry to keep those. The same action is
available in the dashboard under Settings → Danger zone.
har telemetry
Section titled “har telemetry”har telemetry status [--json]har telemetry enable [--level full|outline|usage] [--agents claude,codex,cursor] (old name: on)har telemetry disable [--uninstall|--no-uninstall] (old name: off)har telemetry uninstallhar telemetry flush [--json]har telemetry install-hookshar telemetry write-env --agent-id <n> [--repo .] [--env-file path] [--work-dir path] [--branch name] [--suffix id] [--session-key key]har telemetry print-env --agent-id <n> [--repo .] [--work-dir path] [--branch name] [--suffix id]har telemetry destination add <name> --preset mission-control [--base-url url]har telemetry destination add <name> --preset hq [--base-url url] [--records] [--proofs] [--evidence] [--signals traces,logs,metrics]har telemetry destination add <name> --preset git-noteshar telemetry destination add <name> --preset langfuse [--host url] [--public-key pk] [--secret-key sk]har telemetry destination add <name> --preset otlp --endpoint url [--header Name=value]… [--signals traces,metrics,logs] [--protocol http/protobuf|http/json] (every preset:) [--include-local-paths] [--include-account-identity] [--no-include-session-id] [--disabled] [--overwrite]har telemetry destination list [--json]har telemetry destination remove <name>har telemetry destination test <name> [--json]har telemetry destination flush [--json]Controls how much agent activity (Cursor / Claude / Codex) is recorded, and where it goes. One level is stored; each includes the ones below it:
| Level | Records |
|---|---|
full |
Everything in outline, plus prompts, agent replies and tool inputs/outputs |
outline (default) |
usage, plus the trajectory: one row per prompt, generation, tool call and subagent with timing — no text |
usage |
Tokens per turn and per subagent from the agent hook (otel-hook spans and token metrics, no event records, no text), priced by the receiver |
off |
Nothing |
Consent. HAR registers its hooks in the global settings of Claude Code
(~/.claude/settings.json), Codex (~/.codex/hooks.json) and Cursor (~/.cursor/hooks.json)
only with consent recorded on this machine (agentHooks in ~/.har/telemetry.json). Until
then har env launch writes none of those files and prints one line saying how to enable
telemetry. A machine where an earlier HAR already installed its hooks is recorded as granted
(origin grandfathered) and keeps working. Hooks go only into the settings of agents
installed on this machine (their ~/.claude, ~/.codex or ~/.cursor exists); HAR never
creates those directories. Each time HAR changes one of those files it prints
what changed, diff-style, and before its first change it keeps a copy of the file under
~/.har/agent-settings/backups/.
enable records consent, stores the level (replacing the previous one outright), ensures
Mission Control is running, registers the hooks and rewrites the hook config; start a new
agent session to pick it up. Without --level it keeps the level in effect on this
machine: the one chosen earlier; else full on a machine whose hooks an earlier HAR
installed (consent grandfathered), so it records no less than before; else outline,
the same default as har onboard. It does not hook an
agent left out when you set up your agents (skipAgents, kept across disable); it says
which, with the command that hooks it. --agents codex adds agents: the ones it names
are hooked and their exclusion is cleared, every other agent keeps its state, and an
unknown name is refused. disable records the refusal, sets the level to off and stops
export; on a terminal it asks whether to remove the hooks too (--uninstall does it without
asking, --no-uninstall keeps them). uninstall does what disable does and removes every
hook entry HAR added, and only those: a file whose only change since HAR’s first edit was
HAR’s gets its original bytes back, a file HAR created is deleted, and any other file keeps
everything else in its own formatting. It reports each file, and lists the Claude Code
env keys HAR 1.x wrote (Claude Code native metrics to Mission Control) that HAR 2.0 removed:
those are not put back, since restoring them would keep sending telemetry after an uninstall. --prompts
/ --no-prompts remain as spellings of full / outline. status prints the level, the
hook consent, every agent settings file HAR has touched (with its backup), the otel-hook
version, the agent route (Agent traces: → mission-control, langfuse, then one line per destination
with its endpoints), where verification traces go, each destination’s OTLP health
(queued batches, recent drops, last failure), and one line per destination for records,
proofs and evidence (queue depth, last success, last error). It warns when
~/.har/otel-hooks/otel_config.json records something else (for example a preference
edited by hand). --json keeps otelEndpoint and adds agentTraces.destinations,
agentTraces.targets, verificationTraces, destinationHealth, ingestQueues and
agentHooks (consent, otel-hook version, files).
Header values are never printed. Override with HAR_TELEMETRY=<level> or HAR_TELEMETRY=0|1.
Destinations: one list for everything HAR sends
Section titled “Destinations: one list for everything HAR sends”har telemetry destination keeps one destination list in
~/.har/destinations/destinations.json (mode 0600; override the directory with
HAR_DESTINATIONS_DIR). Each entry says what it accepts: OTLP signals (traces, logs,
metrics) and, for ingest v2 receivers, records, proofs and evidence.
| Preset | OTLP signals | Records, proofs, evidence |
|---|---|---|
mission-control |
traces, logs, metrics (Mission Control books Claude Code usage from Claude Code’s own telemetry and drops its otel-hook metrics) | yes, at HAR_CONTROL_API_URL + /api |
hq |
traces, logs, metrics | yes, at its ingest base URL |
git-notes |
— | proofs only, as factory notes on each commit (opt-in) |
otlp |
any (default traces, metrics) | no |
langfuse |
traces | no |
Mission Control is in the list by default while it is enabled; remove mission-control
keeps its entry, disabled, so it does not come back. A 2.0 prerelease
telemetry.json is migrated on first read (renamed telemetry.json.migrated).
--preset hqtakes the ingest base URL from--base-url,HAR_HQ_INGEST_URL, or the HAR HQ connection. The ingest key is never stored in the list: it is read at send time fromHAR_PORTAL_TOKENor the connection (har hq connect), sent asAuthorization: Bearer …, and handed to otel-hook only as anenv:header reference whose value lives in~/.har/otel-hooks/direct.env(mode0600). Anhqdestination is always scoped per repository (itsrepositories, edited withhar hq repos): it sends nothing until a repository is chosen, and replacing it with--overwritekeeps the choice.--preset langfusesends traces to<host>/api/public/otelwithAuthorization: Basic base64(public:secret). Langfuse ingests OTLP traces only. The keys default toLANGFUSE_PUBLIC_KEY/LANGFUSE_SECRET_KEY, the host toLANGFUSE_BASE_URL,LANGFUSE_HOSTorhttps://cloud.langfuse.com.--preset otlptakes a base--endpoint(signals go to<endpoint>/v1/<signal>), any--header Name=value, andtracesandmetricsunless--signalssays otherwise. Logs are opt-in: namelogsin--signalsto receive them. At thefulllevel they carry prompts, replies and tool input/output verbatim, andaddprints a warning.--preset git-notesnames factory notes (refs/notes/factory) as a proof destination. Notes are written only in a repository whoseharness.envsetsHAR_FACTORY_PROOF=notes|notes+trailers: the destination alone does not turn proofs on. Notes stay local:har proof syncfetches the remote’s notes, merges them with yours and pushes, and never deletes or rewindsrefs/notes/factory; in a fresh clone,har proof sync --no-pushbrings them in beforehar proof verify. See Push and fetch notes.- Attributes that hold absolute local paths (every
factory.local.*key,process.cwd,code.filepath, …) are stripped for every destination, Mission Control included: work identity is stamped from the session context, not from paths.--include-local-pathskeeps them for a destination; agent telemetry keepsfactory.local.*only when every destination opts in (one hook process has one Resource). - Account identity attributes (
user.email,user.account_uuid,user.account_id,user.id,organization.id,enduser.id, …) are stripped from what the CLI sends; HAR turns no agent’s native telemetry on, so agent telemetry (otel-hook) carries none.--include-account-identitykeeps them for that destination. --no-include-session-idleavessession.idoff metric points, for backends where one series per session is too many. otel-hook has one setting for every destination, so one destination turning it off turns it off for all.
list shows each entry with what it accepts and its queue. test checks a receiver’s
GET v2/capabilities and sends one small OTLP/JSON record to its OTLP side.
Guides: Langfuse, any OTLP backend.
Agent telemetry. HAR writes otel-hook’s config (~/.har/otel-hooks/otel_config.json)
from the list: one exporter.destinations[] entry per destination with its signals,
providers.claudeCode.readTranscriptUsage: true (hooks carry no token counts),
and sessionContext.dir set to ~/.har/sessions (or HAR_SESSIONS_DIR). Work identity
(factory.work_unit.id, factory.attempt.id, factory.slot.id) is stamped by otel-hook
from the session context only, never from the agent’s environment: telemetry outside
any segment (before launch, after complete) carries none. HAR installs otel-hook
0.12.0; HAR_OTEL_HOOKS_PACKAGE names another package spec (a version, a local .tgz
or a directory) to test an unreleased build.
Records, proofs and evidence. The CLI sends them directly to every ingest v2
receiver in the list (ADR 0005, ingest contract v2):
after launch (work unit, attempt, session segments), on teardown / complete
(closed segments, the attempt’s end), on verify (factory run, stage results, then the
proof’s DSSE envelope, then — after a full verify, passing or failing — the stage logs and
artifacts the receiver lacks, via v2/evidence/missing), and from the post-commit hook (the
commit binding). Choosing a repository for HAR HQ also queues its last 14 days of these
records (see har hq; --no-backfill skips it). Factory lines go on har line create|add|promote and when a repository is
chosen for HAR HQ, and each team line’s har line gate run after it finishes — only to
HAR HQ once it lists them in capabilities.extensionRecordTypes; until then they wait in its
queue, up to 14 days. Each destination has its own retry queue in ~/.har/queue/<destination>/
(override HAR_INGEST_QUEUE_DIR): evidence bytes are copied into it at verify time, so
deleting a slot’s work dir loses nothing. Receivers upsert by natural key, so a resend
is a no-op. Sending never blocks verify, commit or teardown; every har command drains
what is due within about 1.5 s, and har telemetry flush sends everything now (exit 1
while something is still queued, line records waiting for HAR HQ aside). Entries a receiver rejects (HTTP 400/413/422) move to
dead/; entries older than 14 days expire. har env doctor adds one line per receiver
with its queue and whether it answers GET v2/capabilities, and names a receiver that
does not support ingest v2 yet.
Verification spans. Each har env verify (and MCP har_run_verification) builds
one OTel CI/CD trace: a run span (cicd.pipeline.*, factory.run.id, factory.git.tree,
factory.verdict on --full) with one child span per stage, plus the work unit,
attempt, repository and branch on the resource. The trace id is
sha256("factory-run:" + validation id), first 32 hex characters, so the proof and the
Factory-Run trailer (; trace=<trace-id>) can name it before it is exported, and it
sits next to the agent’s session traces in the same backend.
Spans carry ids, results, timings and the verify policy (factory.policy.id,
factory.policy.digest on --full): no commands or logs. The CLI sends one copy to
Mission Control (when its entry takes traces), and one to every other destination
subscribed to traces (about 3 s each, in parallel), and queues each copy that was not
taken, for that receiver alone, in ~/.har/spool/traces (64 MB, 24 h), so every
receiver gets each trace exactly once. Local paths are never sent to a destination or
the spool. Delivery never changes verify’s result; a failed delivery prints one dim
line, and a queued one another. har telemetry off sends none.
flush (har telemetry flush, or destination flush) sends both queues now and prints
how many were sent, retried, rejected (or withdrawn, or expired) and left, and apart from
those the line records held for HAR HQ until it takes them.
har worktree
Section titled “har worktree”har worktree status [--json] [--repo .]har worktree off [--global] [--repo .]har worktree on [--global] [--repo .]har worktree reset [--global] [--repo .]Your personal choice between launching slots in an isolated session worktree
(default) or in the checkout itself. off / on apply to the current
repository (keyed by its main checkout path), or to all repositories with
--global; reset clears that setting. Stored in ~/.har/preferences.json.
A launch resolves the mode once, highest first:
--worktree/--no-worktree, or the MCPworktreeparameterHAR_WORKTREE=on|off- your setting for this repository
- your setting for all repositories
HARNESS_USE_WORKTREEin.har/harness.env(the team default)- on
har env launch, har env status, har env doctor and har worktree status
print the effective mode and which of these decided it; status --json and the
MCP launch result carry it as worktreeMode. har env recover keeps the mode
the slot was launched with. There is no MCP tool for this setting.
har error-reporting
Section titled “har error-reporting”har error-reporting status [--json]har error-reporting onhar error-reporting offAnonymous crash reports from the CLI and MCP server to the HAR maintainers’ Sentry project.
This is a different thing from har telemetry, which exports agent telemetry only to the
destinations you configure (Mission Control, HAR HQ, your own OTLP endpoints).
- Sent: the error message and stack trace, the HAR command (at most two words, such as
env verify; never its arguments), the HAR, Node.js and OS versions, and a random install id for counting affected installs. Your home directory is replaced with~, and the host name is dropped. - Not sent: command arguments, file contents, prompts, environment variables.
- Default: on in the published npm package. The first run says so once on stderr. Opt out
with
har error-reporting off,HAR_ERROR_REPORTING=0orDO_NOT_TRACK=1. The choice is stored in~/.har/error-reporting.json. - Source builds: the Sentry DSN is set at build time.
npm run buildwithoutHAR_SENTRY_DSNreports nothing, andHAR_SENTRY_DSN=<your DSN> npm run buildreports to your own Sentry project.
har mcp
Section titled “har mcp”har mcp [--repo /default/repository]Starts a stdio MCP server. Logs go to stderr so stdout remains valid protocol traffic.
