Repository navigation
Releases
v0.2.1 — read-path hardening, atomic writes, instant-aware sync
Family release: @leonard-memento/core 0.2.1, claude-code-memento 0.2.1, codex-memento 0.2.1.
Fixes from the 2026-11-06 re-audit — no behavior change for valid configs; the injected block stays byte-identical to v1.0.0.
Security / correctness
memoryIndexPathnow validates its inputs loudly instead of silently resolving the wrong tree:~-relative memory roots (option orMEMENTO_MEMORY_ROOT) throw — nothing in the chain expands~, so the literal path hashed to a tree nobody reads (silent amnesia);indexFilemust be a plain file name: absolute paths,../traversal, separators and~are rejected. Previously a plugin tuple config in a cloned repo could point the injector at any file on disk (indexFile: "../../../../.ssh/id_ed25519") and its content went straight into the compaction prompt.
- Hooks decode stdin as a single buffer. Per-chunk
+=decoded each pipe chunk independently, corrupting multi-byte codepoints split across chunk boundaries — a non-ASCII project path silently hashed to the wrong project.
Data safety
- All writes are atomic (sibling temp file + rename): an interrupted run can no longer truncate the user's
AGENTS.md,.claude/settings.json, orMEMORY.md. The old "crash-safe" comment was aspirational; now it is true. upsertBlockrefuses unpaired markers (MementoError: UNPAIRED_MARKER) instead of appending — the next run used to pair the stray begin-marker with the new block and replace everything in between, including content parked after the orphan.memento sync claudecompares timestamps as instants (Date.parse, lexicographic fallback): mixed timezone offsets (10:00+03:00vs08:00Z) no longer pick the older side as the winner.- Duplicate fact names warn (
report.warnings): two files claiming the same front-matternamepreviously meant one of them silently never synced.
Smaller
runHookwraps the decision call: loud config errors now degrade to silence for the host instead of rejecting (the CLI bins already caught it; the exported function now keeps its "every path exits silently" contract).memento init crushhint notes that~/.config/crush/CRUSH.mdis global — one project per machine.
Tests: 107/107 (was 90; +17 regression tests, TDD). Install order: core first — see RELEASE.md.
Hotfix (same version, tag moved to b919fcd — nothing had been published yet)
Version sync folded into the same tag: all packages share the family minor.patch — claude-code-memento and codex-memento renumbered 0.1.2 → 0.2.1, opencode-memento bumped to 1.2.1 (its code changed under the already-published 1.1.0, so it publishes under a new version; none of the renumbered versions had ever been on npm, so the retarget is free).
Second-pass re-audit findings, all fixed with regression tests. CI matrix (ubuntu + windows, Node 20/22) is green for this commit; the previous tag target failed the Windows job.
- OpenCode plugin:
default.server(input, options)now forwards to the plugin. The OpenCode >= 1.3.4 loader callsserver()and never reaches named exports, so tuple options (memoryRoot,indexFile) were silently dropped on every V1 release. The README's "object exports are ignored" story was wrong and is corrected. - Adapters pin
@leonard-memento/coreto^0.2.1(was*, which resolved to the unhardened 0.1.0 on npm). memento sync claude: validates the memory root (a~-relative root created a literal./~/tree and reported success); conflict detection compares instants like the ordering does (same instant in different offsets no longer overwrites); honorsindexFile/MEMENTO_INDEX_FILE; fact names containing]]are appended to the index once.- Atomic writes: write through symlinked targets instead of replacing the link, preserve the existing file mode (0600 stays 0600), remove the temp file when the rename fails.
memento init: an END-only stray marker isUNPAIRED_MARKERtoo; a non-object JSON root orhooksvalue isINVALID_JSON_SHAPEinstead of a silent{}or a raw TypeError.memento inject: on invalid config prints onememento: ...line to stderr, empty stdout, exit 0 (no doubled prefix).projectHash/memoryIndexPath: reject non-string or empty directories loudly.- Types:
MementoErrorCodeunion, documented throws and option constraints,syncClaude({ indexFile }). - Docs: V2 config scope (global + project
pluginsmerge,canonical= main worktree), upstream hook surface (session.compactedremoved in 2.1.0,instructions.entryin 2.2.0), RELEASE.md now requires a green full CI matrix before tagging.
Tests: 126/126 (was 107).
v0.2.0 — sync claude + first-class Claude Code & Codex adapters
Family release: @leonard-memento/core 0.2.0, claude-code-memento 0.1.1, codex-memento 0.1.1 (opencode-memento 1.1.0 is already on npm).
What's new since v0.1.0
memento sync claude (core 0.2.0)
Bidirectional fact sync with Claude Code auto memory (~/.claude/projects/<slug>/memory/):
- facts matched by name (front-matter
name, else filename stem); - never deletes on either side; a fact newer by timestamp (
updated/modified) overwrites the older copy verbatim; - identical content skipped; same-timestamp conflicts reported and left untouched;
- both
MEMORY.mdindexes are only ever appended to — manual ordering and prose stay byte-for-byte; --dry-runcomputes the plan without writing.
Claude Code & Codex first-class adapters
claude-code-memento and codex-memento register a SessionStart (matcher: compact) hook that re-injects the project's memory index after every manual or automatic compaction. Zero dependencies, Node >= 20.
Platform & docs
- CI now covers Windows first-class (2 OS x 2 Node).
- New docs: comparison page, Claude Code interop guide, COMPATIBILITY contract.
Install: core first (npm publish -w packages/core family order, see RELEASE.md). The injected block stays byte-identical to opencode-memento v1.0.0 — existing memory trees keep working.
v0.1.0 — leonard-memento memory family
Amnesia insurance for coding agents: a curated Markdown memory index that survives context compaction. Zero dependencies, plain ESM, stock Node >= 20.
Packages (npm):
- @leonard-memento/core@0.1.0 — shared reader + memento init CLI
- opencode-memento@1.1.0 — OpenCode 1.18.x + 2.x (continues the opencode-memento 1.0.0 line)
- claude-code-memento@0.1.0 — Claude Code SessionStart hook
- codex-memento@0.1.0 — Codex CLI SessionStart hook
Live-verified with the pineapple test (magic word survives /compact): OpenCode 1.18.33, OpenChamber 2.0.20, Claude Code 2.1.286, Codex CLI 0.159.3.
Successor of the archived opencode-memento (1.0.0 stays on npm as-is).