Changelog
All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[2.22.0]
Added
- The
indexconfig block:index.update_timeout_s(default 120) bounds oneqmd updatein a sync, the hook worker and an invoke publish;index.collection_timeout_s(default 300) bounds oneqmd collection add;index.analyze(default true).cairn config set,unsetandshowknow the keys. cairn syncruns SQLiteANALYZEon the QMD index beforeqmd update, on the first sync and again when the index file changed size by more than a fifth. QMD 2.9.0 removes orphaned vectors at the end of every update and never analyses its index: on an index with 1.46 million vectors that step took 183 s without planner statistics and 1.9 s with them, so every sync failed at the fixed 120 s limit. The statement names no QMD table and writes statistics only. A refusal logs[qmd-analyze] skipped - REASONand the update still runs.- Error code
QMD_UPDATE_SLOW: a failedqmd-updatestep logs the activeindex.update_timeout_sand the code.
Changed
qmd collection addgets 300 s instead of 30 s. A first registration scans the whole directory: a store of 14,000 exported sessions passed 30 s on a new index, and the first sync failed atqmd-collections. The timeout message now says that QMD keeps the scanned files and names the key.
[2.21.2]
Changed
- The Antigravity spec target is 2026-11-20, agy 1.5.13 (it was 2026-10-30, agy 1.4.10).
The record types (
USER_INPUT,PLANNER_RESPONSE,GENERIC), their fields and theconversation_summariescolumns the adapter reads are the same on a live 1.5.13 store, so the parser did not change.cairn doctorand theexporter_spec_targetstamp of each Antigravity document show the new date.
[2.21.1]
Fixed
- Claude session discovery skips a transcript Claude Code renamed to
<id>.orphaned-<ms>-<hash>.jsonl. Its stem is not the session id, so the export raised "transcript session ID does not match requested session", failed theclaude-code-sessionssync step and stopped the daily journal at the refresh. The recall gap scan skips the same file, so it no longer reports an export lag that no sync can clear. - The Claude spec target (2026-11-03, Claude Code 2.1.317) ignores the new
session-ownerrecord, so a session with no turns isemptyinfo, notzero-messagesdrift. - Granola export names the real cause when Granola 7.726+ keeps its data key in an
app-only Keychain item and no longer writes
storage.dek, and says how to disable the source.
[2.21.0]
Added
cairn sync --light(all exports andqmd update, no embed) andcairn sync --nightly(the same, then up tocron.embed_max_sessionsQMD embed sessions while the pending count falls, undercron.embed_on_battery).cairn cron installinstalls an hourly light job and a nightly embed job (03:00 local by default). On macOS they are LaunchAgents (dev.cairn.sync.light,dev.cairn.sync.nightly) withProcessType BackgroundandLowPriorityIO; elsewhere they are crontab lines underniceandionice. A night deferred on battery runs at the next light sync on AC power, at most once a day.cairn cron status [--json]andcairn embed [--sessions N | --until-complete] [--respect-power].cairn recall search QUERY [-q VARIANT]... [-c COLLECTION]... [--deep | --no-deep] [--json]: BM25 for each phrasing, then one hybridqmd queryon--deepor when BM25 finds fewer thanrecall.deep.min_hitsdistinct documents. Results are merged by document and labelledbm25,hybridorbm25+hybrid. The hybrid query has a time budget and is skipped, with a one-line note, when the index has no vectors or the last embed is older thanrecall.deep.max_vector_age_h.- Config keys
cron.backend,cron.priority,cron.embed,cron.embed_at,cron.embed_deadline,cron.embed_max_sessions,cron.embed_on_battery,cron.embed_catchupandrecall.deep.*;cairn config setandunsetaccept them. - The embed stamp
$XDG_STATE_HOME/cairn/qmd-embed.jsonand the owed markerembed-owed.json. - Error codes
SYNC_SCHEDULE_LEGACYandEMBED_OVERDUE.
Changed
- The scheduled sync no longer embeds every hour. Run
cairn cron installonce after the upgrade: it removes the old hourlycairn sync --cronentry. Until then that entry keeps embedding every hour andcairn doctorwarns. Setcron.embedtohourlyto keep the old behaviour. If you downgrade later, runcairn cron uninstallfirst. cairn syncmode flags are mutually exclusive. Unknown keys undercronare nowCONFIG_UNKNOWN_KEYerrors (they were ignored).cairn doctor: pending documents are an ok line, not a warning, within 30 hours of a nightly embed (--strict-indexstill fails). The next step for an incomplete index iscairn embed. Thecronline became async schedulegroup.- Skills:
/recallruns topic search throughcairn recall search, runs one deep (hybrid) search on "deep recall", "search harder" or--deep, or when no BM25 hit is about the topic, and labels each hitbm25,hybrid,bm25+hybridorrg./searchaccepts--deep. The setup skill drains a first-embed backlog withcairn embed --until-complete.
[2.20.1]
Changed
- Skills: the cairn skill triggers on recording, replacing and withdrawing decisions,
pausing and resuming a routine, a daily routine check, the recall-first block, error
codes and Antigravity export; the recall skill on decision questions, journal checks and
missing sessions. New workflows
daily-check.mdandmemory-import.md(the memory import steps moved there fromlog-session.md). The search and recall skills runcairn errors CODEon a failure. Codex skill names and policy files for every skill.
Added
.agents/skills/skill-review(repo-local, not shipped): a skill review with a rubric cited to the Claude Code, Codex, Antigravity and Agent Skills documentation, ameasure.pyscript andtests/test_skill_review.py.
Fixed
- invoke-codex, invoke-claude and invoke-antigravity skills:
argument-hintis quoted. The unquoted[a] [b] [c]form is not valid YAML, so a host with a strict YAML parser could load these skills without their metadata. - cairn skill: the supersede and forget steps take the source, id and row number from
the row's
sessionandnumberfields and pass--session-id, so they change the document that holds the decision. The supersede step names its output line (Struck #N; added #M) and exit 3. - Memory import verification reads both stores (
--source claude --source memory) and keeps the rows imported into a session. - recall skill: a coverage answer explains each gap from its
message. Anindex-unknowngap stays unknown, not "not indexed". A clean report and a gap with a nullfixare handled. - Daily check: it no longer says it changes no file. It names the lock files the
commands open and the Codex client the hook check starts, reports a blocked step as
"not checked", and lists
last-run-exit-unknown. The memory import privacy note says that QMD and rg still find a withdrawn claim's text. - skill-review (repo-local): step 1 diffs against the PR's base (the base the requester
names, else
gh pr view, elsemain) after agit rev-parsecheck, not againstorigin/main. When the host deniespython3(cairn's Antigravity preset does), the review reads attachedmeasure.pyoutput or the files and writes "measure.py not run".measure.pychecks every frontmatter key and folded line against a YAML subset and flags inline command substitution. Rubric: A1 no longer callsread_heada YAML parser, A6 covers onboarding and install skills only, B5 covers shipped skills only, and F7 diffs against the same base as step 1.
[2.20.0]
Added
cairn claude memory importadds Claude Code auto-memory notes as## Decisionsrows: into the session that wrote them when cairn exported it, else into<data_root>/decisions/<project>.md. The source cell ismemory:<project>/<file>. Re-runs add only new memories, warn on changed ones, and skip withdrawn claims.--dry-run,--json,--all-projects,--memory-dir,--include-reference.recall decisionslists project decisions documents (--source memory), shows their refs asmemory:<project>#Nand marks imported rows[memory].decide,supersedeandforgettake--session-id memory:<project>.- Error codes
MEMORY_DIR_MISSINGandMEMORY_IMPORT_WRITE_FAILED. config.example.jsongains the store-lessdecisionscollection.
[2.19.3]
Added
- A retrieval-quality test: an invented exported store of 33 documents and 36 fixed
queries (
tests/fixtures/recall-qrels.json) in three families (temporal, exact, title-bare).tests/test_recall_qrels.pyrunscairn recall listand the skills' rg pass over it and gates recall@5 and top-1 per family. Seedocs/recall-qrels-spec.md. - CI installs ripgrep, so the exact-match families run on every pull request.
Changed
parse_date_rangereads the clock throughcairn.timeutil._utcnow(), a seam for tests.
Fixed
- An exact search for a term that starts with
-failed with an rg flag error. The/searchand/recallskills now pass the query with-e.
[2.19.2]
Added
tests/test_docs_cli.py: everycairn ...command in README, CONTRIBUTING, skills, references, docs andcairn helpis parsed by the real argparse parser; a mismatch fails withpath:lineand the parser's error.<!-- cairn-cli: historical -->and<!-- cairn-cli: skip -->exempt old examples and non-command spans. Skillallowed-toolsBash rules are checked for shape and coverage.- Each dispatch target builds its parser in a function (
build_parser(),admin.build_config_parser()and peers), with no behaviour change.
Fixed
cairn helpand the cairn skill list one command per line;install | uninstall NAMEforms ran as a shell pipe when pasted.docs/routine-spec.mdnames--force-restart, not--kill; routine and digest specs writecairn invoke <peer> --owner.
[2.19.1]
Added
skills/<name>/routing-eval.jsonlfor all seven skills: 77 paraphrased user intents, each naming the skill it should reach,nullfor "no skill", and an optionalambiguous_with.tests/test_skill_routing.py: checks that each intent matches the quoted triggers of its skill and of no other skill unless declared, and rejects an intent that copies a trigger. A failure message includes the overlap table across skills. It checks trigger text, not the harness router.- CONTRIBUTING: "Changing a skill description".
docs/skill-routing-eval-spec.md.
Changed
- The
searchskill description now lists quoted triggers ("cairn search", "search my sessions", "search past sessions", "search my meetings", "grep my sessions", "exact search").
[2.19.0]
Added
cairn errors [CODE] [--json]: a registry of 38 stable failure codes. Each row gives the meaning, why cairn stops, the next step, a verify command (it edits no config or instruction file; it can createdata_root, refresh the catalog cache, or finalise a dead invoke round), the exit status and whether a retry can help. It reads no config.docs/error-codes.mdis generated from it (python -m cairn.errors --render) and a test keeps it current.- A converted failure keeps its first stderr line and adds
code: CODE (run 'cairn errors CODE'). With--json,recall,invoke,config showandinstructionsprint a failure object (ok,code,error,exit,retryable,fix) on stdout. - The invoke result line (runner,
result-NN.json,invoke wait, busy) andinvoke publish --jsoncarrycodeandfixfor every round that did not succeed.routine run --json,last-run.json,routine status --json,recall digest --json(empty day) andrecall verify --jsoncarrycode. cairn doctorlines end with[CODE]for config, QMD, index, hook trust, Codex trust, parser drift, gap check and recall-first findings.
Changed
- Exit codes and first stderr lines are unchanged. A script that compared a whole stderr string, a whole doctor line or the exact key set of these JSON objects sees the added line, suffix or keys.
[2.18.0]
Added
cairn instructions install | remove | show | status --harness claude|codexwrites, upgrades, removes and reports a marked recall-first block in the user instruction file (CLAUDE.mdin the Claude Code config directory,AGENTS.mdor a non-emptyAGENTS.override.mdin the Codex home). Text outside the markers is kept byte for byte;--dry-runprints a unified diff.remove, or deleting the block by hand, records an opt-out thatinstallkeeps until--force.cairn doctorreports the recall-first block state (warn only, no config needed).- Setup asks before it adds the block and shows the diff; the update workflow upgrades a stale block and asks before a first install.
Changed
atomic_writetakes opt-infollow_symlinksandcheck_unchangedkeywords; existing writers are unchanged.
[2.17.0]
Added
cairn <source> forget N --reason Rwithdraws row N of the## Decisionstable. It strikes the row as~~claim~~ withdrawn: Rand appends a SHA-256 fingerprint of the normalised claim to<data_root>/withdrawn.jsonl(mode 0600, no claim text).Ris one ofstale,wrong_source,hallucination,cross_attribution,private,other.decideandsupersederefuse a withdrawn claim, in any session and any source, with exit 3.--forceadds it and records it as unwithdrawn.recall decisions --jsonand the digestoverduerows carrywithdrawn,withdrawn_reasonandwithdrawn_via.
Changed
recall decisionsand the digestoverduelist hide withdrawn rows, including an unstruck row whose claim the ledger lists as withdrawn.recall decisions --include-struckshows them; the digest has no such flag and never lists a withdrawn row.
[2.16.0]
Added
- A
## Decisionstable in session documents, directly after## My Notes, with the columns# | claim | kind | confidence | since | revisit_by | source.kindis one ofdecision,fact,commitment,hunch;confidenceishigh,mediumorlow;sourceholds frame citations like[claude:3f2a9c1e f12]. cairn <source> decide CLAIMadds a row;cairn <source> supersede N CLAIMstrikes row N as~~claim~~ superseded by #Mand adds row M. Rows are never renumbered; a row's id is<source>:<native_id>#<n>. Both verbs change only table lines: everything from## Conversationon stays byte-identical, so frame offsets and digest sidecars stay valid.cairn recall decisions [DATE] [--overdue] [--include-struck] [--as-of D] [--json]lists rows across sessions; struck rows are hidden by default and a bad row is skipped with a warning.cairn recall digest --jsonadds anoverduelist: active rows whoserevisit_byis on or before the digest day. Routine-owned sessions and their subagents give no rows unless--include-routine-sessionsis given, and--provenancefilters the rows. Exit codes are unchanged.
Changed
- Re-export preserves a
## Decisionssection that directly follows## My Notes, in session and peer-exchange documents. A table cairn wrote stays byte for byte; a hand edit keeps its text, with LF line endings, as for My Notes. An older cairn drops the section on its next export, so this version cannot be downgraded without losing the table.
[2.15.0]
Added
cairn recall verify FILE --digest DIR [--json] [--fix]checks a journal written from a digest: every[SOURCE:ID fN]citation must name a frame the digest kept, unchanged since, and every quoted span must be in a cited frame. OneFILE:LINE: REASON: DETAILline per failure, 10 fixed reason codes,--jsonwithschema_version, exit 0 / 4 / 1.--fixmoves failing blocks under## Unverified; a second run changes nothing.cairn recall digest --include-routine-sessionskeeps routine-owned sessions.- The example routine writes the day's digest in
prepareand runsrecall verifyasvalidate; itsscheduledprofile allowsBash(cairn recall verify *).
Changed
cairn recall digestleaves out sessions owned by a routine (owner: routine:<name>, from front matter or the owner-form preamble) and their subagents, so a journal run is never input to the next day's journal.--jsonlists them underexcluded.
[2.14.0]
Added
cairn recall gaps [--json] [--source S]: a deterministic coverage report. It shows export lag per source, files changed after the lastqmd update, collections QMD has not registered, unreadable exports, disabled sources, a missing store, an unknown index and a missing rg. Each gap has a severity and the command that fixes it, and the report ends withstatus: cleanorstatus: degraded.cairn recall list --json --coveragewraps the rows as{"sessions": [...], "coverage": {...}}with afound,clean-missordegraded-missverdict.cairn recall digest --jsongains the samecoveragekey. In text mode, both print one stderr note when coverage is degraded.- cairn records an index stamp (
$XDG_STATE_HOME/cairn/qmd-index.json) after each successfulqmd updatein sync, the session-end hook andcairn invoke. /recallprints a computed Gaps line before One Thing, tells a clean miss from a degraded miss, and resolves past work with both recalls before it asks the user./searchreports a degraded miss with its gaps.
Changed
qmd.list_collectionsnow uses the newqmd.parse_collection_listparser. Its names, timeout and errors do not change.
[2.13.0]
Added
cairn routine pause NAME --reason TEXTandcairn routine resume NAME. A paused routine skips every run (exit 0, no stamp, nolast-run.json) until resumed;--forcedoes not bypass it.- A routine-level breaker: after 3 consecutive failed runs with a counted failure the
routine writes
disabled.jsonand stops spending peer rounds;resumeclears it. routines.<name>.terminal_hook: an argv list (absolute first element) run once per day stamp with a 10 s timeout, the day's report row on stdin andCAIRN_ROUTINE_*in its environment. Its failure is logged and changes nothing else.routines.<name>.stale_sources(warn,refuse,ignore) andcairn routine run --stale-sources: warn about, or refuse on, a digest source not exported in the last 24 h. A collection-wideexport(no FILE argument) now writes a receipt to<state_home>/cairn/exports/<source>-<key>.json, keyed by its output directory. An export of one FILE andsyncwrite none.cairn routine run --json: one run report withschema_versionandstatus; the same object islast-run.json(the old keys are kept).cairn routine statusnames a state (fresh,running,never_run,stale,paused,disabled) and attention codes from files only;listshows the state;doctorreports a paused or disabled routine.procs.run_cappedtakes aninputstring for the child's stdin.
Changed
cairn routine status NAMEexit codes: 0 fresh or running, 1 needs attention (never run, stale, a failed day, a non-zero last run, an interrupted run, a missing launchd plist, a stale source), 2 paused or disabled. It always exited 0 before, so a script that runsstatusunderset -enow stops on a failed day.stale-sourcejoins the reasons that cost no attempt.
[2.12.0]
Added
cairn hook install --harness codextrusts the SessionEnd fallback it registers: on Codex 0.165.x it writes the[hooks.state."<key>"]trusted_hashtable in$CODEX_HOME/config.toml(backup inconfig.toml.cairn-bak), then asks Codex once more and removes the table if Codex does not report the hook as trusted. Other Codex versions keep the manual/hooksstep.--dry-runforcairn hook install|uninstall --harness codexprints every planned write with its file, key or index and sha256, and writes no cairn file; install still asks Codex for its loaded hooks, and the Codex app-server can write its own state in$CODEX_HOMEwhile it answers.--no-trustregisters without trust.$CODEX_HOME/cairn-hook-receipt.jsonrecords a sha256 per entry cairn wrote.cairn hook status --harness codexreportscodex_trust;cairn doctor --harness codexprints aCodex hook trustline (trusted, stale, missing, disabled or manual).
Changed
- Reinstalling the Codex fallback replaces cairn's group in place, so later SessionEnd groups keep their index and their trust. If a person edited cairn's group since cairn wrote it, reinstall exits 1 and changes nothing.
cairn hook uninstall --harness codexremoves a group or trust table only while its sha256 equals the receipt, warns about changed entries and about index shifts.- The XDG
codex-hook-registration.jsonownership file is migrated into the receipt and deleted.
[2.11.0]
Added
- Parser-drift guard. An export refuses to write a session whose source file holds
records but renders no user or assistant message (
zero-messages), whose lines do not parse (unreadable-lines) or, for a Codex rollout, has no session id (no-session-id). It printsError: parser drift: SOURCE:ID KIND: ..., keeps the last good document and exits 1. A top-level session with no user turn is still written, with ano-user-turnswarning. Findings persist in<data_root>/exporter/findings.jsonuntil a later parse succeeds. The hook worker records the same message as the request error. cairn <source> export --jsonprints one JSON object on stdout: documents written, findings and the spec target. Human lines go to stderr.- Trailing-window gap check in
cairn sync --cron/--allfor Claude Code, Codex and Antigravity. Sessions changed in the last 30 days with no document are re-exported once and checked again. A gap that stays open failsgap-check:<collection>. A[exporter-drift]log line repeats while any finding is open. cairn doctorprints warn-onlyexporter [SOURCE](spec target),parser driftandgap check [COLLECTION]lines.- Every exported document carries
exporter_versionandexporter_spec_target. - Invented per-source parser fixtures with an exact message-recall test.
Changed
- An existing document with unparseable frontmatter now blocks its re-export with
Error: refusing to re-export SOURCE:ID: ...; fix or move it, recorded as a finding. The export no longer aborts with a traceback. - A document deleted by hand comes back on the next full sync while its source file is under 30 days old.
[2.10.0]
Added
- Every exported session document and every peer exchange document carries a
provenancekey in its front matter:tool(a session a person drove),agent(a peer run, a subagent or an exchange),imported(a Granola meeting) oruser(hand-written). A session document carries it directly beforestatus:, an exchange document directly beforetitle:. Documents exported earlier get a value derived from their front matter when they are read; nothing is rewritten and no backfill is needed. cairn recall list --provenance VALUEandcairn recall digest --provenance VALUE(repeatable) keep only documents with that value.--provenance toolleaves out peer and routine runs.
Changed
cairn recall list --jsonandcairn recall digest --jsonrows carryprovenanceandowner. Text rows of both commands show the provenance value, andcairn recall expandprints aProvenance:line. Digest files carryprovenancein their front matter.- A present but empty
provenancevalue warns and is derived again, as an invalid one is. - The digest reads the
cairn invokepreamble (role, parent, owner, provenance) only at the start of the first user frame with text. A preamble pasted later in a session no longer marks it as a peer or routine run.
[2.9.0]
Added
cairn recall digest DATE: one UTC day of sessions condensed for a model to read, with provenance. Each session gives<source>-<shortid>.md(user text, assistant prose, one line per tool call, the head and tail of each tool output, no reasoning) and<source>-<shortid>.frames.jsonl(ordinal, UTC time, role, offset from the## Conversationheading, length,sha1_8,in_window,keptfor every frame of the session). A<!-- fN TS ROLE -->marker cites frame ordinalN, the stable id; thecairn:turnmarkers stay length frames. The window must be one day.--min-msgsdefaults to 1, so short sessions appear.--max-chars(default 40000) caps each body by whole frames, keeping user frames, then the tail, then the head. Output goes to$XDG_CACHE_HOME/cairn/digests/DATE/by default;--outrefuses a non-empty directory without the.cairn-digestmarker. A peer session fromcairn invokekeeps the start of its prompt and one answer per round, and names its caller asparent. A legacy or corrupt export is skipped with a warning, never guessed, and--jsonlists both underskipped; exit 3 means an empty day (nothing written).cairn recall frame REF ORDINAL [--frames FILE]: prints one frame exactly as exported. With the sidecar it checks offset, length and hash, and on a change prints a warning on stderr and the current frame, exit 0.cairn routine install | uninstall | run | list | status | kickstart: a named job underroutinesin config that runs a prompt file throughclaudeorcodexonce a day. launchd startscairn routine run NAMEatat(local time); each run handles every UTC day in the lastcatch_up_days(default 3) without a done stamp, oldest first: refresh the listedsourcesonce (--sincethe ISO date before the oldest day), render the prompt, runprepare, runcairn invoke <peer> --owner routine:NAME, runvalidate. Template variables{{DAY}},{{DATA_ROOT}},{{ATTEMPT_DIR}},{{DIGEST_DIR}}and one{{KEY}}peroutputskey; an unknown one exits 2 with no stamp. Exit 0 fromvalidatestamps the daydone, 3 stamps itempty, anything else fails it;prepareexit 3 stampsemptyand skips the peer. A day is done only aftervalidatepasses. A failed day is retried up to 3 attempts, and a run stops at its first failed day.budget_usd_per_day(Claude only) caps a day's spend through--max-budget-usd.run --dry-runprints every argv and the rendered prompt;run --day D --forcere-runs one day. Stamps live under$XDG_STATE_HOME/cairn/routines/NAME/, each attempt under<data_root>/routines/NAME/DAY/attempt-N/, the log at<data_root>/logs/routine-NAME.log.kickstartleaves a running instance alone unless--force-restart. launchd only (macOS): on another OSinstallprints the crontab line and exits 2. The config template shipsexample-daily, which runs nothing until installed. The workflow isskills/cairn/workflows/routine.md.- Config profiles:
invoke.claude.profilesandinvoke.codex.profileshold named profiles, each a built-inbase(review,edit,full) plusextra_argsemitted after the base's flags. A profile cannot drop its base's deny rules or switch to a looser permission mode; flags cairn sets itself are refused. Claude: one--permission-mode(the profile's replaces the base's),--disallowedToolsappends toreview's list,--allowedToolsand--disallowedToolstake one comma-joined string, and--settings,--mcp-config,--strict-mcp-configand--permission-prompt-toolneed basefull. Codex: only--add-dir DIRand-c KEY=VALUEpairs; a resume drops--add-dirwith a warning. A resumed thread reuses the recorded profile args, not today's config. An explicit--permission-modeor--sandboxreplaces only the mode of a config profile. cairn invoke --profile-args-file PATH: plumbing forcairn routine run, a JSON array of rendered args that replaces a config profile'sextra_argsfor one round. Plaincairn invokerefuses a profile whose args hold a{{NAME}}token.cairn invoke --owner LABEL: an owner label on the thread, each round, the result line, the exchange document and the peer session's front matter (owner:, kept across re-exports). A resume keeps the recorded owner and refuses a different one.- The
journalcollection in the config template: a store-less collection thatcairn syncregisters as<data_root>/journalonce a routine has written markdown there.config showlabels a store-less collection other thanservice-docsasnotes. cairn config unset KEYforroutines.<name>, an optional routine field, a routine output andinvoke.<peer>.profiles.<name>. It re-validates the file and restores it on failure. Unsetting a routine reminds you that its launchd job stays untilcairn routine uninstall.
Changed
--profileandinvoke.<peer>.profileaccept a config profile name next to the built-ins.cairn config settakes JSON objects forroutines.<name>andinvoke.<peer>.profiles.<name>, JSON arrays for argv fields (prepare,validate,extra_args), and a JSON array or comma list forroutines.<name>.sources.
Fixed
- The recorded background environment (cron line, hook launcher, Codex and Antigravity hook
registrations, a routine's launchd job) no longer pins
CLAUDE_CONFIG_DIRandCODEX_HOMEunless the host set them. WithCLAUDE_CONFIG_DIRexported, headlessclaude -pread<dir>/.claude.jsoninstead of~/.claude.jsonand reportedNot logged in. An existing install picks up the change on the nextcairn hook installandcairn cron install.
[2.8.1]
Changed
- The Claude Code update instructions (README, the Claude harness reference) are one
command,
/plugin marketplace update cairn: in a session it refreshes the marketplace and updates the plugins installed from it, and closing the panel reloads them./plugin update cairn@cairnon its own reinstalls the version the marketplace last saw.
[2.8.0]
The fix for the two dead rounds in docs/antigravity-soft-deny-postmortem.md: a headless
agy run on billing route gcp whose Application Default Credentials file existed but whose
refresh token Google had expired, and a plan-mode run that was soft-denied one read_file
outside the workspace, ended with no answer and still reported success.
Added
cairn invoke antigravityon routegcpprobes the ADC token before the spawn (gcloud auth application-default print-access-token, token discarded): a rejected credential (invalid_rapt, the Workspace session-length policy, which gcloud with no terminal reports as "Reauthentication failed. cannot prompt during non-interactive execution") refuses the run with exit 2 and the login command; gcloud missing, a timeout or a transport failure is abilling:warning, never a refusal.cairn doctorruns the same probe (up to 20 s):token ok, a warn line for a rejected credential, ortoken not verifiedwith the reason. A run agy itself could not authenticate names the cause from agy's log (ADC token refresh failed: ...), not retryable for a rejected credential.- A refused
read_filenames its path: agy's log says which step it soft-denied and the harness joins that to the path the stream showed. Thedeniedoutcome's error, thepermissions:warning and the resume note judge it against the read rules in force (deny beats ask beats allow, and anaskrule denies headlessly;read_file(<dir>)covers its subtree; a relative target is workspace-relative;write_filegrants read; a bare target matches the file name) and the roots the round could read with no rule (the workspace and every--extra --add-dir), which the round records aspermissions.roots:now readable (inside <dir>),still denied by read_file(.env*), orstill outside the workspace with no read_file rule.
Fixed
- A soft-denied tool call ended the turn with an empty answer and the round reported
status succeeded, exit 0,last_message null. agy may show no tool error for a soft deny; the result'sdenied_actionsalways counts it, and cairn read that count after the outcome was fixed. The outcome now counts it, in the live runner, inadopt, incairn invoke tail(which follows a live runner to its record, adopts the round when both processes are gone, and holds for another reader's adoption before classifying the stream itself) and instatus(a finished round's record is authoritative, so no progress message poses as the answer of a denied round). An adopteddeniedround exits 2 like a live one. Refusals merge the stream's tool errors, the log's soft denials and one entry per counted action type the others did not name. cairn invoke waiton a round that another reader is adopting (both processes gone, the thread lock held, nofinished_at) holds for that reader's record up to the peer'squiet_after_s, then reportsstatus: busy(exit 75) with the reason; it never builds a result from an unfinished round.- The docstrings and the skill said the turn goes on after an auto-denied call. Live runs show both shapes (a refusal with a tool error in the stream, a soft deny with none) and both can end the turn; the text says so.
Changed
- The
invoke-antigravityskill says which credential each billing route needs (ADC ongcp, agy's own login onplan), thatagy modelscan fail while agcprun works, and that plan mode reads the--cdtree with no rule: a file outside it goes inside, through aread_file(<dir>)allow rule,--extra --add-dir <dir>(last on the line, repeated on every resume) or pasted into the prompt.
[2.7.1]
Fixed
cairn invoke: when a peer reports its thread id, the run directory is renamed frompending-<uuid>/to the id.thread.jsonwas rewritten with the id after the rename, so for an instant the directory existed under its final name with a nullthread_idbeside a running round; a reader without the thread lock (one CI run was that reader) could see it. The file is now rewritten while the directory is still pending, so it is coherent the moment it appears.
[2.7.0]
The fix for the dead round in docs/antigravity-invoke-postmortem.md: a headless agy
run that was refused one shell command, gave up with an empty answer and still reported
success, after an 8-minute detour through settings files and hand-written log filters.
Added
cairn invoke antigravityrefuses anaccept-editsrun (--profile edit,--mode accept-edits) before anything is spawned when agy has nocommand(...)allow rule (exit 2,permissions check failed, the--grant-commandsline in the message), like the billing check. Plan and auto runs still start and carry apermissions:warning.--skip-permission-checkstarts an edit run that needs no shell.- Outcome
denied(exit 2,retryable: true): a round whose peer refused tool calls for want of a permission and ended with an empty answer. Theerrornames each refused command and the exact rule it needs (command(git log), judged against the rules recorded for the round; a compound command lists its unmatched segments). A refusal beside a real answer stayssucceededwith apermissions:warning that carries the same verdicts. The result andthread.jsoncarrydenied(tool and target per refusal) andpermissions(the allow and deny rules in force when the round started). cairn hook install --harness antigravity --grant-commandsnow also writes a deny set (supabase,psql,terraform,aws,gcloud,kubectl,curl,wget,python,python3,git commit|push|checkout|stash|reset,read_file(.env*)by name), prints every rule it added, and skips a default deny whose target the user allows explicitly (deny beats allow in agy).cairn doctorlists both rule sets.cairn invoke tail <id>: one line per event of the last round (START,TOOL,CMD,WRITE,DENIED,MSG,RESULT <outcome>), replayed fromevents-NN.jsonland followed until the final event;--round N,--no-follow,--json. Exit 0 onsucceeded, else the round's exit code. Works for every peer.cairn invoke wait <id>: block until the last round exits, print the same result line the runner printed (fromresult-NN.json; an abandoned round is adopted first) and exit with its code. One completion handle instead of a second waiter loop.- The result carries
files_written: every path the peer's write tools finished, from the event stream (antigravity;nullfor peers that do not report writes), so a peer's claims can be checked against what it did. The human summary and the exchange document list them; progress bullets readrun: <cmd>,wrote: <path>,denied: <tool> <target>. - On
--resume, cairn prepends a permissions note to the prompt when the agy rules changed since the previous round or that round had refusals: the rules added and removed, and for each refused command whether it is now allowed, still denied by a rule, or still unmatched (so the peer does not retry it). The note is recorded aspermissions.note. - The first stderr line now carries the events path next to the run directory.
- A
succeededround with no final message carries anempty answerwarning.
Fixed
cairn invoke antigravitypassed--disable-slash-commands, which agy 1.4.6 refuses to combine with--mode plan("--mode plan has no effect while slash command expansion is disabled"), so the review profile ran without plan mode.accept-editswas unaffected (the run logs show it applied). The flag is no longer passed; the prompt starts with cairn's preamble and cannot expand as a command.- A tool step agy ends in state
ERROR(how a refusal is reported) was ignored; it now yields thedeniedevent, or atool failedbullet for any other error.
[2.6.0]
Added
cairn invoke antigravity: run Google Antigravity'sagyCLI headlessly as a peer, the waycodexandclaudealready run. Verified against agy 1.4.6:-p=<prompt>with--output-format stream-json, the conversation id captured from theinitevent,--resumecontinuing the same conversation with--conversation, large prompts through--input-format stream-json, and--json-schemafor structured answers. Profiles map to--mode plan(review: writes and shell commands deferred),--mode accept-edits(edit) and--dangerously-skip-permissions(full);--modepasses a native mode directly. An unknown model or a missing login is reported as not retryable. Defaults live underinvoke.antigravityin the config.- Skill
invoke-antigravityfor both hosts. - Source adapter
antigravity(cairn antigravity export|list|context|note|close|log|resume, collectionantigravity-sessions): every agy conversation exports from the JSONL transcript agy keeps under<app data>/brain/<id>/.system_generated/logs/, with the title, workspace, run status and lineage fromconversation_summaries.db. User prompts lose agy's wrapper blocks, thinking is folded, tool results are paired with their calls, system messages render as### System, subagent conversations becomeantigravity-subagentdocuments in the parent's folder, and the agent's artifacts are listed. Peer runs (cairn invoke antigravity) now export and link the conversation like Codex and Claude peers. cairn hook install|uninstall|status --harness antigravity: a cairn-ownedStophook in the global~/.gemini/config/hooks.json(agy has no SessionEnd;Stopfires per turn).cairn hook handle --harness antigravityqueues the export and always answers{}so it never blocks agy. Link references accept every registered session source.invoke.antigravity.billing(route,project,location): which credits a headlessagyrun bills.inherit(default) passes the host environment through;planstripsAGY_ADC_AUTHso the consumer plan quota pays;gcpsetsAGY_ADC_AUTH=trueand theGOOGLE_CLOUD_QUOTA_PROJECT/GOOGLE_CLOUD_LOCATIONexports, refuses to spawn (exit 2) unless the Application Default Credentials file and a quota project exist, and after the run reads agy's own log (--log-file, kept aspeer-NN.log) to record the auth method, quota project and request projects asbilling.observed; a mismatch is abilling:warning.cairn invoke antigravity --billing ROUTEoverrides one round,cairn config set invoke.antigravity.billing.route gcpsets the machine default, andcairn doctorreports whether thegcproute is ready.
Changed
- Publication steps are decided per peer: a peer whose collection is not configured has no session document to export or link, so those steps are not applicable to its rounds (one warning in the result) instead of pending forever. With a known caller the exchange document still lands in the caller's folder and is indexed; without one, only the answer is kept under the run directory.
- Harness adapters own the bytes a large prompt takes on the peer's stdin
(
stdin_payload), and the recorded argv masks a prompt glued to a flag.
[2.5.1]
Fixed
- Claude Code exports
CLAUDE_CODE_SESSION_IDto every tool process, notCLAUDE_SESSION_ID(that name is only a template variable substituted into skill text). cairn read the wrong one, so under Claude Codecairn invokenever detected its caller without--parent(the exchange document then landed in the Codex session folder with nolinks:), andcairn claude note|close|logcould not infer the current session. The Claude adapter now readsCLAUDE_CODE_SESSION_IDfirst and still accepts a hand-setCLAUDE_SESSION_ID; conflicting values are refused like the Codex pair. - The test suite scrubs host identity variables, so running it from inside a Claude Code session no longer leaks that session into subprocess tests.
[2.5.0]
Upgrading from 2.4.0
Upgrade the engine (uv tool upgrade cairn) and the plugin, then run
cairn claude export --all and cairn codex export --all once. The export schema is now 2:
the full run re-renders every session document with the new head fields and, for the first
time, exports subagent transcripts as child documents. On a machine with a year of history
this is a one-time cost of a few minutes plus the embedding of the new child documents on
the next cairn sync --cron. Windowed cron runs never re-export old documents.
Added
cairn invoke codex|claude: run the other agent headlessly from either host, stream its events to a per-thread log, capture the real thread id, continue the same thread later with--resume, read progress mid-run withcairn invoke status, cancel withcairn invoke cancel, and finish pending publishing withcairn invoke publish. Defaults per peer (model, effort, profile, timeouts) live in the configinvokeblock.- Every peer run exports the peer session at once, writes
links:on both session documents, and records an exchange document (prompt, progress, answer and result per round) in the calling session's folder, so/searchandrgfind it (session recall lists the peer session; exchange documents stay out of the session timeline by design). - Health for long-running work: execution state, activity with age, and outcome are
reported separately; an idle watchdog kills a hung run; one invocation per thread is
enforced; a runner killed mid-run leaves an orphaned round that
statusadopts. cairn agents list|wait: one view over the peer runs and the Claude and Codex subagents a session spawned, and a blocking wait for a whole fan-out.- Claude Code subagent transcripts (
<session>/subagents/agent-*.jsonl, including workflow agents) export asclaude-subagentdocuments in the parent's folder with the agent's type, description, tool use id, spawn depth, request shape, model and lineage; parents gain a## Subagentsindex; child-to-parent messages render as Agent turns. - Codex subagent rollouts export as
codex-subagentdocuments with parent thread, role, nickname, path and depth; rollouts carryoriginator,thread_source,effort,sandboxandapproval_policy;custom_tool_callrecords render like function calls; inter-agent messages render as Agent turns marked encrypted. cairn recall list --include-subagents; JSON rows carrytypeandparent.- Skills
invoke-codexandinvoke-claudefor both hosts,references/peer-review.md(gate prompts, critical evaluation, the bounded convergence loop), and peer-run recipes in the harness references. linksis a preserved frontmatter field.cairn doctorprobes the configured QMD:qmd --version(warns below the tested 2.5.3 or on a prerelease) andqmd statusas a runtime check (a binary that crashes opening its index is now a critical failure). The embeddings line reports documents, vectors and pending documents.cairn doctor --strict-indexfails unless the index is readable and fully embedded; an empty index passes but says nothing can be verified.- Full sync logs a
[qmd-verify]line with the index-wide counts afterqmd embed, and afailed steps:line naming every failed step before=== FAILED ===.
Fixed
- Sync reported
[qmd-embed] okwhen QMD exited 0 with failed chunks (seen: 48,219 of 131,291 chunks after QMD's 30-minute embed session expired). The whole embed output is now checked for failed-chunk reports and chunk errors, and the run fails. A clean exit logs[qmd-embed] exited 0;[qmd-verify]gives the verdict. Pending documents after the embed fail the run asINCOMPLETE(failed steps: qmd-verify (incomplete)), and a non-empty index with no vectors, an unreadableqmd status, or aPendingline in an unknown shape also fails it. - Two
cairn syncruns could overlap (an hourly cron run during a manual one) and interleave their log blocks. A per-data-root sync lock now lets one run at a time. The other records its mode under<data_root>/sync-requests/, logs oneskippedline and exits 0; the running sync then runs, once, the stages the request needs that it did not run (a--cronrequest after a legacy--hookrun gets the worker retry, the other exports, update, embed and verify; a full request after a full run gets a hook-worker retry). Requests that arrive during that pass wait for the next invocation. - A timed-out sync step, hook export or
qmd updatekilled only its direct child, so the Node grandchild behind theqmdlauncher could keep running outside the index lock. The whole process group is now killed (also on Ctrl-C). A timeout keeps the partial stdout and stderr even when a descendant escaped the group, and process cleanup is bounded (cleanup incompleteis reported instead of an unbounded wait). - Full sync no longer runs
qmd embedafterqmd updatefailed. - The test suite wrote catalogs and lock files into the real home (
~/.cache/cairn,~/.local/state/cairn); CI now fails if it does. - Codex: a forked subagent rollout carries two
session_metarecords; the parser let the last one win, so the child was parsed as its parent and dropped by the fragment dedupe. The first record now wins and the replayed parent history is cut. On the author's machine this recovers 100 of 108 subagent rollouts. - Codex:
custom_tool_callandcustom_tool_call_outputrecords were silently skipped. - Claude: messages a subagent sent to its parent were dropped as meta records.
Changed
- Export schema 2; see Upgrading.
cairn doctorno longer says "All critical checks passed." without a qualifier when the semantic index is empty, unreadable or has pending documents.- Setup verifies keyword, vector and hybrid search separately and documents QMD compatibility and recovery without touching QMD's database.
cairn resumerefuses a subagent transcript and names the parent to resume instead.
[2.4.0]
Upgrading from 2.3.0
Run the setup skill again to follow its
update workflow. It upgrades the engine first,
then the plugin, using the relevant host adapter. Afterwards it runs
cairn hook install --harness claude (or codex) so
the SessionEnd hook records the engine's interpreter and config. Until then the
bundled launcher falls back to cairn on PATH. If the plugin updates before the
engine, the launcher detects the 2.3.0 engine, runs the legacy cairn sync --hook
detached, and prints the upgrade command to the hook log.
Keep the existing Markdown store and QMD database; no full rebuild is required.
Legacy metadata remains readable and upgrades on export when native data is available.
For older history, optionally export each enabled source with --all, then run
cairn sync --cron. Rewritten documents need their embeddings refreshed; unchanged
documents do not. See the setup skill's update workflow for preservation and
unavailable-history behavior.
Reinstall hooks and the existing cron entry to record the complete QMD environment.
Added
-
Hooks and cron retain the selected QMD configuration, cache and database paths, including effective defaults, instead of inheriting a different host index.
-
Index writers coordinate on canonical configuration and database resources, even when environment aliases or different cache directories refer to shared state.
-
Collection discovery and registration time out after 30 seconds; failed hook jobs release their locks and can be retried.
-
Legacy Claude
agent-*sidechains are intentional skips, not export failures. -
Legacy date-only records retain their recorded day label across machine timezones.
-
Structurally invalid catalog caches rebuild from Markdown instead of crashing.
-
Shared Claude/Codex harness adapters, portable packaging, explicit Codex onboarding, and discovery-based lifecycle registration with trust diagnostics.
-
Durable session exports queued to a detached worker; failures get at most three attempts, index updates are serialised, and embedding stays out of the callback. Completed and disabled requests and exhausted failures are pruned seven days after becoming terminal.
cairn hook retry SOURCE:FULL_SESSION_IDexplicitly resets a failed request's attempt budget;cairn hook statusshows every actionable request plus the ten most recent completed ones (--all). -
Recall of exported conversations across sources with source-qualified IDs, UTC activity filtering, schema migration, bounded expansion, and safe concurrent annotations.
-
Native resume command selection, host-aware diagnostics, and shared skill references.
-
A stat-validated session catalog (
$XDG_CACHE_HOME/cairn/catalogs/) so session lookup,listandrecallcost one directory walk instead of parsing every exported file. The catalog is a derived cache: entries are trusted only while the file's mtime/ctime/size/inode match, and a missing or corrupt catalog is rebuilt. -
A POSIX
shhook launcher (hooks/launch.sh) that never depends on the macOS/usr/bin/python3stub. -
Resource locks under
~/.local/state/cairn/locks/keep lock files out of Markdown and QMD directories while coordinating shared canonical paths across profiles. -
Community health files:
CODE_OF_CONDUCT.md,SECURITY.md, issue and pull request templates, and Dependabot configuration. -
CI: a
version-bumpgate that requires__version__to change whensrc/cairn/is modified. -
Live verification and outstanding desktop/skill-evaluation acceptance recorded in
docs/codex-acceptance.md.
Fixed
- Hook and cron index updates create the QMD database and config directories they pin, so the first job on a machine where QMD has never run no longer fails.
- A code fence left open in
## My Notesno longer swallows the conversation that follows it, which made every export append another copy of the conversation. - Granola notes and summaries containing
## Conversationno longer cause handwritten## My Notescontent to be discarded on re-export. - Recall expansion preserves embedded CRLF line endings so message limits remain accurate for existing exports. Annotation edits preserve transcript bytes and their turn lengths as well.
Changed
- The setup skill handles existing installations through a dedicated update workflow; the README points users there for upgrades and optional historical metadata backfill.
- Exported frontmatter records
activity_dates(unique UTC days) instead of one line per message timestamp; the full timestamps remain in each turn header. Files written by the pre-release branch withactivity_timestampsare still read.
[2.3.0]
Added
- First-class ripgrep search in the skills.
/searchgets an rg engine (--exact, or chosen automatically for identifiers, error strings, paths, session IDs and regex), and/recalltopic mode runs an exact-match rg pass next to the BM25 searches. rg reads the markdown directly, so it also finds files that QMD has not indexed yet. - The skills resolve each collection's directory from
qmd collection show, so rg also covers collections outsidedata_root. No path is hardcoded. - Output guardrails for rg in both skills: list files first (
-l, newest first via--sortr modified, capped withhead), then print lines for chosen files only with-M 300 -m 5. A session transcript can hold a single line of several megabytes. cairn doctorchecks forrgon PATH. A missing rg is a warning, never a failure./cairn:setuppreflight reportsrgand offers to install it (optional).
[2.2.0]
Added
- The plugin manifest version is now locked to the Python package version:
.claude-plugin/plugin.jsondeclaresversionequal tocairn.__version__, enforced by a test (andrelease.yml) so the plugin and engine can never drift apart in the repo. One release is one version across both artifacts. cairn doctordetects plugin/engine drift: given the plugin manifest (--plugin-manifest, or$CLAUDE_PLUGIN_ROOTwhen run from the plugin) it compares the installed engine version to the plugin version and tells you touv tool upgrade cairn(or/plugin update) when they differ.
Changed
- The CI
version-bumpgate now fires for any user-facing change - the engine (src/cairn/) or the plugin (skills/,hooks/,.claude-plugin/,commands/,agents/) - so plugin-only changes also bump the shared version (and the plugin cache actually refreshes for users). service-docs --versionnow reports the cairn package version instead of a stale hardcoded1.0.0.
[2.1.0]
Added
- Self-healing QMD collection registration:
cairn syncnow idempotently runsqmd collection addfor every enabled collection that has markdown on disk (newqmd-collectionsstep, beforeqmd update, in all modes). A fresh install no longer needs the manualqmd collection addstep, and sources that produce data later (Cursor/Codex/Granola) register automatically on a subsequent sync. cairn doctornow checks that enabled collections are registered in qmd and that the index has embedded vectors - so a green doctor reflects a searchable index, not just wired-up plumbing. Both are warnings (a fresh install is legitimately empty until the first embed).cairn.qmd.list_collections()andcairn.qmd.ensure_collection()helpers.cairn config add-service-doc NAME PATH [-d DESC]andcairn config remove-service-doc NAMEto configure theservice-docscollection's folders from the CLI (previouslyservice_sourcescould only be set by hand-editing JSON). The add command validates the path exists and clears the bundled placeholder on first use.cairn config shownow lists each service-docs folder./cairn:setupnow gives service docs their own question (separate from the session sources) and prompts for the folders to mirror, instead of bundling service-docs on the same checkbox as granola.
Changed
- The first
qmd embedduringcairn sync --cron/--allmay download ~2GB of models; its timeout is raised from 600s to 3600s so an unattended first run can finish. /cairn:setupnow bootstraps collections and runs the first embed (watched via the Monitor tool) and verifies a real query returns results before declaring success - it no longer stops at a greencairn doctor.
[2.0.0]
- Repackaged as an installable CLI (
src/layout, hatchling) and a Claude Code marketplace plugin (skills + SessionEnd hook).