一键导入
memory-skill
Use when starting a session or when Codex needs machine, repo, or cross-repo context from the curated memory repo managed by `memory-skill`.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when starting a session or when Codex needs machine, repo, or cross-repo context from the curated memory repo managed by `memory-skill`.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | memory-skill |
| description | Use when starting a session or when Codex needs machine, repo, or cross-repo context from the curated memory repo managed by `memory-skill`. |
You maintain curated, reusable agent memory in an active memory repo managed by
memory-skill. This is not per-repo scratch space, not a chronological log,
and not a place to dump temporary state.
Always use the skill-owned entrypoints:
~/.codex/skills/memory-skill/scripts/init-memory.sh~/.codex/skills/memory-skill/scripts/sync-memory.sh~/.codex/skills/memory-skill/scripts/resolve-machine.shDo not improvise your own sync sequence inside the memory repo.
The active memory root resolves in this order:
--memory-root <path>MEMORY_ROOT~/.codex/state/memory-skill/state.json~/.codex/memoryMemory lives inside the resolved memory root.
core.md: shared defaultsrules.md: curation policymachines/index.md: machine routingmachines/<machine-id>/summary.md: machine-specific contextmachines/<machine-id>/repo-paths.md: local path to repo-id routingrepos/index.md: canonical repo identitiesrepos/<repo-id>/summary.md: repo entrypointrepos/<repo-id>/*.md: repo detail packstopics/<topic>.md: cross-repo topic packsIndex files route lookups. Packs hold curated knowledge.
At session start, before the first user-facing response:
~/.codex/skills/memory-skill/scripts/sync-memory.sh pre-read.~/.codex/skills/memory-skill/scripts/init-memory.sh --memory-root <path>.core.md.machines/index.md.
Prefer ~/.codex/skills/memory-skill/scripts/resolve-machine.sh instead of
shelling out to hostname; some runtimes do not provide that command.summary.md.Do not announce that memory was read. Just apply it.
Treat memory access as read rounds.
pre-read once at the start of a round.pre-read for every single file.Start a new read round when:
Start with the minimum useful set:
core.mdOnly expand when the task truly needs it:
Never bulk-read the whole memory tree just because it exists.
Resolve the machine first through machines/index.md.
Preferred resolver:
~/.codex/skills/memory-skill/scripts/resolve-machine.shThat entrypoint prints the normalized hostname key used for routing. Use
--json when you also need the raw hostname and the detection source. Do not
assume hostname exists on PATH; if you need a shell fallback, prefer
uname -n.
After resolving the machine id:
machines/<machine-id>/summary.mdmachines/<machine-id>/repo-paths.md to map the current working
directory to a repo id when neededIf the machine has no entry yet, continue without machine memory until you have durable facts worth recording.
Repo memory lives only under repos/ in the memory repo.
Resolve the current repo in this order:
repo-paths.mdrepos/index.mdNever write repo memory back into the target repo itself.
Treat memory updates as write batches.
~/.codex/skills/memory-skill/scripts/sync-memory.sh post-write once.Use the default commit message unless the update clearly deserves a more
specific -m.
Write only durable, reusable information:
Do not write:
If sync fails:
Surface the failure clearly and stop, unless the only problem is that no valid memory repo exists yet and you can initialize or adopt one safely.
The runtime is proxy-aware and can help with GitHub sync on difficult networks.
MEMORY_SYNC_SOCKS_PROXY, ALL_PROXY, or all_proxy.MEMORY_SYNC_GITHUB_TOKEN, GITHUB_TOKEN, or GH_TOKEN.Those capabilities help the runtime sync successfully, but your instruction as the agent does not change: if sync still fails, stop and surface the reason.
Treat memory-skill as a live memory system optimized for future execution
speed and reliability. Keep it small, trustworthy, and publishable.