Claude-skill-registry-data memory-processor
Process file changes and update CLAUDE.md memory sections. Use when the memory-updater agent needs to analyze dirty files, update AUTO-MANAGED sections, verify content removal, or detect stale commands. Invoked after file edits to keep project memory in sync.
git clone https://github.com/majiayu000/claude-skill-registry-data
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry-data "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/memory-processor" ~/.claude/skills/majiayu000-claude-skill-registry-data-memory-processor && rm -rf "$T"
data/memory-processor/SKILL.mdMemory Processor
Process changed files and update relevant CLAUDE.md sections following official guidelines.
Guidelines
MANDATORY: All rules below must be followed exactly. Violations produce incorrect CLAUDE.md content.
@../shared/references/guidelines.md
Algorithm
-
Parse context: Read context provided by memory-updater agent:
- Changed files with categories
- File content summaries
- Detected dependencies
- Git context (commits, diffs)
- Target CLAUDE.md files
-
Categorize changes: Map files to CLAUDE.md sections using the tables in "Section Names" below. Match changed files to their update triggers.
-
Analyze impact: Determine what needs updating:
- New build commands added?
- Architecture changed (new dirs, renamed components)?
- New coding patterns detected?
- Dependencies added/removed?
-
Verify and update content: Before modifying documented content, verify accuracy:
Key distinction - conventions vs patterns:
: Explicit rules humans decided (naming, imports, formatting)conventions
: Implicit patterns AI detected from recurring code structurespatterns
Removal verification:
- Read the relevant CLAUDE.md section to get currently documented items
- For each item that appears missing from changed files:
- Use Grep to search the codebase for that item
- Search in relevant directories excluding node_modules, vendor, .git
- If item exists elsewhere: keep it documented
- If item is not found anywhere: mark for removal
Stale command detection:
- Compare documented commands against commands that actually executed successfully
- If documented command differs from successful execution, update to match what worked
- Examples:
- Documented:
| Actually worked:python pytest
→ Updatepython -m pytest - Documented:
| Actually worked:npm test
→ Updatenpm run test - Documented:
| Actually worked:pytest tests/
→ Updateuv run pytest
- Documented:
- Source: Successful Bash tool executions from session context or git commit history
Examples:
- Pattern:
removed → search@decoratorgrep -r "@decorator" src/ - Convention:
style removed → search forasync/await
orasync functionawait - Architecture:
directory deleted → verify noutils/
references remainutils/ - Build command:
removed from package.json → verify script is gonenpm run dev
-
Update CLAUDE.md: Modify relevant sections:
- Preserve AUTO-MANAGED markers
- Never touch MANUAL sections
- Apply content rules (specific, concise, structured)
-
Validate: Ensure updates follow guidelines:
- No generic instructions added
- Specific and actionable content
- Proper markdown formatting
Marker Syntax
CLAUDE.md uses HTML comment markers for selective updates:
<!-- AUTO-MANAGED: section-name --> Content that will be automatically updated <!-- END AUTO-MANAGED --> <!-- MANUAL --> Content that will never be touched <!-- END MANUAL -->
Section Names
Root CLAUDE.md Sections
| Section | Purpose | Update Triggers |
|---|---|---|
| Project overview | README changes, major refactors |
| Build, test, lint commands | package.json, Makefile, pyproject.toml |
| Directory structure, components | New dirs, renamed files, structural changes |
| Naming, imports, code standards | Pattern changes in source files |
| AI-detected coding patterns | Repeated patterns across files |
| Decisions from git history | Significant commits |
| From official Claude Code docs | Manual updates only |
Subtree CLAUDE.md Sections
| Section | Purpose | Update Triggers |
|---|---|---|
| Module purpose | Module README, major changes |
| Module structure | File changes within module |
| Module-specific conventions | Pattern changes in module |
| Key module dependencies | Import changes, package updates |
Token Efficiency
- Keep sections concise - bullet points, not paragraphs
- Use imports (
) for detailed specs@path/to/file - Follow Content Rules above (< 500 lines, stay current)
Output
Return a brief summary:
- "Updated [section names] in [CLAUDE.md path] based on changes to [file names]"
- "Removed [pattern] from [section] - no longer used in codebase"
- "No updates needed - changes do not affect documented sections"