Skip to content
Agent Memory
Command

/sync

Sync CLAUDE.md with manual file changes detected by git

BOOST
From plugin
auto-memory
1584 skills1 agent4 commands4 hooks
Install
$ npx -y skills add severity1/claude-code-auto-memory --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/sync

Context preview

What this command does when you run it.

Sync CLAUDE.md with manual file changes detected by git

Command definition

sync.md
description: Sync CLAUDE.md with manual file changes detected by git

Detect files changed outside Claude Code and update CLAUDE.md incrementally.

Use this when you've edited files manually (outside Claude Code) and want to update CLAUDE.md without a full recalibration.

Workflow

1. **Check if git repo**: Run `git rev-parse --is-inside-work-tree`

  • If not a git repo: Report error and suggest `/auto-memory:calibrate` instead

2. **Detect changed files using git**:

   git diff --name-only HEAD                    # Modified tracked files
   git diff --cached --name-only                # Staged files
   git ls-files --others --exclude-standard     # New untracked files

3. **Filter files** (exclude from processing):

  • Files in `.claude/` directory
  • Memory files: read `memoryFiles` from `.claude/auto-memory/config.json` (default `["CLAUDE.md"]`) and exclude any file whose name appears in that list
  • Files outside project directory

4. **If no changes detected**: Report "Already in sync - no manual changes found"

5. **If changes found**:

  • Convert paths to absolute paths
  • Write to `.claude/auto-memory/dirty-files` (one path per line, or `dirty-files-{session_id}` if session_id is available from the environment)
  • Use the Task tool to spawn the `memory-updater` agent with prompt:

"Update [active memory file] for manually changed files: [file list]" (use AGENTS.md or CLAUDE.md per the memoryFiles config)

6. **Report summary**: List files that were processed

Notes

  • Requires a git repository for change detection
  • For non-git projects or full recalibration, use `/auto-memory:calibrate` instead
  • The memory-updater agent handles the actual CLAUDE.md updates
Read more
Ships withauto-memory

Your CLAUDE.md, always in sync. Minimal tokens. Zero config. Just works. A Claude Code plugin that watches what Claude Code edits, deletes, and moves - then quietly updates your project memory in the background. No manual maintenance needed.

Get the whole plugin

Other commands on auto-memory.