audit-memory

A review and cleanup workflow for an agent's memory files, such as issue lists, decisions, commands, and context notes.

In plain words
What is it for?
Auditing the selected memory files, checking them against current evidence, fixing accepted problems, and writing a report of the findings.
Why use it?
It finds outdated, duplicated, misplaced, inconsistent, or oversized entries while keeping information that still guides future work.

Skill for Claude CodeCodex

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 skills/conn-castle/agent-layer/audit-memory
Any agent
npx skills add conn-castle/agent-layer --skill audit-memory
Clone the repo
git clone --depth 1 https://github.com/conn-castle/agent-layer

Made for: Claude Code, Codex.

Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 553 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.00047 $0.00553
Opus 5 $0.00023 $0.00277
Sonnet 5 $0.00009 $0.00111
Haiku 4.5 $0.00005 $0.00055

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

Security

Grade A, and why

audit-memory 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 3d 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.

internal/templates/skills/audit-memory/SKILL.md · 64 lines

How it starts

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

audit-memory

Audit memory files and fix evidence-backed problems.

Scope

  • Default scope is ISSUES.md, BACKLOG.md, DECISIONS.md, COMMANDS.md, and CONTEXT.md.
  • Accept a subset, audit-only mode, documentation cross-checks, and a report limit that does not reduce coverage.
  • Do not create a missing memory file. Report it and follow repository policy.
  • Do not modify source code, tests, or repository documentation.

Write .agent-layer/tmp/audit-memory.<run-id>.report.md, using YYYYMMDD-HHMMSS-<short-rand> for run-id.

Contract

  • Read each file's purpose, format, and insertion-marker rules before editing.
  • Validate staleness against current evidence; do not remove or complete entries by inference.
  • Fix clear format, duplication, placement, staleness, and supersession issues.
  • Preserve uncertain entries and name missing evidence or decisions without blocking independent work.
  • Preserve future-guiding constraints and tradeoffs. Historical completeness is not a reason to retain an entry.

Workflow

Inspect scope as one coherent set, optionally with a read-only investigator. The owning agent validates evidence and edits. Check:

  • required sections, markers, and entry formats
  • stale, completed, duplicate, or misplaced ISSUES.md and BACKLOG.md entries
  • COMMANDS.md commands against current evidence
  • CONTEXT.md facts and cross-file contradictions or duplication
  • DECISIONS.md entries that are superseded, duplicated, now self-evident, or no longer constrain future work

Consolidate superseded decision chains while retaining future-guiding rationale. Remove proven stale/completed entries and move entries only when both files are in scope. Audit-only mode records the same outcomes without edits.

The report contains:

  1. # Memory Audit Summary — files and verdict
  2. ## Fixes Applied — grouped by file
  3. ## Material Findings — evidence and affected file
  4. ## Decisions Needed — the smallest unresolved questions
  5. ## Residual Risk

Read the full file on GitHub · 64 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. 3d ago First seen · 64 lines · 47 tokens per session scan A 06280c4bfff5

Subscribe to this mod's changes

audit-memory is a skill published in the GitHub repository conn-castle/agent-layer (10 stars, last pushed 4d ago), licensed MIT. It adds 47 tokens to every session and 553 once invoked, about $0.0002 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.

Related

Other skills, from other repositories