Skip to content
Back to skills

Memory Retraction Sweep

ASecurity

Use when a remembered fact has to be taken back, because it turned out wrong, the user withdrew it, or it should never have been stored. Deleting the memory record does not make the system forget, since summaries, plans and files derived from it keep acting on it, and telling yourself to disregard it is the form of forgetting that fails under probing. Name the target and why it goes, find when it entered, list everything derived after that point, clear the source first and re-derive what depe...

  • 72 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 29, 2026
ai-agentsgoshellgit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add Tibsfox/gsd-skill-creator --skill memory-retraction-sweep --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Memory Retraction Sweep?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Memory Retraction Sweep
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tibsfox-memory-retraction-sweep/badge)](https://www.skillsdirectory.com/skills/tibsfox-memory-retraction-sweep)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: memory-retraction-sweep
description: >
  Use when a remembered fact has to be taken back, because it turned out
  wrong, the user withdrew it, or it should never have been stored. Deleting
  the memory record does not make the system forget, since summaries, plans
  and files derived from it keep acting on it, and telling yourself to
  disregard it is the form of forgetting that fails under probing. Name the
  target and why it goes, find when it entered, list everything derived after
  that point, clear the source first and re-derive what depended on it, say
  plainly that the current session still holds it, and test by whether a
  fresh session would still act on it. Distinct from skill-revocation-sweep
  (withdrawing a skill) and cue-anchored-memory (pruning a line whose reason
  expired). Backed by execution-state unlearning (arxiv 2609.04875). Triggers
  on forget requests and on deleting a memory that was wrong.
description-frequency: on-demand
user-invocable: true
version: 1.0.0
format: 2025-10-02
triggers:
  - "forget what I told you about that"
  - "that memory was wrong, delete it"
  - "remove this preference, I no longer want it applied"
updated: 2026-11-28
status: ACTIVE
source: arxiv 2609.04875 (execution-state unlearning for stateful agents)
---

# Memory Retraction Sweep

Forgetting, done as a sweep over what was derived and not as one deletion.
The record is the smallest part of what remembers.

## Why

Forgetting in a stateful agent means the whole runtime must behave as if it
had never observed the target; deleting a plaintext memory record leaves
derived summaries, pending tool plans and the KV cache intact.
Execution-state unlearning (arxiv 2609.04875) models the runtime as a
deterministic transition system and proves that the prefix before the target
is shared with the counterfactual world for free, that the suffix after it is
irreducibly tainted without token-level attribution, and that exact
unlearning requires at least T-τ+1 recomputed transitions, where τ is the
step at which the target was injected. In its audits, memory deletion leaves
leakage unchanged, instruction-based forgetting collapses under elicitation
(Leak@probes = 1.00), and source redaction still acts on a revoked
preference in 80% of episodes, while Provenance-Guided Selective Replay,
which uses a provenance graph, KV-cache cropping and sanitized replay, is
indistinguishable from a full reset at up to 9x fewer recomputed tokens.

On this system a remembered fact spreads through files. It has a topic file
and a line in the always-loaded `MEMORY.md` index; other memories link to it
or restate it; handoff documents and `.planning/STATE.md` carry conclusions
drawn from it; a line in `CLAUDE.md` or a skill may have been written
because of it; a plan may still contain steps that exist only because it was
believed. And the session that is asked to forget has it in context.

## Data classes touched

Reads and edits memory files, handoffs and planning notes. Boundary rules:
(1) the sweep does not copy the target into new places while looking for it
(search by its distinctive terms, report by path), and it knows where its
own actions are recorded: while an observation session is active, the
tool-trace hook writes each search pattern, each file path read or edited,
each agent description and the start of each shell command to
`.planning/sessions/current.tool-trace.jsonl`, and two guard hooks keep
decision logs under `.claude/hooks/.log/`: `git-add-blocker.js` records the
start of each command it blocks or lets through on an override, and
`self-mod-guard.js` records the path it matched; for a *sensitive* target
those files are carriers too and the operator is told;
(2) a note recording the
retraction must not restate a target that was withdrawn for being sensitive;
(3) edits to tracked files, skills, `CLAUDE.md` and anything under
`.claude/` follow their usual routes and confirmation rules.

## How

1. **Name the target and the reason.** One sentence for what is being
   retracted, and which of three reasons applies: it is *wrong* (replace it
   with what is right), it is *withdrawn* (the user no longer wants it
   applied), or it is *sensitive* (it should not be held at all). The reason
   decides what may remain.
2. **Find the injection point.** When did it first enter: the session and
   the message in which it was first said. Take the earliest evidence you
   have. The first commit of its record and a file's modification time are
   upper bounds only: the fact can have entered before the record was
   written, and any later edit moves a modification time forward. When an
   upper bound is the only evidence, search everything. Everything last
   modified before the injection point is clean and needs no search.
   Everything written after it is suspect, and so is a file created earlier
   and changed afterwards.
3. **List the carriers written after that point.**

   | Carrier | Where to look |
   |---|---|
   | the record | its memory file |
   | the index | its line in `MEMORY.md` |
   | other memories | files that link to it or restate it |
   | summaries | handoff documents, `.planning/STATE.md`, session notes |
   | plans | task lists and plan steps that exist because of it |
   | instructions | lines in `CLAUDE.md`, skills or agent definitions derived from it |
   | indexes | any embedding store or knowledge graph that ingested it |
   | running work | subagents briefed with it |
   | transcripts | session transcript files and compaction summaries on disk |
   | tool traces | `.planning/sessions/current.tool-trace.jsonl`, other observation logs and the guard hooks' logs under `.claude/hooks/.log/`, which record search patterns, paths and command text |
   | this session | your own context |

4. **Clear the source, then re-derive.** Remove or correct the named record
   and its index line first. For each derived carrier prefer rewriting it
   without the fact, or re-deriving it from clean inputs. Where deleting a
   carrier seems right, list it for the operator instead of deleting it.
   Session logs, tool traces and transcripts are never deleted or rewritten
   by you; list them for the operator. Removing the sentence that
   states the fact is not enough when a conclusion beside it
   depended on it: a decision taken because of the fact is taken again
   without it.
5. **Be exact about this session.** You cannot unsee the target. Saying that
   you will disregard it is instruction-based forgetting, the form that
   collapsed under probing. So say that this session still holds it; do not
   act on it; do not write it into anything new (a handoff, a memory, a
   brief, a commit message); and for a *sensitive* target tell the operator
   that ending or clearing the session removes it from context, while the
   session's transcript on disk still holds it, and that removing the
   transcript is theirs to do.
6. **Leave the right trace.** For a *wrong* fact, leave the correction where
   the fact was, so that it is not derived again. For a *withdrawn* one,
   record that the preference was withdrawn and when. For a *sensitive* one,
   leave nothing that restates it; if a trace is needed at all, it names the
   category and the date only.
7. **Test by behaviour.** Search the carriers for the target's distinctive
   terms and report the paths that still match. Then read the always-loaded
   files as a fresh session would: if anything there would still lead a new
   session to act on the target, the retraction is not finished.
8. **Report what was not reached.** Name the carriers you could not check (a
   store you cannot query, another machine, a published copy) and leave them
   to the operator.

### Robustness rule

Judge the retraction by whether a fresh session would still act on the
target, not by whether the record is gone.

## Confidence / failure model

The paper's exact unlearning is a runtime mechanism: a provenance graph,
cache cropping and replay from the injection step. A sweep over files has
none of these. Without recorded provenance the carrier list comes from
search and judgment, so it can be incomplete, and deciding whether a
conclusion depended on the target is an **LLM judgment**. The audit figures
are the paper's, for its agents and probes. The three reasons, the carrier
table and the trace rule are this skill's design. Fail-closed defaults: (a) a
carrier whose dependence you cannot rule out is rewritten or flagged, not
left; (b) the report never claims that the system has forgotten, only which
carriers were cleared and which were not reached; (c) when the reason is
unclear, ask whether the fact is wrong, withdrawn or sensitive before
leaving any trace. Where forgetting will matter again, propose recording
provenance going forward, a derived-from line in memory files, so that the
next sweep follows links instead of searching.

## When to skip

- The fact never left the conversation and nothing was written from it: say
  so, and apply step 5 only.
- A typo or wording fix in a memory whose content stays true.
- An always-loaded line whose recorded reason has expired: that is pruning,
  step 7 of `cue-anchored-memory`.

## Integration

- **skill-revocation-sweep** — the same principle for a withdrawn skill:
  residual carriers rebuild what the registry no longer lists.
- **cue-anchored-memory** — writes facts with a reason and an end condition,
  which is what makes a later retraction traceable.
- **memory-authority-label** — records who said a thing and with what scope;
  a withdrawn approval is retracted here and stops being usable there.
- **memory-use-warrant** — decides whether a recalled memory may be
  surfaced; a target under retraction fails that check until the sweep is
  done.
- **context-handoff** — a handoff written during or after a retraction
  leaves the target out.
- **intent-revision-salvage** — when the retracted fact was a requirement of
  the current task, its work items are kept, patched or discarded there.

Files in this skill

  • SKILL.md9.8 KB
  • triggering.test.md2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.