shared-memory
Skill6 starsChanged 4 months agoMITView on GitHub
Cross-agent shared memory for Codex, Claude, and compatible skill runtimes. Use when the user wants multiple AI agents to share durable context, technical decisions, project notes, long-term facts, preferences, or a portable file-backed memory protocol that both Codex and Claude can install and use.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- jimyag/dotfilestheir own version, first seen Nov 1, 2026
- shadyyoung/dsh-shared-memorytheir own version, first seen Nov 1, 2026
- ToMySoul/agent-memory-managertheir own version, first seen Oct 25, 2026
- linggen/skillstheir own version, first seen Oct 22, 2026
- AmgAce/claude-skillstheir own version, first seen Oct 13, 2026
- The-Syntax-Slayer/skill-genietheir own version, first seen Oct 9, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- thiagofinch/mega-brain★ 95same name
- treylom/ThisCode★ 41same name
- Fei2-Labs/skill-genie★ 12same name
- jimyag/dotfiles★ 11same name
- linggen/skills★ 3same name
- KanenasInGreece/Shared_Memory★ 1same name
- shadyyoung/dsh-shared-memory★ 1same name
- The-Syntax-Slayer/skill-genie★ 1same name
- ToMySoul/agent-memory-manager★ 1same name
- AmgAce/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 4 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use this skill to coordinate work across Codex and Claude through a shared local file store.
- Distinctive: line 16
Use the script bundled with this skill:
- Very specific: line 22
If the skill is installed with scripts/install.sh, a stable copy of the CLI is also placed at:
- Distinctive: line 45
If the user names a project, repository, or workspace, also read its project memory:
- Very specific: line 51
When memory volume is small, it is acceptable to read broader context with today, index, or fact user-prefs.
- Very specific: line 53
When using prior memory in a user-facing answer, cite it inline as (来源: mem-xxx, codex) or (来源: mem-xxx, claude).
- Distinctive: line 57
After completing substantial work, write only durable information.
- Very specific: line 74
Use simple slug keys for <topic>, <project>, and <category>: letters, numbers, ., _, and - only.
- Distinctive: line 76
Do not record temporary debug output, pure search results, routine failures, low-value intermediate steps, unconfirmed guesses, expired …
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shared Memory
Overview
Use this skill to coordinate work across Codex and Claude through a shared local file store. The default memory directory is ~/Documents/ai-shared-memory/; set AI_MEMORY_DIR only when the user explicitly wants a different location.
The bundled scripts/memory.sh CLI writes structured Markdown entries, maintains memory-index.yml, and can create compact snapshots so either agent can read what the other agent already learned, decided, or completed.
Memory CLI
Use the script bundled with this skill:
scripts/memory.sh <command> [args...]If the skill is installed with scripts/install.sh, a stable copy of the CLI is also placed at:
~/Documents/ai-shared-memory/scripts/memory.shSet AGENT_NAME before writing so memory entries show their source:
AGENT_NAME=codex scripts/memory.sh today
AGENT_NAME=claude scripts/memory.sh todayStart Of Work
At the start of each meaningful conversation or task, read shared context before acting:
export AGENT_NAME=codex # or claude
scripts/memory.sh today --tail 20
scripts/memory.sh recent 5If the user names a project, repository, or workspace, also read its project memory:
scripts/memory.sh project <project-name>When memory volume is small, it is acceptable to read broader context with today, index, or fact user-prefs. When memory volume becomes expensive, prefer today --tail 20, recent 5, today --summary, and project <name>.
When using prior memory in a user-facing answer, cite it inline as (来源: mem-xxx, codex) or (来源: mem-xxx, claude). If another agent already made a relevant decision, mention it so work does not repeat unnecessarily.
End Of Work
After completing substantial work, write only durable information. Before writing, ask whether a future Codex or Claude run would avoid repeated explanation or mistakes by seeing this memory.
scripts/memory.sh log "Completed <work summary>."
scripts/memory.sh decide <topic> "<title>" "<decision and rationale>"
scripts/memory.sh context <project> "<project context update>"
scripts/memory.sh context --replace <project> "<current project context>"
scripts/memory.sh fact user-prefs "<stable user preference or long-term fact>"Choose the narrowest command:
log: completed work that another agent should know happened.decide: technical or product decisions and why they were chosen.context: repository, product, architecture, dependency, or workflow state. Usecontext --replacewhen the entry represents the current state rather than a historical update.fact: stable user preferences, long-lived constraints, or durable facts.
Use simple slug keys for <topic>, <project>, and <category>: letters, numbers, ., _, and - only. Do not include path separators.
Do not record temporary debug output, pure search results, routine failures, low-value intermediate steps, unconfirmed guesses, expired information, or casual chat. Do not record sensitive private information unless the user explicitly asks and the information is necessary; summarize it when possible.
Commands
Writing:
scripts/memory.sh log <message>
scripts/memory.sh decide <topic> <title> <body>
scripts/memory.sh context [--replace] <project> <content>
scripts/memory.sh fact <category> <content>Reading:
scripts/memory.sh today [--tail N] [--summary] [--json]
scripts/memory.sh recent [n] [--json]
scripts/memory.sh project <project-name>
scripts/memory.sh search [--all] <query>
scripts/memory.sh list decisions|contexts|facts|logs|snapshots|projects
scripts/memory.sh indexMaintenance:
scripts/memory.sh snapshot [--force] [--recent N]
scripts/memory.sh archive
scripts/memory.sh delete <id>
scripts/memory.sh versionInstallation
This folder is a complete skill. To install it for both agents from a cloned copy, run:
bash scripts/install.sh --bothThe installer copies this folder into:
- Codex:
${CODEX_HOME:-$HOME/.codex}/skills/shared-memory - Claude:
${CLAUDE_HOME:-$HOME/.claude}/skills/shared-memory
The installer also initializes ~/Documents/ai-shared-memory/ and copies the CLI to ~/Documents/ai-shared-memory/scripts/memory.sh. It does not overwrite global instruction files. If a runtime does not auto-load skills, manually reference this SKILL.md or copy the folder to that runtime's user skill directory.
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
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.

