docs(claude-memory): re-align auto-memory reference facts with live memory doc - #1933
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 45s —— View job Security Review
Scope reviewed: Findings: none. This PR is a documentation-only change. It corrects prose/reference facts in the
The one content change worth noting for completeness — the corrected claim that No security issues found in this PR's diff. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0fa51e69ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude finished @kyle-sexton's task in 3m 3s —— View job Code Review
Scope reviewed: Fact-checkRe-fetched
All content changes in this PR are accurate. No correctness issues with the doc facts themselves. Finding (Suggestion — non-blocking)M1's new "stripped content" methodology isn't reflected in the deterministic script that backs it, so the precomputed stat and the documented check can now disagree.
No other correctness, error-handling, or maintainability issues found — version bumps ( |
|
Claude has reviewed this PR 5 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
|
Claude finished @kyle-sexton's task in 1m 27s —— View job Security Review (re-run on latest push, HEAD
|
|
Claude finished @kyle-sexton's task in 2m 26s —— View job Code Review (re-run on latest push, HEAD
|
|
HOLD — do not merge as-is. Version collision: this PR claims claude-memory 0.5.4 / criteria 1.5.0, but PR #1932 merged first with the same claim (origin/main f668526). Required before merge: rebase onto main, re-claim 0.5.5 / criteria 1.5.1, preserve the landed row-60 content (per-line C2, C1 diagnostic) through conflict resolution on CHANGELOG.md, criteria.md, official-guidance.md, plugin.json — then a fresh-context verifier pass on the final rebased diff. Context: doc-alignment row 127; the substantive drift fixes here (import depth 5→4, autoMemoryDirectory any-scope + trust dialog, M1 post-strip measurement) are verified-real and wanted. |
…emory doc Row-127 doc-alignment pass over code.claude.com/docs/en/memory (fetched 2026-08-04). Corrects two drifted facts in audit's official-guidance.md: @import recursion depth is 4 hops, not 5; and autoMemoryDirectory is read from any settings scope (user, project, local, policy, --settings) with project/local values gated behind the workspace trust dialog, replacing the stale claim that project settings are not accepted. Aligns M1 with the documented limit check (frontmatter and block-level HTML comments are stripped before the MEMORY.md index loads, so they don't count toward the 200-line/25KB limits), adds the backing quote, states the 25KB limb in the audit SKILL.md scope table, and fixes a section-name attribution. claude-memory 0.5.3 -> 0.5.4; criteria 1.4.0 -> 1.4.1. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Codex review: criteria M1 now specifies post-strip measurement, but the SKILL.md pre-compute injected a raw wc -l line count, so the deterministic spine could contradict its own criteria. memory-dir-stats now strips YAML frontmatter and block-level HTML comments (preserving comments inside fenced code blocks) before measuring, gains a --memory-bytes mode for the 25KB limb, and the pre-computed context reports both figures. M1 points at the pre-computed values; tests cover the strip semantics and the new mode. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
127b382 to
b8c04b2
Compare
|
Claude finished @kyle-sexton's task in 1m 15s —— View job Security Review (re-run on latest push, HEAD
|
|
Claude finished @kyle-sexton's task in 1m 26s —— View job Code Review (re-run on latest push, HEAD
|
…ckticks The post-strip fixture's literal code fence sat inside a single-quoted printf format, which ShellCheck reads as an unexpanded command substitution (SC2016). The hygiene gate runs at default `style` severity, so the info-level finding failed CI. Double quotes with escaped backticks produce byte-identical output and keep the file's printf convention. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 2m 58s —— View job Code Review (re-run on latest push, HEAD
|
|
Claude finished @kyle-sexton's task in 41s —— View job Security Review (re-run on latest push, HEAD
|
…rge command `claude project purge` wipes a project's transcripts and auto memory under projects/, its per-session tasks/, debug/, and file-history/ entries, its matching history.jsonl lines, and its ~/.claude.json entry; the stateless skill deliberately stops at auto memory, so a user who asks to wipe what Claude saved about a repo needs the broader route named. Pointer, not a copy of its flags: the reference file quotes the doc's deletion list verbatim and the other call sites cite it. Doc-alignment row 74. Version 0.5.6 sits above #1933's 0.5.5; this branch is stacked on #1933 and merges after it. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…size gate `strip_unloaded()` treated a line-1 `---` as frontmatter and skipped to a closing `---` that need not exist, so a leading thematic break or frontmatter clipped mid-file discarded the whole file and reported 0 lines / 0 bytes. M1 is a [FAIL]-severity size check and 0 passes it, so the gate could not fire. An unclosed `<!--` swallowed the file the same way. MEMORY.md carries frontmatter by design — Claude Code stamps a `modified` field into any memory file that has it — so this is a live shape, not a corner case. An opening delimiter is now held rather than dropped and flushed at EOF when it never closes, which counts the whole file exactly as a reader following criteria.md would. One mechanism covers both block kinds. Two further strip defects, same function: the fence rules ran before the comment rule, so a fence inside a comment toggled fence state and leaked the commented-out body back into the count; and a line sharing space with a comment's open or close was dropped whole, losing real content. criteria.md M1 now states the four readings the strip applies and marks them as this plugin's reading, not doc-derived. The memory doc states the fenced-code carve-out under "How CLAUDE.md files load" and says nothing either way for MEMORY.md, so the previous "per the documented comment behavior" was an inference presented as a citation. Byte counts are LF-normalized; that assumption is now recorded rather than silent. official-guidance.md's `Last researched` date scopes the 2026-08-04 re-verify to the memory page, the only source this PR re-checked. Version stays 0.5.5 / criteria 1.5.1: 0.5.5 is unmerged and its changelog entry is this PR's own, so amending it is not a version event. #1947 keeps 0.5.6. Tests: 29/29 pass, including regressions for each defect above. ShellCheck exit 0. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 3m 32s —— View job Code Review (re-run on latest push, HEAD
|
|
Claude finished @kyle-sexton's task in 43s —— View job Security Review (re-run on latest push, HEAD
|
…rge command `claude project purge` wipes a project's transcripts and auto memory under projects/, its per-session tasks/, debug/, and file-history/ entries, its matching history.jsonl lines, and its ~/.claude.json entry; the stateless skill deliberately stops at auto memory, so a user who asks to wipe what Claude saved about a repo needs the broader route named. Pointer, not a copy of its flags: the reference file quotes the doc's deletion list verbatim and the other call sites cite it. Doc-alignment row 74. Version 0.5.6 sits above #1933's 0.5.5; this branch is stacked on #1933 and merges after it. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…blank the M1 count A MEMORY.md that opens with a --- thematic break and carries any later --- had the entire span between them stripped as frontmatter, collapsing a 253-line index to a single loaded line and silently disarming the FAIL-severity M1 size gate. Frontmatter mode is now bounded twice: it ends at the first held line that is not blank, a comment, or a key: mapping entry, and at a 20-line cap, with abandonment re-emitting the held lines as content. Both bounds fail toward counting, so the gate can fire early but can no longer be blanked. New test cases cover both the line and byte limbs and confirm well-formed frontmatter still strips. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 1m 18s —— View job Security Review (re-run on latest push, HEAD
|
…content lines A line carrying two HTML comments with text between them matched through to the LAST close, consuming the whole line and losing the text between: a 1-line, 32-byte index reported 0 lines and 0 bytes, an under-count on the FAIL-severity M1 gate. Both close matches now stop at the first close, spelled as a bounded-complement body that cannot itself contain a close delimiter, since awk ERE has no lazy quantifier. Only the first comment on a line is stripped, so a second one counts as content: an over-count, the direction every other bound here already fails toward. New cases cover both limbs, the close-path shape, and the empty, lone-dash, and multi-dash-closer idiom edges. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 45s —— View job Security Review (re-run on latest push, HEAD
|
## Summary - replace regex-only HTML-comment stripping in the reusable PR-linkage gate with a Markdown-aware state machine - preserve comment-looking text inside inline code spans and fenced code blocks - retain fail-closed behavior for actual unterminated HTML comments - add regressions for inline, multiline-inline, and fenced-code cases ## Root cause A valid PR body described an HTML-comment parser bug using the rendered literal `<!--`. The gate's unbounded fallback regex treated that code-span text as a real unterminated comment and deleted the rest of the body before validation, including a valid `No linked issue` marker and populated `## Related` section. ## Validation - `node --test .github/scripts/pr-issue-linkage.test.cjs` — 20 passed - full `.github/scripts/*.test.cjs` corpus — 498 passed; 10 unrelated tests could not invoke `/bin/bash` because WSL/Bash is unavailable on this Windows host - `git diff --check` — passed No linked issue ## Related - Reproduced by melodic-software/claude-code-plugins#1933
One line can carry several HTML comments. Ending the strip after the first left every later comment counted as content, so measuring the text between two comments needs both a first-close bound and a re-scan of what follows. The scan now walks each line with index and substr and removes whole comment spans only, so real text is never dropped while a line that is entirely comment still disappears. Text loading before an unterminated opener is emitted at once rather than held, because the held block is discarded when the comment closes and folding that text in would lose it outright; only whitespace ahead of the opener joins the hold, which keeps an indented opener counted without re-counting a comment already stripped from the line. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 1m 22s —— View job Security Review (re-run on latest push, HEAD
|
…rge command `claude project purge` wipes a project's transcripts and auto memory under projects/, its per-session tasks/, debug/, and file-history/ entries, its matching history.jsonl lines, and its ~/.claude.json entry; the stateless skill deliberately stops at auto memory, so a user who asks to wipe what Claude saved about a repo needs the broader route named. Pointer, not a copy of its flags: the reference file quotes the doc's deletion list verbatim and the other call sites cite it. Doc-alignment row 74. Version 0.5.6 sits above #1933's 0.5.5; this branch is stacked on #1933 and merges after it. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…rge command (#1947) ## Summary Roster row 74. The `stateless` skill governs auto memory only, and said so without naming the official route for the broader ask ("wipe everything Claude saved about this repo"). Claude Code now ships that route: `claude project purge` (v2.1.124+). This PR names it wherever the skill states its own scope boundary — the SKILL.md scope statement and table, `context/purge.md`'s pre-gate presentation and follow-through, and `reference/official-guidance.md`'s out-of-scope section — and retires the reference file's now-false "there is no built-in purge command" claim. Pointer, not a copy: the deletion plan and flags stay in https://code.claude.com/docs/en/claude-directory. No executable step changes. The bash fences driving Steps 2–4 (manifest capture, backup, delete) and the confirmation gate are byte-identical to the base branch; the additions are narrative bullets outside any executable block, and nothing causes the skill to invoke `claude project purge` itself. ## Review finding fixed — full deletion scope Codex flagged (P2, `official-guidance.md:127`) that the summarized deletion scope omitted a category. Re-fetching the live page on 2026-08-04 confirmed it: the command deletes **four** categories, and the PR's original prose listed three, dropping per-session `tasks/`, `debug/`, and `file-history/` entries — checkpoint/restore and debug history. That matters because this text is read to a user deciding whether to run a destructive wipe; the omission would have led them to believe checkpoint history survives. Sweeping the diff found the same omission in **five** places, not the one flagged. All are corrected: | Location | Treatment | |---|---| | `reference/official-guidance.md` out-of-scope section | No longer paraphrases; the verbatim quote block now carries the doc's complete bullet list | | `SKILL.md` scope statement | Lists all four categories | | `context/purge.md` Step 2 (pre-gate text) | Lists all four categories | | `context/purge.md` Step 5 | Was a second hand-maintained copy; now points at Step 2's enumeration | | `CHANGELOG.md` 0.5.6 entry | Lists all four categories | Two authoritative enumerations now remain (the reference file's verbatim quote and Step 2's pre-gate text), down from five independently-maintained paraphrases. ## Stacking and version Rebased onto `main` after #1933 merged, so the diff contains only this PR's five files. `0.5.6` sits directly above #1933's `0.5.5` in both `plugin.json` and the CHANGELOG, with no gap. Fresh-context verification completed 2026-08-05 after the rebase: the five-file diff was reviewed against the live official `claude-directory` page; `claude project purge` version, deletion scope, exclusions, confirmation behavior, session cleanup, and history persistence all match. `markdownlint` (14 files), JSON parsing, changelog/version parity, and `git diff --check` pass locally; the repository-wide skill gate exceeded the local 60-second observation window, so protected CI remains authoritative for that lane. No linked issue ## Related - Source of truth: https://code.claude.com/docs/en/claude-directory (`claude project purge`, v2.1.124+) - Campaign save-point and remaining-work ledger: #1941 - Stacked on: #1933 (roster row 127, claude-memory 0.5.5 / criteria 1.5.1) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…lock would swallow (#1962) Follow-up to #1933 (work-items row 127, campaign ledger #1941). #1933 shipped the M1 index-size measurement fixes for `memory-dir-stats.sh`; this closes the last under-count residual that surfaced during its gate review, after the PR had already merged. No linked issue — the residual was found by #1933's own gate review rather than filed as an issue, and the campaign ledger it belongs to stays open past this PR. ## The bug `memory-dir-stats.sh` admitted `#` lines to its frontmatter grammar. A `MEMORY.md` that opens with a `---` thematic break, carries heading lines, and reaches any later `---` therefore had the whole span stripped as frontmatter: ``` --- # heading one # heading two --- body ``` Raw 5 lines / 41 bytes, reported **1 line / 5 bytes**. M1 is a `[FAIL]`-severity size gate, and a low count always passes it, so the shape disarmed the gate outright rather than merely mismeasuring it. This is the same failure species #1933 exists to eliminate — silent under-count on the gate — reached through the frontmatter grammar instead of the comment strip. A `#` line is a comment to YAML but a **heading** to markdown, and headings are loaded content. The grammar now accepts only blank lines and `key:` mapping entries. ## Evidence Measured against `origin/main`'s script and this branch's, same fixtures: | fixture | 0.5.6 | 0.5.7 | |---|---|---| | 5-line heading pseudo-block | 1 line / 5 bytes | 5 / 41 (raw) | | 20 headings + later `---` (23 lines) | 1 line / 5 bytes | 23 / 123 (raw) | | genuine `key:`-only frontmatter | 1 / 5 | 1 / 5 (still strips) | | genuine frontmatter with a `# note` | 1 / 5 | 6 / 44 (raw) | The bound is capped at `fmcap` (20) lines, so the worst case was ~22 content lines — 11% of the 200-line budget — never a full disarm of the line limb, but enough to make a five-line index report one. ## The cost, stated plainly A real YAML comment inside frontmatter now ends the block, and ending it strips **nothing at all**: the opening `---`, every entry held so far, and the rest of the block through its close all count. That is an over-count, the direction M1's readings already guess toward — it can make the gate fire early, never fail to fire. It takes a hand-edited index to reach, since Claude Code only stamps a `modified` scalar into frontmatter a file already has. Comments join an existing class rather than opening a new one: frontmatter this grammar cannot parse already ended the block before this change, and a block sequence under `tags:` still does. `criteria.md` M1 reading 1 records both halves. ## Verification - Full suite **60/60, exit 0** — run in this worktree off current `main`. - Fresh-context verifier, rationale withheld, **PASS on all six criteria** (suite; heading fixture reports raw; `key:`-only frontmatter still strips; comment/fence behavior unregressed; no `#` alternation left in the executed awk; version + changelog hygiene). It derived every expectation from the awk before looking at output, and added its own mutation check — running `origin/main`'s pre-fix script side by side to confirm the fix is load-bearing and the numbers above reproduce. ## Versions `claude-memory` 0.5.6 → **0.5.7** (0.5.5 → 0.5.6 landed via #1947); `criteria.md` 1.5.1 → **1.5.2**; CHANGELOG entry under `[0.5.7]`. ## Related - #1933 — predecessor, merged. Shipped the M1 measurement fixes (frontmatter bounding, greedy-comment fix, comment re-scan) this builds on; the residual fixed here was found during its gate review. Not closed by this PR. - #1941 — campaign ledger tracking work-items row 127 and its siblings. Stays open past this PR. - #1947 — carried `claude-memory` 0.5.5 → 0.5.6, the version this PR bumps from. Reference only. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Summary
Row-127 doc-alignment pass: every shipped
claude-memoryassertion about the auto-memory / project-memory page was verified against the live doc (https://code.claude.com/docs/en/memory, fetched 2026-08-04, 35,136 bytes, sha2567440c455…). Most claims are current; this PR corrects the ones that drifted.skills/audit/reference/official-guidance.md@importrecursion depth: 5 hops → 4 hops (live: "maximum depth of four hops").autoMemoryDirectory: replaced the stale "user or local settings only; not accepted from project settings" claim with the live behavior — read from any settings scope (user, project, local, policy,--settings), with project/local values honored only after the workspace trust dialog.skills/audit/reference/criteria.md(1.5.0 → 1.5.1): M1 now measures the content that loads — YAML frontmatter and block-level HTML comments are stripped before the index loads and don't count toward the 200-line/25KB limits.skills/audit/scripts/memory-dir-stats.sh:--memory-linesmeasures post-strip loaded content instead of rawwc -l, and a new--memory-bytesmode covers the 25KB limb; covered bymemory-dir-stats.test.sh.skills/audit/SKILL.md: scope table now states the 25KB limb of the MEMORY.md load limit alongside the 200-line one, and the pre-computed context reports both post-strip figures so M1 never disagrees with its own injected stats.Serialization note: this PR was rebased onto current
mainafter the row-60 work landed. Row 60 shipped as #1932 at claude-memory 0.5.4 / criteria 1.5.0 (commitf668526f7), which is themainthis branch now sits on, so this PR takes the next free literals — 0.5.5 / criteria 1.5.1. #1947 (row 74,statelessskill) is the only other open claude-memory PR and already claims 0.5.6; it is now rebased on top of this branch and does not touchskills/audit/reference/criteria.md.Post-rebase CI fix (
8664a65647)The rebased head failed the
hygienecheck. Root cause: the post-strip test fixture wrote its literal markdown code fence inside a single-quotedprintfformat, and ShellCheck reads backticks in single quotes as an unexpanded command substitution (SC2016). The repo's gate invokes ShellCheck with an empty severity setting — ShellCheck's defaultstylelevel — so the info-level finding failed CI rather than being advisory.Fixed by writing the fixture with double quotes and escaped backticks, which produces byte-identical output (verified by md5) and keeps the file's existing
printfconvention rather than introducing a second fixture-writing mechanism. No# shellcheck disablewas added.Verified locally on the final head:
shellcheck --rcfile=.shellcheckrcover both scripts — exit 0, no findings.bash memory-dir-stats.test.sh— all 23 checks passed, including the post-strip line and byte assertions. Both earlier review passes noted they could not execute this suite in the CI sandbox and asked for a local run; this is that run.Strip correctness fix (
e597abcd95) — the M1 gate could not fireAn independent verifier pass found that the post-strip measurement shipped earlier in this PR had a hole that inverted the check it was meant to sharpen.
strip_unloaded()treated a line-1---as opening YAML frontmatter and skipped every line until a closing---. When no closing---exists, the whole file was discarded:M1 is a
[FAIL]-severity size gate and 0 always passes it, so any index with frontmatter clipped mid-file — or a leading---used as a thematic break — silently disarmed the gate. The memory doc notes Claude Code stamps amodifiedfrontmatter field into any memory file that already has frontmatter, so MEMORY.md is frontmatter-bearing by design; this is a live shape. An unclosed<!--swallowed the file the same way.Fixed by holding an opening delimiter's lines and flushing them at EOF when it never closes, so an unterminated block is counted as the content it is — matching what a reader following
criteria.mdcounts. One mechanism covers both block kinds.Two further defects in the same function, found while fixing the first:
Provenance correction. The fenced-code carve-out was justified in the script header as "per the documented comment behavior". Re-fetching the live page shows that sentence sits under How CLAUDE.md files load, while the MEMORY.md limit paragraph under How it works says only that frontmatter and block-level HTML comments are stripped — the doc is silent on the carve-out for MEMORY.md. The behavior is kept (a comment inside a fence is code, not block-level markdown), but
criteria.mdM1 now records it, together with the unterminated-block rule, the partial-line rule, and the--memory-bytesLF-normalization assumption, under a**Provenance**:note marking them as this plugin's reading rather than doc-derived.Also:
official-guidance.md'sLast researchedline now scopes the 2026-08-04 re-verify to the memory page, the only source this PR re-checked, instead of implying the whole source list was refreshed.Version stays 0.5.5 / criteria 1.5.1. 0.5.5 is unmerged and its CHANGELOG entry is this PR's own, so amending it is not a version event; #1947 keeps 0.5.6 and no re-stack is needed.
Verified on
e597abcd95: ShellCheck exit 0, 29/29 tests pass (a regression test per defect), markdownlint clean, all 32 CI checks green andMERGEABLE/CLEAN.No linked issue
Related
main.🤖 Generated with Claude Code