Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By naoto256v0.1.0Apache-2.0In 1 marketplace
Amnestic Trace — replaces a session's short-term working memory across a context boundary. Wires a PreCompact hook that detaches an extraction worker, three hooks that race to inject the result at the earliest moment it can reach the session, and the /amtr skill for cross-session handoff.
Claude loads one when your task matches it, or you run it by name.
1 critical · 2 cautions to review before installing
A hook runs before every tool call and can block or approve it
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Amnestic Trace replaces a session's short-term working memory across a context
boundary. This plugin wires one capture hook and three delivery hooks that make
that automatic on both Claude Code and Codex, and ships the /amtr skill for
handing memory to another session.
PreCompact hook (declared in both hooks/claude.json and
hooks/codex.json → tools/amtr-hook.sh synthesize).
Forwards the host payload to amtr synthesize, which records an undelivered
snapshot and detaches a worker before returning. Extraction therefore runs in
parallel with compaction itself rather than delaying it.SessionStart hook, matched to compact
(tools/amtr-hook.sh recall SessionStart). Fires the instant a compaction
ends, which is the earliest anything can be injected — PreCompact cannot
inject on either host, and would have nothing to inject if it could, since the
extraction has only just been handed its input. Extraction runs beside the
compaction, so the two race; when extraction wins, the memory lands here,
before the resumed session does anything else. When it does not, this hook
waits on the shared window below rather than abandoning the debt.PreToolUse hook (tools/amtr-hook.sh recall PreToolUse). Delivers the snapshot at
the first tool call after it is ready, for the stretch where the session keeps
working and the user has not spoken again. If extraction is still in flight it
opens or joins the one 25s deadline shared by all three delivering hooks for
that compaction debt. Arrivals inside the window wait only for its remainder;
arrivals after it atomically fold the unfinished debt.UserPromptSubmit hook (tools/amtr-hook.sh recall UserPromptSubmit). For
turns that call no tools at all. It opens the shared deadline when it arrives
first, or joins the remainder already spent by SessionStart or PreToolUse; it
never grants the same debt a second budget. Like the other two events, if the
marker is still ongoing when that window expires it atomically folds the
debt. A ready claim published in that race survives for a later event./amtr skill (skills/amtr/). A thin wrapper over
amtr recall Handoff --amtr-key for the cross-session case, plus a bare /amtr for
reading back this session's own key. Compaction inside one session needs no
key and no skill.The three delivering hooks can fire on the same turn once a snapshot is ready, and so do concurrent tool calls — the shared deadline wakes every waiter at once, so they reach the ready claim together by design. The marker is what stops the memory being injected twice, but it has to be taken before the injection to do that: whoever gets there first renames it out of everyone else's reach, which exactly one caller can win, and only that one delivers. Discharging it afterwards would settle the bookkeeping after the second copy had already reached the host. Ownership is checked against the exact claim, so a newer snapshot landing mid-turn survives untouched in a marker of its own.
A held claim is either discharged or put back, but a process killed between the
two leaves the file it was holding behind. The next synthesize sweeps any left
over, since a new compaction supersedes whatever they were holding anyway.
The binary serializes additionalContext for the exact event it was handed.
PreToolUse ignores plain stdout on both hosts, so building this object in the
binary keeps JSON escaping and claim discharge in one operation.
Both hosts run the same tools/amtr-hook.sh, but each declares it in its own
file: hooks/claude.json and hooks/codex.json, each named by the hooks key
in that host's manifest. Neither is found by convention, so the pairing is
stated rather than inferred. The script is shared because the work is
identical; it deliberately contains no JSON, clock, path or claim logic. It
repairs PATH, forwards the canonical command and makes failures non-fatal. The
declarations are split because what can be asserted about each host is not.
Concretely, both files set timeout explicitly, in seconds — 10s for the
capture hook, which returns as soon as the worker has detached, and 35s for each
delivering hook, which needs room for a 25s wait plus the read that follows.
Both numbers come from what this plugin does rather than from either host's
default, and Codex's default of 600s is far too long for a hook that might be
waiting on an extraction that has died.
The Codex file sets additionalContextLimit on all three delivering hooks, which
Claude Code has no equivalent for. Codex caps model-visible hook output at
roughly 2,500 tokens and spills the rest to a file, handing the model a preview
and a path; memory delivered that way is a reference the model has to choose to
follow. The handoff is kept under that on its own — this is the margin, not the
mechanism.
amtr on PATH:Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub naoto256/amnestic-trace --plugin amtrPlugins from other owners that cover similar ground