Upgrading to 2.0
HAR 2.0 makes HAR a producer of open standards: standard OpenTelemetry that any OTLP backend can read, and Factory Commits proofs recorded in git. Both are correlated by the same keys: work unit, attempt, factory run, git tree, commit and trace.
The major version marks these breaks:
- the removal of every
har.*telemetry attribute in favor of OpenTelemetry semantic-convention andfactory.*names (removed attributes); - one destination list, and records sent directly to every receiver (ingest
v2): Mission Control and HAR HQ no longer relay for each other, and
har control syncno longer sends to HAR HQ (see below); - Claude Code usage and trajectory come from otel-hook only: HAR no longer turns on Claude Code’s native telemetry (see below);
- Mission Control 2.0 stores the v2 data model: it migrates its database in
place on first start, keeps a backup, and no longer has the 1.x
/api/repos/<id>/…record routes; - factory notes are opt-in (what changed by default).
A few behaviors also change without breaking a command: every stage has a time limit, a stage killed by a signal fails, and every verify is its own factory run (verification behavior changes).
Most commands, MCP tools and config keys keep their names. Everything a 1.x user may have to act on, removed flags and variables included, is in one table: Breaking changes.
Which 1.x you are on. The newest 1.x on npm is 1.31.0: versions 1.32.0 to 1.43.0 were tagged on GitHub but never published to npm or Docker Hub. So if you installed HAR from npm, you upgrade from 1.31.0 or older, and the table includes what changed between 1.31 and 1.43 as well.
Upgrade checklist
Section titled “Upgrade checklist”Upgrade the CLI and Mission Control together: Mission Control 2.0 reads only the 2.0 attribute names and records.
npm install -g @osfactory/har@latest # the CLIhar control up # Mission Control on the same version; migrates its databasehar telemetry install-hooks # re-register the agent hooks with otel-hookhar env maintain # in each repository with a .har/ harnesshar env doctor # destinations, queues, receivershar env verify 1 --fullThen start new agent sessions: a Claude Code session that was already running keeps the hook settings it started with.
What har env maintain asks
Section titled “What har env maintain asks”Run in a repository last maintained by 1.x (it reads cliVersion in
.har/manifest.json), har env maintain starts with a short 2.0 announcement and
the changes that apply to that repository: the verify changes (a 30-minute stage
time limit, signal-killed stages fail, stdin closed), a .har/lib/verify-runner.mjs
it deletes when it is the stock copy, every removed HAR_* variable still set in
the environment or named in .har/harness.env, a CI workflow, package.json or a
Makefile, har control sync --full|--cloud in those files, the HAR HQ logout, and
that proofs are opt-in. It lists the questions it will ask, then asks each one once,
before it changes anything and before it prints the maintenance or migration prompt.
The questions are the open steps of har onboard,
in the same order and with the same screens (Step n of N); a step already answered
is skipped. Crash reports come last, after the harness is updated:
| Question | Answers | Recorded in |
|---|---|---|
| Your agents (only for an installed agent this repository never answered about: a 1.x repository, an agent installed since onboarding) | set it up (the workflow is in AGENTS.md; no skills question); or leave it out |
agentsAnswered in .har/manifest.json; a left-out agent in skipAgents in ~/.har/telemetry.json |
| Telemetry consent | yes, no | agentHooks in ~/.har/telemetry.json (origin maintain; har onboard --yes records onboard-yes) |
| How much (only on a yes, and only when no level was chosen) | Full, Outline (default), Usage | level in ~/.har/telemetry.json |
| Where (on a yes, or when telemetry is on and recorded nowhere) | Mission Control on this machine; else the hosted HAR HQ portal; else nowhere yet | Mission Control is started; HAR HQ’s repository list |
| Commit gate | off, warn, block |
commitGate in .har/stages.json (recordedBy: maintain) |
| Proofs | off (default), notes, notes+trailers |
HAR_FACTORY_PROOF in .har/harness.env |
| Where proofs are stored (only when proofs are on) | local notes (always), pushed with the repository, HAR HQ | HAR_FACTORY_PROOF_PUSH (on or off) in .har/harness.env; HAR HQ’s repository list |
| Crash reports | on (default), off | ~/.har/error-reporting.json |
- Your agents. Onboarding’s step 3, asked only about the agents installed on
this machine that this repository never answered about: neither skills installed
(
scaffoldedAgentFiles), nor recorded as answered, nor left out on this machine. The agents already set up keep their skills. An agent you leave out gets no HAR skills and no telemetry hook;har telemetry enable --agents <name>hooks it later. - Commit gate. HAR’s pre-commit hook checks that the change being committed
passed a full verify.
warnlets an unverified commit through with a warning;blockrefuses it in agent slots and warns in the main checkout (setcommitGate.scopetoallto block there too).HAR_SKIP_GATE=1orgit commit --no-verifybypasses it. - Proofs. Turning them on installs a pinned
git factoryunder~/.har/factory-proofand adds a notes fetch refspec andnotes.rewriteRefto the repository’s git config; each passing full verify then writes a git note on the commit (refs/notes/factory), andnotes+trailersalso adds trailers to commit messages. Answeringoffremoves the git config and trailer hook HAR added for proofs; notes are kept. - Where proofs are stored. Local notes are always written. With notes pushed,
har env completerunshar proof syncafter each session (fetch, merge, push; never forced, never deleting); a failed sync is a warning. HAR HQ adds this repository to the hosted HAR HQ portal at scopeusagewhen this machine is connected; otherwise the checklist says to runhar hq connect. - Telemetry consent. “See what your agents did, step by step, and what it
cost”: the step shows the recorded consent, then asks. Yes records consent; the
next
har env launch(orhar telemetry enable) installs the hooks. No sets the level tooffand stops export; hooks already in your agents’ settings stay untilhar telemetry uninstall. A machine whose 1.x hooks were kept without a question (origingrandfathered), or whose consenthar onboard --yesrecorded without asking (originonboard-yes), is asked once. After a yes it asks where, as onboarding does: Mission Control on this machine; if not, the hosted HAR HQ portal (signing in opens your browser, and this repository is added at the chosen level); if not, it says the sessions are recorded nowhere yet, with the fixes. Choosing HAR HQ for a repository with no URL remote (noorigin, or a local path) says at once that HQ will get its runs and proofs but not its agent sessions, because otel-hook matches a session to a repository by its remote URL. The fix:git remote add origin <url>(orgit remote set-url origin <url>), thenhar hq repos add . --scope <level>. The summary’s “Traces go” line repeats it, and a later maintain prints it instead of asking “where” again. - Where telemetry goes. Asked on its own when the consent is already answered
but telemetry is on and recorded nowhere: no Mission Control set up on this
machine and no destination (HAR HQ included). That is how an install from 1.x, or
one whose Mission Control never ran, gets the HAR HQ offer. Once anything receives
the sessions it is not asked again. Where telemetry goes and what you can add
(Langfuse, an OTLP backend, HAR HQ) is in
har telemetry status. - Crash reports. The error, its stack trace, the command or tool name, the HAR
version and the OS go to the HAR maintainers; never arguments, repository content,
file contents or prompts. Only published builds ask, and
DO_NOT_TRACKorHAR_ERROR_REPORTINGdecide without a question. Change it later withhar error-reporting on|off.
Only open questions are asked. A recorded answer is never asked again and never
changed, unless a flag names a new one; a gate you turned off stays off, and commit
hooks you removed are not reinstalled. A later har env maintain on a repository
where everything is recorded asks nothing.
--yes, or a run without a terminal, asks nothing, keeps every feature as it is and
turns on nothing new. Its summary says what is not chosen yet: a commit gate set
to block in .har/stages.json without the gate hooks installed reads “nothing is
checked”, since nothing enforces it; crash reports, when they were never asked,
are one summary line (what is sent and how to turn them off) instead of a notice
at the top. The maintenance and migration prompts are saved to
.har/ADAPT-PROMPT.md and .har/MIGRATE-PROMPT.md; maintain prints the path, the
length and what the prompt does, then offers to copy it to the clipboard on a
terminal where a clipboard works (not on Linux without a display). --yes never
copies to the clipboard, in maintain and onboard alike. When agent sessions reach
nothing, maintain ends with a checklist item that says how to fix it. A 1.x
commit gate is offered at the mode .har/stages.json records, even before its
hooks are installed.
Flags answer for scripts (--telemetry also takes a level:
full, outline or usage):
har env maintain --yes --commit-gate warn --proofs notes --proofs-push \ --telemetry on --error-reporting onEvery run ends with one line per feature, its state and the command that changes
it. An upgrade from 1.x adds a checklist: commit .har/, the files that still use
removed variables or flags, har hq connect when needed, har proof sync for notes
you already have when they are pushed, new agent sessions when telemetry changed,
and one full verify on 2.0.
Optional steps
Section titled “Optional steps”Depending on what you want:
# Record prompts, replies and tool input/output (the full trajectory) locallyhar telemetry on --level full
# Send chosen repositories to HAR HQ (the upgrade logs a 1.x login out; see below)har hq connect
# Write a proof of each full verify as a git note on the verified commit (opt-in):# sets HAR_FACTORY_PROOF=notes (or notes+trailers) in .har/harness.envhar env maintain --proofs notes --proofs-pushhar proof sync # push and fetch the notes now; --proofs-push makes har env complete run it
# Send a copy to Langfuse or any OTLP backendhar telemetry destination add langfuse --preset langfuse --host <url> --public-key <pk> --secret-key <sk>har telemetry destination add collector --preset otlp --endpoint <base OTLP/HTTP URL>Breaking changes
Section titled “Breaking changes”Each row is something that behaves differently after npm install of 2.0 if you do
nothing else. “1.x” means 1.31.0, the last 1.x on npm, unless a row says otherwise.
| What changed | Who is affected | What to do |
|---|---|---|
har control sync --full is removed. It exits 1 with Unknown argument: full. |
Scripts and CI jobs that pass --full. |
Drop the flag. Records no longer go through sync: the CLI sends them to Mission Control directly, and har telemetry flush sends what is queued now. See har control sync sends only registration and slots. |
har control sync --cloud is removed. It exits 1 and points at the replacement; HAR_CLOUD_API_URL and HAR_CLOUD_API_KEY are no longer read. |
Anyone who uploaded to a hosted receiver with --cloud. |
har hq connect for HAR HQ, or har telemetry destination add for another receiver. |
14 HAR_* environment variables are gone, and .env.agent.<id> no longer sets HAR_SESSION_KEY. A removed variable is ignored without a warning. |
Anyone who sets one in a shell profile, .har/harness.env, CI or a script, or reads HAR_SESSION_KEY. |
Remove them; the replacements are in Removed environment variables. |
har line status is now har line describe (MCP: har_line_status is now har_line_describe). har line status exits 1. This changed in 1.32, which was never on npm. |
1.31 users, and agent prompts or scripts that call it. | Use har line describe [id]. |
Every verify stage has a 30-minute time limit. A stage that runs longer is stopped and fails with exit code 124 (reason timeout). 1.x waited forever. |
Stages that legitimately run longer than 30 minutes. | Give the stage a timeoutMs in .har/stages.json, or set HARNESS_STAGE_TIMEOUT_MS in .har/harness.env. See Verification behavior changes. |
| A stage killed by a signal fails (exit 128 + the signal number). 1.x recorded it as passing. | Verifies that passed on 1.x because a stage was killed (OOM killer, a crash, an external kill). |
Fix the stage; there is nothing to configure. |
| Stages run with stdin closed, in their own process group. | Stages that read from the terminal, for example a prompt. | Make the stage non-interactive (a flag, CI=1, a default answer). |
.har/lib/verify-runner.mjs is no longer run. Verify runs the stage runner in the package unless the harness is ejected. |
Every repository set up by 1.x. A copy you edited loses its edits silently. | Run har env maintain: it deletes the stock copy (commit the deletion). har env doctor points at an edited copy: move the change into a stage or a hook, or run har env eject to own the runtime. |
The ./.har/*.sh lifecycle scripts stay retired. Nothing new in 2.0: agent-slot.sh, provision-toolchain.sh, simulator.sh, lib/infra.sh, lib/node-pm.sh and the wrappers launch.sh, verify.sh, teardown.sh, setup-infra.sh, preflight.sh, agent-cli.sh and attach.sh were retired in 1.0, and 1.31 does not write them. |
Harnesses set up before 1.0, and docs or agents that still call those scripts. | Call har env launch, verify, teardown and so on. har env maintain removes HAR’s own leftover wrappers, and har env maintain --migrate the pre-1.0 scripts (backups in .har/migrate/backup/). |
You are logged out of HAR HQ on the first 2.0 command, once, with one [har] line. CI that sets only HAR_PORTAL_TOKEN sends nothing until repositories are chosen. |
Machines and CI jobs that sent to HAR HQ with 1.x. | har hq connect, then choose repositories and a scope; in CI, har hq connect --api-key "$HAR_PORTAL_TOKEN" --repo . --scope usage --yes. See HAR HQ is opt-in per repository. |
har hq connect --trajectory no longer applies: it is hidden and only warns. har control trajectory only points to har hq repos. |
Anyone who forwarded the full trajectory to HAR HQ. | Choose the scope instead: har hq connect --scope full --content raw (or redacted, masked). |
Proofs are opt-in. Unset HAR_FACTORY_PROOF means off, and a git-factory found on the machine never turns proofs on or triggers an install. |
No 1.x user (1.x had no proofs). Users of a 2.0 prerelease up to 2.0.0-next.19 with a git-factory installed, whose verifies wrote attestations. |
Nothing, to keep proofs off. To turn them on: har env maintain --proofs notes (or HAR_FACTORY_PROOF=notes in .har/harness.env, then har hooks install). See What changed by default. |
HAR asks before it edits your agents’ settings. It writes ~/.claude/settings.json, ~/.codex/hooks.json and ~/.cursor/hooks.json only with consent recorded in ~/.har/telemetry.json. A machine where an earlier HAR registered its hooks counts as consent, and every change HAR makes to those files is printed. Without consent, launch writes nothing there and says how to enable. har telemetry on and off are now enable and disable (the old names still work). |
Machines that never had HAR’s agent hooks, for example with telemetry off in 1.x: they record no agent usage until you enable. | har telemetry enable to allow it. To stop: har telemetry disable; to remove HAR’s hook entries and restore the files: har telemetry uninstall. |
A running 1.x Mission Control is not upgraded by the CLI upgrade. It cannot take 2.0 records, which wait in ~/.har/queue/. har env launch warns and names the command, but never replaces the container itself. |
Everyone who runs Mission Control. | har control up: it starts the 2.0 image, which migrates the database in place and keeps a backup. See Rolling back. |
Every har.* telemetry attribute is removed, with no dual emission. |
Dashboards, alerts and queries on har.* keys. |
Use the 2.0 names. |
HAR no longer turns on Claude Code’s native OpenTelemetry export, and removes the keys it wrote to ~/.claude/settings.json. Mission Control ignores claude_code.* metrics. |
Anyone who read Claude Code’s native metrics or api_request events. |
Nothing; usage comes from otel-hook. Start new Claude Code sessions. See Claude Code usage and trajectory come from otel-hook only. |
Removed environment variables
Section titled “Removed environment variables”| Variable | Replacement |
|---|---|
HAR_CLOUD_API_URL, HAR_CLOUD_API_KEY |
har hq connect, or har telemetry destination add |
HAR_SYNC_ALLOW_USAGE_VIOLATIONS |
None: har control sync no longer relays to HAR HQ |
HAR_SYNC_MAX_BATCH_BYTES, HAR_SYNC_MAX_BATCH_ROWS (1.32+), HAR_SYNC_OVERLAP_MS |
None: har control sync no longer posts records |
HAR_CONTROL_READ_PAGE_SIZE, HAR_CONTROL_READ_TIMEOUT_MS |
None: nothing reads records back from Mission Control |
HAR_PORTAL_SYNC_STATE_PATH, HAR_OBSERVATION_LEDGER_PATH |
None. Records wait in per-destination queues instead: ~/.har/queue/, moved with HAR_INGEST_QUEUE_DIR |
HAR_CLAUDE_PROJECTS_DIR, HAR_CODEX_SESSIONS_DIR, HAR_TRANSCRIPT_CACHE_BYTES, HAR_TRANSCRIPT_INDEX_PATH |
None: the transcript and rollout harvest is gone, and usage comes from otel-hook |
HAR_SESSION_KEY (no longer written to .env.agent.<id>) |
session.id in OTEL_RESOURCE_ATTRIBUTES |
No HARNESS_* key was removed. New keys include HARNESS_STAGE_TIMEOUT_MS and
HAR_FACTORY_PROOF.
What happens automatically
Section titled “What happens automatically”You do not need to do anything for these; each happens once, on the first 2.0 command that needs it.
- You are logged out of HAR HQ. A machine logged in to HAR HQ with 1.x is
logged out on the first 2.0 command, with one notice line, and nothing is sent to
HAR HQ until you log in again with
har hq connectand choose repositories and a scope. Your 1.x repositories and trajectory choice are only pre-selected at that login. Details in HAR HQ is opt-in per repository. - HAR’s Claude Code native telemetry keys are removed. The next time HAR
configures the agent hooks (
har telemetry install-hooks,har telemetry enable, or a slot launch on a machine whose hooks HAR may edit; see Breaking changes), it deletes theCLAUDE_CODE_ENABLE_TELEMETRYandOTEL_*keys that an earlier HAR wrote into~/.claude/settings.json. It removes only the keys it recorded writing, and only while they still hold the value it wrote: a key you set or changed yourself is left alone. - otel-hook is upgraded. HAR installs
@osfactory/otel-hook@0.15.1in place of an older copy on the next launch orhar telemetry on, and registers the Claude Code hook with--claude-transcript-usage --logs --metricsand the Codex hook with--codex-rollout-usage. - HAR installs
git factory, only for a repository that enables proofs. When.har/harness.envsetsHAR_FACTORY_PROOF=notesornotes+trailers,har env launchandhar hooks installput@osfactory/factory-proof@0.4.0in~/.har/factory-proofand use it ahead ofPATH. A global install is no longer needed:har proof syncruns that copy.HAR_FACTORY_PROOF_BINstill wins. Agit-factoryfound on the machine never enables proofs or triggers an install. - Verify runs the packaged stage runner. A repository set up by 1.x has a copy
of the stage runner committed in
.har/lib/verify-runner.mjs; 2.0 no longer runs it (it captures no stage logs), and runs the one in the package instead, unless you ejected the runtime (har env eject).har env maintaindeletes the stock copy (commit the deletion);har env doctorpoints at a copy you edited.har env maintainleaves yourverificationStagesas they are. - Mission Control migrates its database in place. On its first start, a
Mission Control 2.0 container that finds a 1.x database snapshots it to
har_control.db.v1-backup(in thehar_control_datavolume, next tohar_control.db), builds the v2 database next to it, copies every row across and swaps it in with one rename. Nothing is deleted: the 1.x data stays in the backup, and a start that is interrupted before the swap leaves the database untouched and starts over. If a backup already exists, the new one gets a timestamp suffix. See Rolling back. - A prerelease
telemetry.json(2.0.0-next) is migrated to the destination list on first read.
What’s new in 2.0
Section titled “What’s new in 2.0”This section is the curated summary of the release; the GitHub release notes link here. The generated list of every change is in the changelog.
- OTLP destinations, fan-out at the producer.
har telemetry destination add|list|remove|test|flushsends a copy of HAR’s telemetry to Langfuse or any OTLP backend (an OpenTelemetry Collector, Datadog, …). The producers send to each destination themselves, with a retry spool per destination: the agent hook (otel-hook’sexporter.destinations[]) and the CLI (verification traces). Mission Control is one destination among them; it stores what it receives and forwards nothing. Nothing leaves the machine until you add a destination. See How telemetry reaches a destination. - Verification spans. Each
har env verifyemits acicd.pipeline.runspan with one task span per stage, carrying ids, results, timings and the verify policy (factory.policy.id,factory.policy.digest, as in the proof). The CLI sends one copy to Mission Control, which stores it as a verification run, and one to every destination subscribed totraces. A copy that was not taken is queued for that receiver in~/.har/spool/tracesand retried at the next verify or launch, orhar telemetry destination flush, so each receiver gets each trace exactly once. See How verification traces are delivered. - Semantic-convention attributes. Agent sessions and verification traces carry
factory.*,vcs.*,cicd.*andgen_ai.*attributes from the Factory Commits telemetry profile, in place of thehar.*ones (see Removed telemetry attributes). - One destination list. Everything HAR sends — OTLP signals, records, proofs and
evidence — goes to the entries of one list,
~/.har/destinations/destinations.json:mission-control,hq,git-notes,otlpandlangfusepresets, each saying what it accepts. otel-hook gets oneexporter.destinations[]entry per destination, with the keys in a0600file. Without Mission Control the list simply has no enabledmission-controlentry. A prereleasetelemetry.jsonis migrated on first read. See otel-hook 0.15.1 installed, 0.12.0 required. - Records go straight to every receiver. The CLI sends work units, attempts,
session segments, factory runs, stage results, commit bindings, proofs and stage
evidence to Mission Control and HAR HQ directly (ingest v2), each through its own
retry queue in
~/.har/queue/<destination>/. Everyharcommand drains what is due;har telemetry flushsends everything now. Stage evidence (each stage’s log and the files it wrote under.har/artifacts/) is sent after a full verify, passing or failing, where the repository’s scope takes it (outline,full). Factory lines andhar line gateruns of team lines go to HAR HQ once it lists them in its capabilities; until then they wait in the queue (up to 14 days). - Work identity from the session context. HAR writes which work unit, attempt
and slot each agent session is working on to
~/.har/sessions, as time segments, and otel-hook stamps the segment in force on every span, log record and metric point. A session that joins or leaves a slot is attributed correctly from that moment, and telemetry outside any segment carries no work identity. - Trajectory from otel-hook. Every receiver, HAR HQ included, builds the agent trajectory (steps, tool calls, subagents) from otel-hook’s log records, and books usage from its generation spans.
- Destination health.
har env doctorandhar telemetry statusreport what each destination has queued or dropped and when it last failed, for examplelangfuse: 7 batches queued, last failure 2 min ago (ECONNREFUSED). See Destination health. - Commit gate names both ids. The gate’s pass line reads
har: tree 810a0e26 verified — Factory run 8ec3a247 (proof), verify run 93892f28: the Factory run id is the validation id that the proof (predicate.run.id) and the traces (factory.run.id) carry; the verify run is HAR’s record of the onehar env verifyinvocation. 1.x printed only the latter, asverified by run. - Factory Commits proofs. A full verify becomes an in-toto
factory-runstatement for the exact verified tree. The commit of that tree gets it as a note inrefs/notes/factory, and optionally as trailers.har proof show|verify(MCP:har_proof_show,har_proof_verify) reads them. The predicate carries the verification trace id when that trace is exported, so a proof leads to its trace. The trace id issha256("factory-run:" + run id), first 32 hex characters, as the Factory Commits telemetry profile derives it (2.0.0-next prereleases hashed"har-verify:" + id), and theFactory-Runtrailer carries it:Factory-Run: <run-id>; trace=<trace-id>. Proofs needgit-factoryfrom@osfactory/factory-proof0.2.0 or newer (HAR installs 0.4.0), and are alwaysself-reported: they say what this checkout reports, not that an independent runner checked it. See Record Factory Commits proofs. - Proofs survive a rebase. Rebasing a stack onto a moved base used to drop
every proof, even when each change was identical.
har proof carry <original> [rebased] --base <rev>(MCP:har_proof_carry) writes a carried proof on the rebased commit when its patch is identical to the verified one, andhar proof verify --accept-carriedaccepts it, reported asL1 (carried from <sha>). Needs factory-proof 0.3.0. See Rebases and stacked pull requests. - The commit gate works under husky.
har hooks installwrites its workers to<git-common-dir>/hooks, which every worktree shares, no longer fails whencore.hooksPathis set, andhar hooks install --managedadds the gate to husky’s tracked hooks. See Husky and other managed hooks. - A slot’s records land in the main checkout. Run from inside a slot worktree,
har env verifyused to write its runs and validations to the worktree’s.har/, so status showedlast verify: unknownand the commit gate found no evidence. Every run, validation and status read now goes to the main checkout, whatever the working directory.har env statusshows only the current session’s last verify, never the one a previous session left on the same slot.
What changed by default
Section titled “What changed by default”Proofs are off unless the repository enables them. As in 1.x, nothing is
attested, noted or installed while HAR_FACTORY_PROOF is unset in
.har/harness.env, whatever git-factory is on the machine. To turn proofs on:
HAR_FACTORY_PROOF=notes # in .har/harness.env; or notes+trailersthen run har hooks install. With proofs on:
- each full verify writes an attestation next to the validation record, and the CLI sends it to every destination that takes proofs (Mission Control, HAR HQ);
- the
post-commithook adds it to the new commit’s note inrefs/notes/factory. Notes stay local until you runhar proof sync, which fetches the remote’s notes, merges yours into them and pushes, without ever deleting or rewindingrefs/notes/factory. In a fresh clone,har proof sync --no-pushbrings them in before you verify. See Push and fetch notes; har hooks installrunsgit factory setup(a notes fetch refspec andnotes.rewriteRef);- trailers are added only under
notes+trailers, because they rewrite commit messages.
har proof disable turns proofs off again and removes that git config and the
trailer hook; your notes stay.
har onboard no longer asks about HAR skills, and the default level is Outline
everywhere. Onboarding is seven steps, one screen each (see
har onboard), and these defaults changed:
| Question | Default before | Default now |
|---|---|---|
Install HAR skills (har onboard, step 3) |
asked, no | not asked: the workflow is in AGENTS.md; har agents install adds skills |
How much agent activity to record (har onboard step 4, har env maintain) |
Full trajectory | Outline (every step and its timing, no text) |
har telemetry enable without --level |
Full trajectory | the level chosen earlier on this machine; else Full on a machine that already had HAR’s hooks; else Outline |
| The level of a machine where nobody chose one | Full trajectory | Full when it already had HAR’s hooks (consent grandfathered); else Outline |
The exact rule: a machine with no stored level reads as Full when its consent
was carried over from hooks an earlier HAR installed (origin grandfathered), so
an upgrade never records less than before. Outline is the default only where a
choice is made now: a new consent, har onboard’s level question, har env maintain asking an open consent, and har telemetry enable on a machine with no
hooks. --yes, a run without a terminal and har telemetry enable without
--level keep the level in effect (Full on such a machine) and store it.
har onboard --yes takes the new defaults: no skills, and the
Outline level on a machine where no level was chosen and no earlier HAR installed
hooks (a level chosen earlier, or Full on such a machine, is kept). har env maintain --yes turns nothing new on. To record the text as before:
har telemetry enable --level full; to add the skills: har agents install.
An agent you leave out in har onboard’s step 3 gets no telemetry hook, and
har telemetry enable keeps it that way (also after har telemetry disable).
har telemetry enable --agents codex adds the agents it names: they are hooked and
their exclusion is cleared, and every other agent keeps its state. An unknown
name is refused. (har onboard --agents still names the full set for that
onboarding.)
Coming from an earlier 2.0 prerelease? Up to 2.0.0-next.19, an unset
HAR_FACTORY_PROOF meant notes whenever a git-factory was installed: launch and
har hooks install installed or upgraded ~/.har/factory-proof, every full verify
wrote an attestation (and warned “proof has no work unit”), and a git-notes
destination wrote notes. Now unset means off, and a git-notes destination no
longer turns proofs on by itself. To keep proofs, set HAR_FACTORY_PROOF=notes in
.har/harness.env. If you do not want them, run har hooks install (or
har proof disable) once: it removes the fetch refspec, notes.rewriteRef and the
commit-msg trailer hook an earlier mode added, and keeps your notes.
An explicit off, notes or notes+trailers behaves as before, except that off
now also removes the proof setup HAR added (see above).
Verification behavior changes
Section titled “Verification behavior changes”These need no action, but a 1.x harness can see them on its first 2.0 verify.
- Every stage has a time limit. A stage that runs longer than its
timeoutMsinstages.json, elseHARNESS_STAGE_TIMEOUT_MSin.har/harness.env, else 30 minutes, is stopped (SIGTERMto its whole process tree,SIGKILL5 seconds later) and fails with reasontimeoutand exit code 124. This applies tohar env verify,har env run-stageandhar line gate. 1.x waited forever. If a stage of yours legitimately runs longer, give it atimeoutMs. See Stage time limit. - A stage killed by a signal fails. 1.x recorded a stage killed by the OOM
killer, a crash or an external
killas passing. It now fails with 128 + the signal number (SIGKILLgives 137), and the output ends with[har] killed by SIGKILL (exit 137). A verify that passed on 1.x because a stage was killed now fails, as it should have. - Stages run in their own process group, with stdin closed. HAR forwards
Ctrl-C (
SIGINT),SIGTERMandSIGHUPto the stage. A stage that reads from the terminal gets end-of-input instead of waiting. - Every verify is its own factory run. A re-verify of the same tree used to
replace the earlier run: one record at the receivers, the earlier stage logs
under
.har/artifacts/<run-id>/deleted. Now eachhar env verifygets its own run id, stage logs and trace, so a failed verify followed by a passing one of the same tree shows both. The commit gate still checks the tree’s latest verify, and the proof, the commit binding and the trailers name the run that passed.
har control sync no longer sends to HAR HQ
Section titled “har control sync no longer sends to HAR HQ”In 1.x, HAR HQ received a copy of what Mission Control held: har control sync
read it back from Mission Control and posted it to the connected org, so HQ got
nothing while Mission Control was down. In 2.0 har control sync sends to local
Mission Control only. The CLI and the agent hook
send records, proofs, evidence and telemetry to every destination directly, HAR HQ
included (only for the repositories you chose); Mission Control forwards nothing.
HAR HQ is opt-in per repository: the upgrade logs you out
Section titled “HAR HQ is opt-in per repository: the upgrade logs you out”In 1.x a HAR HQ login sent every attached repository there. In 2.0 HAR HQ receives only the repositories you choose, each at the scope you choose. So the first 2.0 command on a machine logged in to HAR HQ logs it out: the stored login and its tokens are removed, nothing is sent to HAR HQ, and one line says so:
[har] HAR 2.0 sends to HAR HQ only for repositories you choose. Run `har hq connect` to log in again.This happens once; a later login is never logged out again. Mission Control and
your other destinations are not affected. Until you log in, har hq status and
har env doctor print one informational line about it (never a warning, and
nothing ever prompts on agent paths).
Log in again and choose:
har hq connectOn a terminal, after the login it asks which repositories HAR HQ receives (this repository and the ones attached in 1.x are pre-selected, the other registered repositories are listed) and at which scope, in onboarding’s words — one scope for all of them, or one per repository:
| Scope | HAR HQ receives |
|---|---|
off |
nothing |
usage |
records, proofs (verification verdicts), tokens and cost (agent spans and metrics, no event records); no stage logs or artifacts |
outline |
usage plus stage logs and artifacts (evidence) and every step and its timing, no text |
full |
outline plus prompts, replies and tool output, as you choose: none, redacted (secrets replaced), masked (every character masked) or raw |
The scope pre-selected is what 1.x sent: the outline, or the full trajectory with raw text when you forwarded it. Without a terminal (CI, agents), pass the choice:
har hq connect --api-key "$HAR_PORTAL_TOKEN" --repo . --scope usage --yeshar hq connect --repo . --repo ../web --scope full --content redacted --yesWithout --scope, a non-interactive connect only logs in, chooses nothing, and
prints the command that does. Change the choice any time with
har hq repos add <path|url>… --scope …, har hq repos remove <path|url>… and
har hq repos (or har hq status). A repository you register later is not sent
until you add it. The local telemetry level still caps every destination: at
outline, a repository at the full scope gets the outline. Stage logs and
artifacts (evidence) go to HAR HQ only at outline and full: at usage it gets
the verification verdict, not the output behind it.
har hq disconnect stops agent telemetry to HAR HQ at once: HAR rewrites the hook
config without the hq entry and removes its key from ~/.har/otel-hooks/direct.env.
Logging in again (or to another org) rewrites them with the new key.
The hq destination carries the choice (its repositories); agent telemetry is
filtered per record by otel-hook from the repository it names
(vcs.repository.url.full), so a repository without an origin remote sends HAR
HQ records and verification only. An otel-hook that cannot filter by repository
gets no hq entry at all. HAR_PORTAL_TOKEN alone is not logged out, but sends
nothing either until repositories are chosen. har control trajectory only points
to har hq repos now.
HAR_SYNC_ALLOW_USAGE_VIOLATIONS is gone with the HQ leg.
har control sync sends only registration and slots
Section titled “har control sync sends only registration and slots”har control sync no longer posts runs, work units, validations, validation and
commit bindings, session bindings, usage, usage observations or session events
to Mission Control’s /api/repos/<id>/… routes, and Mission Control 2.0 no
longer has those routes. They reach Mission Control as ingest v2 records and
OTLP, like any receiver. Sync keeps registering repositories and sending the
live slot view. --full (resend every run) is gone, and so is the harvest of
local Claude Code and Codex transcripts and rollouts: usage comes from otel-hook
only.
Claude Code usage and trajectory come from otel-hook only
Section titled “Claude Code usage and trajectory come from otel-hook only”HAR no longer turns on Claude Code’s native OpenTelemetry export. On upgrade it
removes the keys earlier versions wrote to the env block of
~/.claude/settings.json (CLAUDE_CODE_ENABLE_TELEMETRY, OTEL_*; a key you
changed since is left alone), and registers the Claude Code hook with
--claude-transcript-usage --logs --metrics, and the Codex hook with
--codex-rollout-usage (each turn’s tokens, read from the session rollout at
Stop). har telemetry status lists a hook registered without them. Every receiver, HAR HQ included,
gets the same Claude Code traces, logs and metrics from otel-hook: one
generation per turn and one per subagent run, priced by the receiver, and the
trajectory from its event records. Run har telemetry install-hooks (or launch
a slot) to apply it, then start a new Claude Code session.
At the usage level the hook now runs too: it is the only source of agent usage.
It sends its spans and token metrics, and no event records or text.
Privacy defaults
Section titled “Privacy defaults”What a default user sends to a third-party OTLP backend (an otlp or langfuse
destination), in one sentence: nothing until such a destination is added, and then
verification spans and agent session spans, without account identity, prompt,
reply and tool text, or local paths.
| Data | Sent by default? | Opt in with |
|---|---|---|
Absolute local paths (every factory.local.* key, process.cwd, code.filepath, …) |
No, for every destination, Mission Control included | --include-local-paths (agent spans keep them only when every destination opts in) |
Account identity (user.email, user.account_uuid, user.id, organization.id, …) |
No: Claude Code’s native telemetry, which carries it, is not turned on | --include-account-identity |
Logs (at the full level they carry prompts, replies and tool input/output) |
Not to otlp or langfuse destinations: neither preset subscribes to logs. Mission Control takes them, and an hq destination takes them when logs is in its signals |
--signals traces,metrics,logs |
| otel-hook metrics (token counts per model, tool calls) | Only to destinations that subscribe to metrics |
--signals …,metrics |
Local paths are stripped everywhere. Prereleases kept factory.local.* in agent
spans while Mission Control was a destination (#519), because Mission Control
attributed sessions by path. Work identity is now stamped from the session context,
so one agent hook process sends a Resource without local paths unless every
destination, Mission Control included, has --include-local-paths.
The flags go on har telemetry destination add. Mission Control keeps everything
locally as before. The full lists of stripped attributes are in
Send telemetry to any OTLP backend. Proofs
never contain prompts, stage logs, absolute paths or work unit titles.
Removed telemetry attributes
Section titled “Removed telemetry attributes”HAR 2.0 no longer emits or reads any har.* OpenTelemetry attribute. There is no
dual emission: a dashboard, alert or query that filters on a har.* key matches
nothing after the upgrade. Mission Control reads only the new names, so upgrade
HAR and Mission Control together (har control up after installing 2.0).
| Removed (1.x) | 2.0 name |
|---|---|
har.session_key |
session.id (OTel semconv) on the agent session’s Resource |
har.work_unit_id |
factory.work_unit.id (and factory.work_unit.source for the tracker) |
har.attempt_id |
factory.attempt.id |
har.branch |
vcs.ref.head.name |
har.agent_id |
factory.slot.id |
har.suffix |
removed, nothing read it |
har.repo_path |
factory.local.checkout_path |
har.work_dir |
factory.local.work_dir |
har.harvest.truncated, har.harvest.dropped_events, har.harvest.total_events |
removed with the transcript harvest (no longer produced); 2.0.0-next prereleases emitted them as factory.usage.harvest.* |
har.destination_test (har telemetry destination test) |
factory.telemetry.destination_test |
Instrumentation scope har.verification (and har.telemetry.destination-test) |
Scope @osfactory/har |
factory.local.* is a local-only namespace: absolute paths and other
machine-local facts. The CLI strips every factory.local.* key from what it sends a
destination, and agent spans leave them out, unless the destination (for agent
spans: every destination) was added with --include-local-paths.
The agent env file (.env.agent.<id>) no longer sets HAR_SESSION_KEY: the
session key travels only as session.id in OTEL_RESOURCE_ATTRIBUTES. That
variable no longer carries work identity (factory.work_unit.id,
factory.work_unit.source, factory.attempt.id, factory.slot.id): otel-hook
stamps them from the session context HAR writes in ~/.har/sessions, so telemetry
outside any segment (before launch, after complete) carries none.
HAR_WORK_UNIT_ID, HAR_ATTEMPT_ID and HAR_CONTROL_API_URL are unchanged.
Agent hooks (@osfactory/otel-hook)
Section titled “Agent hooks (@osfactory/otel-hook)”HAR 2.0 installs @osfactory/otel-hook@0.15.1. HAR replaces an older installed copy
on the next har env launch or har telemetry on.
otel-hook 0.15.1 installed, 0.12.0 required
Section titled “otel-hook 0.15.1 installed, 0.12.0 required”HAR 2.0 needs otel-hook 0.12.0 or later, and 0.14.0 or later to send agent telemetry
to HAR HQ. It installs 0.15.1. 0.14.1 routes events that name no repository by
their session’s repository, so HAR HQ keeps a session’s start and first prompt;
0.14.2 starts a Claude Code turn’s generation span at its prompt rather than at
Stop, so the turn’s duration is right and it counts toward the run it started in.
0.15.0 exports Claude Code usage as one generation per model request, at the time
that request ran, so a run that ends mid-turn keeps the tokens spent inside it; the
turn’s own generation no longer carries usage, and Mission Control books Claude Code
usage per request. 0.15.1 stops a forked session (claude --resume --fork-session)
from counting the history it copied from its parent a second time.
- Work identity comes from the session context (0.12.0). HAR sets
sessionContext.dirin the hook config to~/.har/sessions(orHAR_SESSIONS_DIR); otel-hook stamps the segment in force on every span, log record and metric point. It is set in the config file, never throughOTEL_*variables, which Claude Code strips from hooks. - Metrics and Claude Code usage. Each destination’s
signals,metricsincluded (0.11.0), go into its entry;exporter.metrics.includeSessionIdis one setting for every unscoped destination (--no-include-session-idon any of them turns it off); a scoped destination (HAR HQ) carries its own in its scopes. - Repository scopes. The
hqdestination is written with otel-hook’s per-destinationscopes(repositories, signals, content mode per scope), so HAR HQ gets only the repositories chosen for it. Scopes arrived in otel-hook 0.14.0: with an older copy HAR leaveshqout of the hook config (records and verification still go there; agent telemetry does not).providers.claudeCode.readTranscriptUsage: true(0.10.0) gives Claude Code sessions token counts read from the transcript atStop. - Older copies. HAR writes only the keys the installed otel-hook understands.
Before 0.9.0 it sends agent traces to Mission Control only, and
har telemetry statusnames the version it needs. - Every receiver goes into the hook config. HAR writes Mission Control and every
destination to
~/.har/otel-hooks/otel_config.jsonas otel-hook’sexporter.destinations[], Mission Control first, with no singleexporter.endpoint. Each destination header value there is anenv:reference (for example"Authorization": "env:HAR_OTEL_DIRECT_HEADER_1_1"). The secret values are kept only in~/.har/otel-hooks/direct.env(mode0600), which the hook wrapper loads. HAR unsets theOTEL_EXPORTER_OTLP_*variables for the hook, because any of them would add a second, unintended destination. - Spool behaviour in otel-hook 0.9.0. A full spool drops its oldest batches
instead of refusing new ones (default bounds: 16 MiB, 72 hours and 500 batches per
destination). A batch rejected with a non-retryable status (anything but
408,429,500,502,503and504) is dropped instead of spooled, so it does not block the queue. Hook events that close no span send no request.
See Agent session traces.
Mission Control no longer forwards
Section titled “Mission Control no longer forwards”Earlier 2.0 prereleases had Mission Control forward what it received to your
destinations, with ~/.har/destinations mounted into its container, and sent agent
traces straight to destinations only when Mission Control was off. Now every
producer fans out itself and Mission Control only receives and stores. The
har-control container no longer mounts ~/.har/destinations or adds a
host.docker.internal entry, and destination add no longer asks you to recreate
it. Run har control up after upgrading so the container runs the current image: an
older, forwarding Mission Control would send your destinations a second copy of
each agent trace. The CLI marks the verification traces it sends Mission Control
with x-har-otlp-forward: skip, so those are never doubled.
To try an unreleased otel-hook build, set HAR_OTEL_HOOKS_PACKAGE to any spec your
package manager accepts (a version, an absolute .tgz path, a directory) before
har telemetry on.
Claude Code hooks don’t inherit OTEL_*. Since Claude Code 2.1.128, Claude Code
removes every OTEL_* variable from the hooks it runs, so otel-hook would see no
OTEL_RESOURCE_ATTRIBUTES and export sessions without session.id or vcs.*.
HAR therefore also writes the same profile to .env.agent.<id> as
HAR_RESOURCE_ATTRIBUTES, and the hook wrapper restores OTEL_RESOURCE_ATTRIBUTES
from it when the variable arrives empty, before it drops factory.local.* unless
every destination opted in to local paths. This applies with and without Mission
Control. An
agent started outside a HAR slot has no HAR_RESOURCE_ATTRIBUTES, and its hooks
behave as before. Slots launched before this change keep their old agent env file:
relaunch the slot to get the new variable.
What 2.0 no longer produces
Section titled “What 2.0 no longer produces”- The offline usage harvest. 1.x
har control syncread Claude Code transcripts and Codex rollouts from disk and posted the usage it found. 2.0 books agent usage only from otel-hook, live: a session that ran without the hook has no usage. Thefactory.usage.harvest.*attributes are gone with it. - A per-request Claude Code breakdown. Claude Code’s native
api_requestevents andclaude_code.*metrics are no longer turned on, and Mission Control ignores them if they arrive. Claude Code usage is one otel-hook generation per turn and one per subagent run. - Launch, teardown and run-stage records at the receivers. HAR still writes
every run to
.har/runs/locally. Receivers get the slot’s work unit, attempt and session segments, and one factory run per verify with its stage results; the separate run records of a launch or a teardown no longer leave the machine. - Changed files on a verify. A v2 factory run carries no changed-file list, so Mission Control shows none for verifies recorded after the upgrade. Factory runs migrated from 1.x keep theirs, and the local validation record still has it.
- Relaying between receivers.
har control syncno longer posts records to Mission Control or forwards anything to HAR HQ, and Mission Control 2.0 forwards nothing.har control sync --fullandHAR_SYNC_ALLOW_USAGE_VIOLATIONSare gone. - The 1.x cloud upload.
har control sync --cloud, which posted the 1.x sync payload (local paths included) toHAR_CLOUD_API_URLwithHAR_CLOUD_API_KEY, is removed, and those variables no longer configure a HAR HQ target. Passing--cloudfails with a pointer: send to a hosted receiver withhar hq connectorhar telemetry destination add. - Factory proofs by default. Proofs, and notes, are written only under an
explicit
HAR_FACTORY_PROOF=notes…(see What changed by default).
HAR HQ: 1.x endpoints and their sunset
Section titled “HAR HQ: 1.x endpoints and their sunset”HAR 2.0 speaks only the v2 ingest contract. HAR HQ runs the v2 endpoints next to the 1.x ones, so a 1.x CLI keeps working while you upgrade:
- At 2.0.0 the v2 endpoints are live before the 2.0.0 CLI is released. The
1.x endpoints are frozen (no new fields) and answer with a
Deprecationheader (RFC 9745), aSunsetheader (RFC 8594) and aLink: <https://harproject.dev/docs/guides/upgrading-to-2-0/>; rel="deprecation"header pointing at this page. A 1.x CLI does not print these headers: nothing on the machine announces 2.0. - The sunset comes no earlier than six months after 2.0.0, and only once 1.x
traffic is low. The 1.x endpoints then answer
410 Gonewith the upgrade command. Data sent through them stays readable.
Mission Control has no such period: it ships with the CLI, in the same version, and migrates in place.
Rolling back
Section titled “Rolling back”To go back to 1.x, restore the Mission Control backup and reinstall the 1.x CLI.
Records sent to Mission Control after the upgrade are not in the backup. If the
volume holds more than one backup (har_control.db.v1-backup-<timestamp>), use the
newest.
npm install -g @osfactory/har@1har control downdocker run --rm -v har_control_data:/data alpine sh -c \ 'cd /data && mv har_control.db har_control.db.v2 && cp har_control.db.v1-backup har_control.db'har control up # the 1.x CLI starts the 1.x Mission Control imagehar telemetry on # re-registers the 1.x agent hooksKeep the 1.x CLI while you use the restored database: a 2.0 CLI moves Mission Control to its own image, which migrates the database again.
Troubleshooting
Section titled “Troubleshooting”Start with har env doctor (MCP: har_doctor) and har telemetry status. Their
destination checks only ever warn: a receiver that is down never blocks verify, a
commit or a launch.
| Symptom | What to check | Fix |
|---|---|---|
har hq status or doctor: “Logged out of HAR HQ by the upgrade to 2.0”, or “repositories: none chosen” |
2.0 sends to HAR HQ only for repositories you choose | har hq connect, then har hq repos add <repo> --scope usage (scopes: off, usage, outline, full) |
Launch or doctor ingest-destinations: Mission Control runs a 1.x version, or the receiver does not support ingest v2 |
Mission Control (or another receiver) still runs a 1.x version | har control up. Records stay queued until the receiver answers v2 |
doctor ingest-destinations: entries queued, or a last failure |
The receiver is down or rejected the key. Unknown routes (404, 405, 501) and rejected keys (401, 403) are retried, so nothing is lost before a receiver is upgraded. Evidence a receiver cannot store (501 on the evidence endpoints) is set aside in dead/ instead, so it never holds back the records queued after it |
Fix the receiver or the key, then har telemetry flush. Every har command also drains what is due |
doctor ingest-destinations: entries in dead/ |
The receiver rejected a batch as invalid, or it was older than 14 days | Inspect ~/.har/queue/<destination>/dead/; those entries are not retried |
doctor telemetry-destinations: batches queued or dropped |
An OTLP backend is unreachable | Check the backend, then har telemetry destination flush |
| No Claude Code usage or trajectory | The Claude Code hook was registered by 1.x, or the session started before the upgrade | har telemetry install-hooks, then start a new Claude Code session. har telemetry status names the otel-hook version it needs |
| A dashboard or alert matches nothing | It filters on a har.* attribute |
Use the 2.0 names |
Everything else is unchanged
Section titled “Everything else is unchanged”- Commands, config keys and MCP tools not listed under
Breaking changes keep their names and flags. MCP output
schemas only gained optional fields (for example
proofonhar_run_verification), andhar_doctorgainedtelemetry-destinationsandingest-destinationschecks that only ever warn.har telemetry flush,har telemetry destination flushandhar proof show|verify|carry(MCP:har_proof_show,har_proof_verify,har_proof_carry) are new. - Mission Control’s OTLP receivers keep their shapes. Only the attribute keys
inside the event and span
attributesmaps change, as in the table above. - Proofs and telemetry are fail-open: a missing
git-factory, a notes error or an unreachable destination never blocks verify, a commit or a launch. The commit gate’s rule is unchanged: the staged tree’s latest verify must pass. Only where its workers live changed (see the husky item in What’s new in 2.0).
