agent-memory

A repository memory layer that stores project notes, conventions, decisions, and current task context in Markdown files.

In plain words
What is it for?
Use it to load relevant project context at the start of a task and save durable decisions or lessons afterward.
Why use it?
It reduces the need to rediscover project details between coding sessions and helps keep work consistent.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xchucx/agent-memory/agent-memory
Any agent
npx skills add xChuCx/agent-memory --skill agent-memory
Clone the repo
git clone --depth 1 https://github.com/xChuCx/agent-memory

Made for: Claude Code, Codex.

Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,387 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00085 $0.02387
Opus 5 $0.00043 $0.01193
Sonnet 5 $0.00017 $0.00477
Haiku 4.5 $0.00009 $0.00239

Measured 2d ago against content hash 72356cb4fb98, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-memory scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/skills/agent-memory/SKILL.md · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.

agent-memory

agent-memory is a local context middleware that maintains a structured, byte-preserving Markdown memory layer for this repository. Your runtime exposes three MCP tools backed by it:

  • memory.fetch_context — read; returns a budgeted Markdown pack drawn from current task state, conventions, decisions, modules, and (on query) the most relevant indexed sections.
  • memory.propose_update — write; submits structured operations that the server validates, secret-scans, and either applies immediately or stages for human review.
  • memory.status — health; reports file counts, pending staged proposals (with drift status), and security/git/lock posture. Call it when you want to know whether memory needs maintenance before proposing more updates.

At session start: always fetch_context with empty query

{ "name": "memory.fetch_context", "arguments": {} }

The empty-query (“bootstrap”) pack contains:

  • local/current.<branch>.md — your last working notes on this branch.
  • local/current.shared.md — cross-branch shared state.
  • conventions.md — project conventions.
  • index.md — summary of the memory layout.

Read it carefully before reading source files. It tells you what the team already decided, what footguns are documented, and where you left off.

When else to fetch_context

Trigger Call
Topic shift mid-task (auth → billing) fetch_context with a query naming the new topic
About to make an architectural decision fetch_context with a query naming the area
Refactoring an unfamiliar module fetch_context with scope: ["<module-path>"]

Do not call fetch_context on every tool call. Once at session start plus query-driven refreshes is the right cadence.

When to propose_update

Pick the intent that matches the situation. Each intent maps to a specific category of memory file and an approval policy.

Situation intent Routes to
Working notes on this task, branch-scoped update_current apply
Working notes that follow you across branches update_shared apply
End-of-task log of what you did session_log apply (path auto-rewritten to sessions/<UTC today>.md)
Hit a footgun future-you should avoid add_pitfall apply (when append_to_section) / stage (when rewriting)
Made a durable architectural decision record_decision stage
Updated facts about a module refresh_module stage
Discovered a team convention update_conventions stage
An older entry is no longer accurate archive_stale stage

Read the full file on GitHub · 226 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 226 lines · 85 tokens per session scan A 72356cb4fb98

Subscribe to this mod's changes

agent-memory is a skill published in the GitHub repository xChuCx/agent-memory (9 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 85 tokens to every session and 2,387 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

pp-learn-loop-example

Printing Press CLI for Learn Loop Example. Golden fixture exercising the spec-declared self-learning loop.

mvanhorn/cli-printing-press · 25 tokens

printing-press-retro

Use when the user asks to retro, run a retrospective, file findings, or improve the Printing Press after a printed-CLI run. Trigger phrases: "retro", "retrospective", "what went wrong", "improve the press", "post-mortem", "lessons learned", "what can we improve", "file a retro", "submit findings". Do not use for…

mvanhorn/cli-printing-press · 96 tokens

openmaic-classroom

将 RAG 检索结果、文档块或知识图谱概念转换为 OpenMAIC 互动课程。当用户要求将知识库内容、检索到的文档片段、上传的文档、或知识图谱中的概念批量转换为教学课件/互动课堂时使用此技能。支持纯需求生成、基于 PDF 内容的课程生成、和基于概念图遍历的批量课堂生成。.

Tencent/WeKnora · 102 tokens

draft-docs

Generate first-draft technical documentation from code analysis.

existential-birds/beagle · 13 tokens

ensure-docs

Verify documentation coverage and generate missing docs interactively.

existential-birds/beagle · 13 tokens

simple-go-api

Teach, explain, review, or extend the vc-gin-api Gin project while preserving its small Router-to-Handler-to-Service-to-DAO flow. Use when a learner asks how a request works, wants to add a field or endpoint, needs a guided Go backend exercise, or asks Codex to check this repository for overengineering. Do not use to…

bg-vc/vc-gin-api · 87 tokens