ss-sdd-maintaining-memory-file — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited ss-sdd-maintaining-memory-file (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Agent memory files like CLAUDE.md, AGENTS.md, GEMINI.md, etc. are loaded into every AI session for the project. They tell future agents what's true about the codebase that they can't easily learn from reading: project-wide conventions, non-obvious constraints, NEVER-do and MUST-do rules, canonical vocabulary, pointers to where deeper info lives.
A stale memory file is worse than no memory file. Agents trust what's in there; if it lies, they propagate the lie. Updating it after each shipped feature is genuinely tedious for humans, which is why it falls behind.
Your job: read what this run produced (spec, plan, ADRs), decide whether anything in it changes what's true at the project level, and update the memory file if so. Most runs do not warrant an update — that's normal and correct.
Core principle: A memory file update earns its place. If you can't write a one-line answer to "what would a future agent get wrong without this?", don't add the line.
Operating mode: Read SDD artifacts + existing memory file. Write at most ONE file (the memory file itself). Never modify spec, plan, ADRs, or state.
Leaf skill — do not dispatch sub-subagents.
Announce at start: "I'm using the ss-sdd-maintaining-memory-file skill to check whether the project memory file needs updating."
MEMORY_FILE_PATH is set but the file is missing on disk, refuse with status skipped (file missing on disk) and direct the caller to ss-bs-bootstrapping-project (memory-file Create/Extend) or ss-bs-auditing-project (memory-file audit). Authoring resolves all six convention-file paths from config and asks the user about pointers — that's not in this skill's contract.The dispatch prompt includes:
SPEC_PATH — path to spec.mdPLAN_PATH — path to plan.mdADR_PATHS — list of ADRs created or modified in this run (may be empty)MEMORY_FILE_PATH — resolved path to the memory file (from config or auto-detect). May be null if no memory file exists and the user didn't configure one — in which case you SKIP (return skipped (no path configured)). If the path is set but the file does not exist on disk, you also SKIP (return skipped (file missing on disk)) — authoring is ss-bs-bootstrapping-project/ss-bs-auditing-project's job, not this skill's. In practice validate-config.sh catches the missing-on-disk case at preflight, so a well-formed pipeline run never reaches you in that state; the pre-check below is defense in depth.CHARACTER_LIMIT — soft cap on total memory file size (default 40000 from config). Warning at 90%, refuse to push past it.EXISTING_CONTENT — full text of the current memory file. Should always be non-empty: the pre-check below refuses when the file is missing, and preflight catches the same case earlier via validate-config.sh.Before reading any SDD artifact, validate the dispatch inputs:
MEMORY_FILE_PATH is null → report skipped (no path configured) and stop.MEMORY_FILE_PATH is set but the file does not exist on disk (check with the file-existence tool of your harness) → report skipped (file missing on disk) and stop. Direct the caller to ss-bs-bootstrapping-project (memory-file Create/Extend mode) or ss-bs-auditing-project (memory-file audit). This skill never authors the file from scratch — bootstrap/audit owns that contract because authoring requires resolving the six convention-file paths from config and asking the user about pointers.Both branches are short-circuit returns: no spec/plan/ADR reads, no writes.
.tmp + mv)A candidate is something in this run that changes what's true at the project level. Walk through the sources:
Each ADR in ADR_PATHS is a candidate. Read its Decision and Consequences sections. Ask:
An ADR is a strong candidate when its Decision is something a future engineer touching unrelated code might re-litigate without knowing it was already decided.
Look at:
Plans are usually about HOW for one feature, not WHAT IS for the project. But occasionally:
bcrypt, added pino for logging) might warrant a memory line if it becomes the canonical choiceFor each candidate, run it through these filters:
| Filter | If yes → keep | If no → drop |
|---|---|---|
| Would a future agent reading unrelated code get this wrong without the line? | ✓ Keep | ✗ Drop |
| Is this stable (won't change next month)? | ✓ Keep | ✗ Drop (memory shouldn't track transient things) |
| Is this NOT already obvious from reading the codebase? | ✓ Keep | ✗ Drop (don't duplicate what's already self-evident) |
| Is this NOT already documented in CLAUDE.md / existing memory? | ✓ Keep | ✗ Drop (don't duplicate within the memory file) |
| Is the line shorter than the paragraph it would take to explain the implications? | ✓ Keep | ✗ Drop (if your line needs a paragraph of context, it doesn't belong) |
Default to drop. Memory files atrophy from accretion. Adding three lines that are 60% useful is worse than adding one line that's 100% useful.
Memory files are read by every agent every session. Token economy matters.
The file always exists at this point (the pre-check refuses the missing-file case, so this skill never authors from scratch). Respect its existing structure. Don't reorganize. Find the section your additions belong in and add there.
- All auth uses JWT (ADR-0003).Compute: (existing_content_length - removed_lines_length) + new_additions_length.
The cap is a soft budget for token economy. CLAUDE.md is widely recommended to stay under 40k chars because larger files cost more on every session and start losing the "always loaded" guarantee on some platforms.
Compose the new full content. Then:
<MEMORY_FILE_PATH>.tmpmv <MEMORY_FILE_PATH>.tmp <MEMORY_FILE_PATH>If the existing file had subtle formatting (specific heading levels, blank-line spacing, table alignment), preserve it. Don't reformat for its own sake.
Return to the coordinator:
## Memory File Update
**Status:** updated | no update needed | skipped (no path configured) | skipped (file missing on disk)
**File:** <path>
**Character count:** <N> / <limit> (<percent>%)
**Lines added:** <N>
**Lines removed:** <N> (and one-line reason for each removal if any)
**Lines edited:** <N>
### Update summary
(One paragraph: what changed in the project's stable truth as a result of this run, and which ADR/spec drives it. Empty if "no update needed".)
### Reasons candidates were dropped (if any)
- <Candidate>: <reason — "already documented", "feature-specific", "would need too much context", etc.>If status is "no update needed", that's a complete and valid outcome — the file isn't expected to change every run.
These are general principles for any agent memory file. Apply when creating new files; don't enforce on existing files unless asked.
| File size | Behavior |
|---|---|
| Under 4k chars | Healthy — fits in any context budget |
| 4k–20k chars | Good — readable in one scan |
| 20k–40k chars | Watch — starts adding up across sessions |
| Over 40k chars | Prune — likely accumulated cruft; some platforms drop the "always loaded" guarantee here |
Most features ship without warranting a memory update. Healthy frequencies look like:
If you find yourself updating memory every feature, you're probably treating memory as a changelog. Stop.
Once a quarter (or when the file hits 75% of cap), prune:
Some projects have both CLAUDE.md AND AGENTS.md (or similar). Conventions vary by tool:
The skill updates only the configured path. If the project has multiple memory files, point the config at one and document in that file (with a pointer) that the others should follow it, OR run the skill separately for each (e.g., memory_file.paths: [...] as a future enhancement; current implementation handles one path).
| Anti-pattern | Why it's bad | Fix |
|---|---|---|
| "As of Q3 2026, we now use..." | Timestamps rot; memory should always read as current truth | Drop the timestamp |
| "We recently switched from X to Y" | Story rather than rule | "Use Y, not X" or "All <thing> uses Y (ADR-NNNN)" |
| Multi-paragraph explanation of a single rule | Should be in a doc; memory should link | One-line rule + pointer |
| Conflicting rules (e.g., two entries that say opposite things) | Agents will pick one and confuse you | Resolve conflict; have only one true rule |
| Style/aesthetic preferences ("prefer concise over verbose comments") | Already obvious from existing code | Drop unless there's a real policy reason |
| Listing every file in the project | Auto-derivable from ls | Drop |
| "Always run tests before committing" | Should be enforced by a pre-commit hook, not a memory rule agents might miss | Implement the hook; consider whether the memory line is still needed |
| Mistake | Fix |
|---|---|
| Updating memory on every feature ship | Most features don't warrant updates; "no update needed" is the most common outcome |
| Copying ADR text into memory | Link to the ADR; one-line summary at most |
| Adding history/narrative ("we used to do X, now we do Y") | Memory is for current truth, not evolution |
| Adding obvious things ("we use TypeScript") | If it's obvious from package.json / pyproject.toml, skip |
| Exceeding the character cap to add a "small" line | The cap is the cap; tighten existing content or omit |
| Reorganizing the existing structure when adding | Respect what's there; add to the appropriate section |
| Including tone/style guidance the code already shows | Code teaches by example; memory teaches non-obvious rules |
| Putting in-progress / TODO items in memory | Memory is stable truth; use issue trackers for TODOs |
| Creating the memory file from scratch when it's missing | Refuse with skipped (file missing on disk); the maintainer does incremental updates only — bootstrap/audit authors the file with proper pointer resolution |
EXISTING_CONTENT is empty / the file is missing → STOP; refuse with skipped (file missing on disk); authoring is bootstrap/audit's job, not this skill's~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.