lawrencehua/skills-log/agent-memory-sync
Claude Code and agent skill by lawrencehua/skills-log
- community
Checking that the SKILL.md file is still in the repository.
A git-backed persistent memory layout for AI agents — one fact per file with typed frontmatter, a single always-loaded index file, and a scheduled commit/rebase/push sync job — so what an agent learned survives session boundaries, machine switches, and even switching to a different agent tool.
Install
npx vskill@latest install lawrencehua/skills-log/agent-memory-syncSKILL.md
The same SKILL.md was published earlier as lawrencehua/skills-log/agent-memory-sync.
agent-memory-sync
Agent sessions are amnesiac by default: the correction you gave on Tuesday is gone by Thursday, and a second machine (or a second agent tool) knows none of it. Vendor-native memory features help but lock the memory inside one tool. Plain Markdown files in a git repo turn out to beat everything else: readable, diffable, portable across every agent CLI, and synced with machinery you already trust.
The layout
One fact per file, with typed frontmatter:
The four types keep recall sharp: user (who the human is — role, expertise, preferences), feedback (corrections and confirmed approaches, with the why), project (ongoing goals/constraints not derivable from the code — convert relative dates to absolute), reference (pointers to external resources).
`MEMORY.md` is an index, never a container. One line per memory (- [Title](file.md) — hook); it's the only file loaded into every session, so it must stay small. The agent reads the index, then opens only the relevant memory files.
The hygiene rules
- Update, don't duplicate. Before writing, check for an existing file that
covers the fact; edit it instead. Delete memories that turn out wrong — a false memory is worse than none, because it arrives wearing the authority of "we established this."
- Don't store what's already recorded elsewhere. Code structure, git
history, and project docs are better sources than a memory that goes stale. Memory is for what only the conversation knew.
- Recalled memories are hypotheses. They reflect what was true when
written; verify a remembered file/flag/URL still exists before acting on it.
The sync
A scheduled job (every 5–15 min, plus session start/end) in the memory repo:
Details that matter: commit before pulling (never stash agent writes — that's how memories silently vanish on conflict); fail loudly — don't swallow a failed commit with || true, and write a receipt on success so a monitor can detect a wedged sync (see background-agent-roster); give the repo a .gitignore for anything env/credential-shaped and let the secret scan fail-closed; on rebase conflict prefer the version with more information and flag it for review; run the sync in a dedicated clone or worktree so it never fights your interactive session. Every machine — and every agent tool you point at the directory — now shares one brain. For a team, the repo can be shared; keep personal memories in a separate local-only directory.
When to use
- You correct an agent for the second time about the same thing.
- You work across two machines, or two agent CLIs, and want one memory.
- A long-running project accumulates decisions no single session can hold.
Skip it for: one-off tasks and throwaway environments.
How to use
Install: copy this folder into ~/.claude/skills/agent-memory-sync/. Create the memory repo, then tell your agent tool to load MEMORY.md every session (most tools have a persistent-instructions or memory-directory hook) and to write new memories in the format above.
Invoke:
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/agent-memory-sync/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lawrencehua/skills-log/agent-memory-sync)