AgentStack
SKILL verified MIT Self-run

Shared Memory

skill-weizheng9493-codex-claude-shared-memory-shared-memory · by weizheng9493

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.

No reviews yet
0 installs
7 views
0.0% view→install

Install

$ agentstack add skill-weizheng9493-codex-claude-shared-memory-shared-memory

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Shared Memory? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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  [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.sh

Set AGENT_NAME before writing so memory entries show their source:

AGENT_NAME=codex scripts/memory.sh today
AGENT_NAME=claude scripts/memory.sh today

Start 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 5

If the user names a project, repository, or workspace, also read its project memory:

scripts/memory.sh project 

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 .

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 ."
scripts/memory.sh decide  "" ""
scripts/memory.sh context  ""
scripts/memory.sh context --replace  ""
scripts/memory.sh fact user-prefs ""

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. Use context --replace when 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 `, , and : 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 
scripts/memory.sh decide   
scripts/memory.sh context [--replace]  
scripts/memory.sh fact  

Reading:

scripts/memory.sh today [--tail N] [--summary] [--json]
scripts/memory.sh recent [n] [--json]
scripts/memory.sh project 
scripts/memory.sh search [--all] 
scripts/memory.sh list decisions|contexts|facts|logs|snapshots|projects
scripts/memory.sh index

Maintenance:

scripts/memory.sh snapshot [--force] [--recent N]
scripts/memory.sh archive
scripts/memory.sh delete 
scripts/memory.sh version

Installation

This folder is a complete skill. To install it for both agents from a cloned copy, run:

bash scripts/install.sh --both

The 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.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.