Claude Code /dmg skill — persistent memory + session sync (git, docs, memory in one command)
README
A Claude Code slash command that ends every session by committing dirty repos, refreshing documentation, and updating a persistent memory system — so the next session starts with full context.
/dmg = documentation, memories, git.
When you build things with Claude Code, context resets every session. You re-explain your project layout. You re-describe decisions you already made. Claude doesn't know what changed yesterday.
The other problem: after a productive session you have uncommitted work, stale docs, and no record of what you learned.
/dmg solves both. One command cleans up the session and primes the next one.
The highest-leverage thing it does: when Claude makes a mistake or you correct its approach, /dmg saves that as a feedback memory. Claude is far less likely to repeat the same mistake. Most context loss between sessions is silent — you don't notice until Claude repeats a bad call. Feedback memories are what break that cycle.
1. Git — finds every repo touched during the session (including nested repos), commits anything dirty with a message explaining why the change was made, and appends the Claude Code co-author line.
2. Docs — updates whatever operational documentation went stale: README files, service tables, architecture docs. New projects and services get added to the right tables automatically.
3. Memory — updates a set of structured markdown files that persist across sessions. The next time you open Claude Code, it reads the index and knows your projects, your lessons learned, your preferences, and your infrastructure — without you re-explaining anything.
At the end it shows a clean git status across all repos as proof.
npm install -g @anthropic-ai/claude-code
mkdir -p ~/.claude/skills/dmg
cp skills/dmg/SKILL.md