memory-sync

A memory-audit command checks claims in CLAUDE.md and the memory directory against the current code and its history. CLAUDE.md is a project instruction file for Claude, and the memory directory stores project notes for future sessions.

In plain words
What is it for?
Run it periodically, before work that depends on project memory, or manually in a fresh session to correct stale claims and flag claims that cannot be checked.
Why use it?
It helps find notes that are outdated or false without adding unverified new facts.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/helgdemidov/refigure/memory-sync
Clone the repo
git clone --depth 1 https://github.com/HelgDemidov/refigure

Made for: Claude Code.

Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,327 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00015 $0.02327
Opus 5 $0.00008 $0.01163
Sonnet 5 $0.00003 $0.00465
Haiku 4.5 $0.00002 $0.00233

Measured 2d ago against content hash 184da64e6a18, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/memory-sync.md · 91 lines

How it starts

The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/memory-sync — audit and synchronize project memory against the real repo state

Recurring, not a one-off: bring every checkable claim in CLAUDE.md and the memory directory in line with the live code and history. Run manually, periodically, or before a large batch of work that will lean on memory being correct. Run in a fresh session, this task alone.

This is an audit of truth, not completeness — do NOT add new facts (that's /post-merge-sync's job), only fix stale/false claims and flag unverifiable ones. The evidence discipline below is mandatory because fact-checking by hand at this volume is impossible.

Paths: memory at the harness-provided project memory directory (the session states the resolved path — never hard-code one, it differs per machine/checkout). Audit working files at .claude/memory-sync/ (worklist, last-run record, backup archive) — created on first run; its absence means no audit has ever happened. This lives under .claude/, not docs/, because these are ephemeral, machine-tied run artifacts (worklist/backup churn on every run), not project documentation, even though docs/ is itself gitignored/local-only too now (2026-08-19) and wouldn't leak them publicly either — .gitignore's .claude/* rule keeps this specific state untracked the same way.

1. Sources of truth (descending priority)

  1. Live code: refigure/, tests/, build/tool config (pyproject.toml, requirements.txt, requirements-dev.txt, .python-version), .gitignore, and .claude/commands/*.md.
  2. Version control: git log, merge history, PR metadata (gh).
  3. Filesystem: path existence, directory layout, generated artifacts.

Note: .claude/commands/*.md IS tracked in this repo (.gitignore allow-lists it, unlike some sibling repos where it's local-only) — still a source of truth either way.

NOT sources of truth — they're the patients, or derivatives: CLAUDE.md, memory files, and docs/ (has its own sync via /post-merge-sync). Do not edit those as evidence. Exception: a memory claim ABOUT a document ("the spec lives at path X") — then that file IS the evidence.

Read the full file on GitHub · 91 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 91 lines · 15 tokens per session scan A 184da64e6a18

Subscribe to this mod's changes

memory-sync is a command published in the GitHub repository HelgDemidov/refigure (0 stars, last pushed 4d ago), licensed Apache-2.0. It adds 15 tokens to every session and 2,327 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.