agentleFS
severity1severity1/claude-code-auto-memory/skills/memory-processor/SKILL.md

memory-processor

Skill159 starsChanged 8 months agoMITView on GitHub

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.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 15 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    MANDATORY: All rules below must be followed exactly.

    line 12
  2. Distinctive:

    Parse context: Read context provided by memory-updater agent:

    line 18
  3. Distinctive:

    Verify and update content: Before modifying documented content, verify accuracy:

    line 33
  4. Distinctive:

    Read the relevant CLAUDE.md section to get currently documented items

    line 40
  5. Distinctive:

    Use Grep to search the codebase for that item

    line 42
  6. Distinctive:

    Search in relevant directories excluding node_modules, vendor, .git

    line 43
  7. Distinctive:

    If item exists elsewhere: keep it documented

    line 44
  8. Distinctive:

    If item is not found anywhere: mark for removal

    line 45
  9. Distinctive:

    If documented command differs from successful execution, update to match what worked

    line 49
  10. Distinctive:

    Never touch MANUAL sections

    line 64
  11. Distinctive:

    Do not modify CLAUDE.md redirect files (files containing only "Read AGENTS.md...")

    line 66
  12. Distinctive:

    Validate: Ensure updates follow guidelines:

    line 68
  13. Distinctive:

    No generic instructions added

    line 69
  14. Distinctive:

    Keep sections concise - bullet points, not paragraphs

    line 112
  15. Very specific:

    Use imports (@path/to/file) for detailed specs

    line 113
  16. Distinctive:

    Follow Content Rules above (< 500 lines, stay current)

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Memory Processor

Process changed files and update relevant memory file sections (CLAUDE.md or AGENTS.md, whichever is the active file per project config) following official guidelines.

Guidelines

MANDATORY: All rules below must be followed exactly. Violations produce incorrect CLAUDE.md content.

@../shared/references/guidelines.md

Algorithm

  1. Parse context: Read context provided by memory-updater agent:
    • Changed files with categories
    • File content summaries
    • Detected dependencies
    • Git context (commits, diffs)
    • Target memory files (CLAUDE.md or AGENTS.md per project config)
  2. Categorize changes: Map files to CLAUDE.md sections using the tables in "Section Names" below. Match changed files to their update triggers.
  3. Analyze impact: Determine what needs updating:
    • New build commands added?
    • Architecture changed (new dirs, renamed components)?
    • New coding patterns detected?
    • Dependencies added/removed?
  4. Verify and update content: Before modifying documented content, verify accuracy:

    Key distinction - conventions vs patterns:

    • conventions: Explicit rules humans decided (naming, imports, formatting)
    • patterns: Implicit patterns AI detected from recurring code structures

    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: python pytest | Actually worked: python -m pytest → Update
      • Documented: npm test | Actually worked: npm run test → Update
      • Documented: pytest tests/ | Actually worked: uv run pytest → Update
    • Source: Successful Bash tool executions from session context or git commit history

    Examples:

    • Pattern: @decorator removed → search grep -r "@decorator" src/
    • Convention: async/await style removed → search for async function or await
    • Architecture: utils/ directory deleted → verify no utils/ references remain
    • Build command: npm run dev removed from package.json → verify script is gone
  5. Update memory file: Modify relevant sections in the active memory file:
    • Preserve AUTO-MANAGED markers
    • Never touch MANUAL sections
    • Apply content rules (specific, concise, structured)
    • Do not modify CLAUDE.md redirect files (files containing only "Read AGENTS.md...")
  6. 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

SectionPurposeUpdate Triggers
project-descriptionProject overviewREADME changes, major refactors
build-commandsBuild, test, lint commandspackage.json, Makefile, pyproject.toml
architectureDirectory structure, componentsNew dirs, renamed files, structural changes
conventionsNaming, imports, code standardsPattern changes in source files
patternsAI-detected coding patternsRepeated patterns across files
git-insightsDecisions from git historySignificant commits
best-practicesFrom official Claude Code docsManual updates only

Subtree CLAUDE.md Sections

SectionPurposeUpdate Triggers
module-descriptionModule purposeModule README, major changes
architectureModule structureFile changes within module
conventionsModule-specific conventionsPattern changes in module
dependenciesKey module dependenciesImport changes, package updates

Token Efficiency

  • Keep sections concise - bullet points, not paragraphs
  • Use imports (@path/to/file) for detailed specs
  • Follow Content Rules above (< 500 lines, stay current)

Output

Return a brief summary:

  • "Updated [section names] in [memory file 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"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.