Cue Anchored Memory
ASecurityUse when you are about to record a situational operational fact for future sessions: a gotcha, a local convention, a "never do X when touching Y". Such facts fail by not being delivered, not by not being stored, so give each one a trigger condition (path, symbol, semantic, event or temporal cue) and the most deterministic delivery this system has: an enforcing check, a cue-fired hook injection proposed to the operator, or at minimum an always-loaded index line. Never leave a load-bearing fact...
- 72 stars
- 0 votes
- 0 copies
- 1 view
- Added November 28, 2026
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add Tibsfox/gsd-skill-creator --skill cue-anchored-memory --agent claude-codeAre you the author of Cue Anchored Memory?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tibsfox-cue-anchored-memory)---
name: cue-anchored-memory
description: >
Use when you are about to record a situational operational fact for future
sessions: a gotcha, a local convention, a "never do X when touching Y". Such
facts fail by not being delivered, not by not being stored, so give each one
a trigger condition (path, symbol, semantic, event or temporal cue) and the
most deterministic delivery this system has: an enforcing check, a cue-fired
hook injection proposed to the operator, or at minimum an always-loaded
index line. Never leave a load-bearing fact in a file that is read only when
the agent chooses to, and never install a hook yourself. Write the reason
beside each fact so that a later editor can retire it. Distinct from
memory-hubness-gate and memory-use-warrant, which guard vector-memory writes
and the use of recalled memory. Backed by arxiv 2607.20972 (cue-anchored
memory), 2608.11095 (catastrophic remembering) and 2609.25686 (enforcement
ladder). Triggers on saving a gotcha or convention to memory and on pruning
an always-loaded file.
description-frequency: on-demand
user-invocable: true
version: 1.2.1
format: 2025-10-02
triggers:
- "remember this gotcha for next time"
- "save a note about what to do when touching this file"
- "this convention got lost after compaction"
- "this always-loaded file is too long, which lines can go"
updated: 2026-11-29
status: ACTIVE
source: arxiv 2607.20972 (cue-anchored memory delivery), arxiv 2608.11095 (catastrophic remembering in instruction files), arxiv 2609.25686 (task-state enforcement ladder)
---
# Cue-Anchored Memory
A write-time rule for operational memory, with a matching rule for pruning.
When you record a fact that matters only in a particular situation, record
the situation as a trigger condition and choose a delivery channel that does
not depend on a future agent deciding to look.
## Why
The cue-anchored memory model (arxiv 2607.20972) treats reliable agent memory
as a delivery problem. Documents have to be deliberately written and read
back; situationally-bound facts need a second tier that is a property of the
harness, with trigger conditions over a small vocabulary (path, symbol,
semantic, event, temporal) evaluated deterministically. In its controlled
evaluation on a real coding task, voluntary memory use was near zero even with
a pre-seeded store (0 memory operations in 114 turns), while deterministic
injection delivered in every seeded run with zero false alarms. In a
repeated-compaction probe, facts injected from a harness-owned store arrived
intact through all 138 compact-resumes; the same facts held only in
conversation vanished at the first summary.
This system already has both ends. Always loaded: `CLAUDE.md` and the
`MEMORY.md` index, which the harness puts in context every session. Enforced:
`git-add-blocker.js`, the commit-message hook, the audit tests that fail a run
when a chokepoint is skipped. The weak middle is a topic file with no index
line, or a paragraph in a handoff: it is read only if the next agent chooses
to open it.
This skill is itself a voluntary channel. Its job is to move facts out of
voluntary channels at the moment they are written.
## Data classes touched
Writes project-internal operational notes. Boundary rules: a cue record never
contains credentials or `never-surface` content (a fact that needs them points
to where they live); and anything delivered by a hook or an always-loaded file
is shown in every matching session, so it must be safe to show there.
## How
1. **Decide whether the fact is situational.** It is if it applies only when a
specific thing is touched or happens: a path, a command, an identifier, a
lifecycle event, a date window. User-profile facts, project status and
external references are not situational: store them as ordinary memory and
stop here.
2. **Write the cue.** One or more conditions from the five kinds, joined with
AND when more than one is needed:
| Kind | Fires when | Example |
|---|---|---|
| path | a file matching a glob is read or edited | `src/**/*store*.ts` |
| symbol | an identifier appears in the edit or command | `child_process`, `install.cjs --force` |
| semantic | the task matches a described intent | "publishing release notes" |
| event | a harness event occurs | `SessionStart`, `PreCompact`, before `git commit` |
| temporal | a date or window is reached | "until the next release ships" |
3. **Write the fact** in at most two lines: the instruction, then the reason.
The reason lets a later reader judge edge cases and retire the fact when the
reason is gone. It is also what keeps the file prunable: across 247,694
instruction lifetimes in 1,867 repositories, agentic prompts such as
`CLAUDE.md` grow nearly monotonically, more than tripling over their
lifetime, because appending is always cheap while deleting an instruction
whose reasoning is gone is exponentially costly to do without risking a
regression; in verifiable worlds built by inverting IFEval, comments that
record the reasoning remove 99.3% of the excess size (arxiv 2608.11095).
4. **Choose the delivery tier, strongest available first.** A controlled
comparison of four ways of delivering task state to an agent (arxiv
2609.25686) supports the order: displaying accurate state is unreliable,
directives help in proportion to the model's obedience, and enforcement
needs no obedience.
- **Enforce.** If the fact can be a deterministic check (a test, a lint
rule, a blocking hook), propose that check. A fact that is enforced does
not need to be remembered. Enforcement is bounded by the correctness of
its state and of its matcher: in the same comparison a gate compiled
from an airline policy raised a 235B agent's pass^1 from 0.39 to 0.54
and changed nothing for a 35B agent that rarely violated the policy,
and on another benchmark enforcing the matcher's judgement dropped a
35B agent below its raw transcript. So propose this tier where the
failure can be decided from state the check sees and happens often
enough to matter, and state with the proposal what the check matches on
and what it will refuse wrongly. `git-add-blocker.js` counts a command
that could rewrite a file (`sed`, `cp`, `rm`, an interpreter, an editor)
given `.gitignore` as an argument as a change to the ignore rules and
then judges every add on the line as forced, so it refuses
`sed -n '1,20p' .gitignore && git add -A`, which changes nothing;
that is the cost of a matcher. A matcher errs in both
directions: it also passes what it does not parse, so its silence is
not permission. A rule that needs judgment to apply cannot be enforced
this way; deliver it by the next tier.
- **Inject on cue.** If it is advice, or a rule that needs judgment to
apply, propose a hook that adds the fact as context when the cue fires
(a `PreToolUse` matcher on the path or command, `SessionStart`, the
compaction events).
- **Index line.** At minimum, give the fact a one-line entry in the
always-loaded index (`MEMORY.md`), worded so that the cue is in the line
itself. This is delivery with the cue "every session": reliable, and paid
for in context every session, so keep it to one line and put the detail
in the topic file.
5. **Propose, do not install.** Enforcing checks and hooks change the harness.
Output the cue record and the proposed check or hook entry for the
operator; apply it only on an explicit go. In this repository a hook is
authored in `project-claude/hooks/` and `project-claude/settings-hooks.json`
and deployed with `node project-claude/install.cjs`; in a project with no
such source tree, use the harness's own settings route (its `update-config` skill).
The index line is the one tier you write directly.
6. **Give it an end.** Record the condition under which the fact stops being
true (a version, a fix, a date). When it is met, remove the index line or
withdraw the proposal.
7. **Prune by reason.** When asked to trim an always-loaded file, go line by
line and return a proposal; delete on the operator's go. Reason recorded
and its end condition verifiably met: propose removal, with the evidence.
Reason still true: keep. A guard (MUST, NEVER, fail closed) or a recorded
user instruction is listed for the operator, never removed on your own
reading. No reason recorded: do not delete on a guess, and do not keep by
default either; recover the reason (its topic file, the session, or for a
tracked file the commit that added the line) and write it beside the line,
or mark it "reason unknown" and ask.
### Cue record
```yaml
cue:
- kind: path
when: "src/**/*store*.ts"
- kind: symbol
when: "node:fs"
fact: "Call ensureAllowed() before any fs access in this file."
why: "The loader-context audit test fails otherwise, and only a full vitest run shows it."
delivery: enforce # enforce | inject | index-line
proposed: "<the test, hook entry or index line, verbatim>"
expires: "<condition or date>"
```
### Robustness rule
Judge a memory by how it will be delivered, not by how well it is written. A
careful paragraph in a file nobody is made to open is weaker than one blunt
line the harness always shows.
## Confidence / failure model
Choosing the cue is an **LLM judgment**: a cue that is too narrow never fires,
and one that is too broad fires as noise. The zero-false-alarm result cited
above belongs to that paper's evaluation, not to cues written here. The
enforcement-ladder figures are for task state inside a run on that paper's
benchmarks; reading its order across to operational memory between sessions
is this skill's extension. A hook
evaluates a path, symbol, event or temporal cue deterministically; a semantic
cue is not deterministic, and without a harness feature that matches intents
it falls back to the index-line tier. Fail-closed defaults: (a) a fact you
believe is load-bearing but cannot give a cue gets an index line; (b) no hook,
test or settings change is made without the operator; (c) a fact that would
expose sensitive content in every session is not promoted to an always-loaded
tier.
## When to skip
- The fact is not situational (step 1).
- It is already enforced: point to the check instead of writing a memory.
- It matters only inside the current conversation.
## Integration
- **`project-claude/` and `install.cjs`** — the route for installing a proposed
hook in this repository, on the operator's go. The harness's
`update-config` skill is the route where a project has no such source tree.
- **security-hygiene** — hooks and `.claude/` are self-modification; "propose,
do not install" is that skill's confirmation rule applied to memory.
- **memory-hubness-gate / memory-use-warrant** — guard writes into vector
memory and memory consolidation, and the use of recalled memory. This skill
covers a different failure, the fact that was stored and never delivered,
and does not replace their checks.
- **context-handoff / session-awareness** — a handoff carries state across one
boundary; a gotcha that should outlive the next session belongs in a cue
record, not only in the handoff.
- **operational-anchor-preservation** — when an always-loaded file is
shortened, cue-bearing index lines are anchors to keep. Step 7 here is the
other half: a line whose recorded reason has expired is not an anchor.
- **guard-refusal-protocol** — the receiving end of the enforce tier: what an
agent does when a guard fires, and how a wrong refusal is reported so that
the matcher is fixed.
- **memory-retraction-sweep** — taking a fact back once it has spread; the
reason and end condition recorded here are what make that traceable.
Files in this skill
- SKILL.md
- triggering.test.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.