agent-memory

A record of which agents have worked on which areas and files, stored in AGENT-EXPERTISE.md. It tracks strengths, weaknesses, recent work, and file familiarity.

In plain words
What is it for?
Use it before assigning work, when checking who last worked on a module, and after tasks to record outcomes and file familiarity.
Why use it?
It helps choose an agent with relevant experience and keeps delegation informed by earlier task results.

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/monkilabs/opencastle/agent-memory
Any agent
npx skills add monkilabs/opencastle --skill agent-memory
Clone the repo
git clone --depth 1 https://github.com/monkilabs/opencastle

Made for: Claude Code, Codex.

Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 686 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.00069 $0.00686
Opus 5 $0.00034 $0.00343
Sonnet 5 $0.00014 $0.00137
Haiku 4.5 $0.00007 $0.00069

Measured 2d ago against content hash c93ea1d6749d, 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.

src/orchestrator/skills/agent-memory/SKILL.md · 60 lines

How it starts

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

Agent Memory Protocol

Expertise File

Location: .opencastle/AGENT-EXPERTISE.md — one section per agent with Strong Areas, Weak Areas, File Familiarity tables.

Entry format: Area | Evidence | Last Updated — e.g. Server Components | Built TAS-42 | 2026-03-15. File familiarity: - src/lib/search/ — 3 tasks.

Update Triggers

Trigger Action
First-attempt success Update Strong
2+ retries Update Weak
File modified Increment familiarity
DLQ failure Add Weak with ref
>3 months stale Mark as "stale"

Retrieval & Delegation

Query before delegating; include concise context block in prompt:

grep -A5 "## Developer" .opencastle/AGENT-EXPERTISE.md

Example prompt block: Agent Context: Strong — Server Components (3 tasks); Weak — Component styling (2 retries); Familiar — src/lib/search/ (2 tasks)

Update after task completion:

# Append a Strong Area entry
printf '| %s | %s | %s |\n' "Server Components" "Built TAS-42" "$(date +%Y-%m-%d)" >> .opencastle/AGENT-EXPERTISE.md

# Increment file familiarity
awk '/src\/lib\/search\// { if (match($0, /[0-9]+/)) { n = substr($0, RSTART, RLENGTH) + 1; sub(/[0-9]+[[:space:]]*tasks?/, n " tasks") } found=1 } {print} END { if(!found) print "- `src/lib/search/` — 1 task" }' \
  .opencastle/AGENT-EXPERTISE.md > tmp && mv tmp .opencastle/AGENT-EXPERTISE.md

After each task also append file relationships to .opencastle/KNOWLEDGE-GRAPH.md. On DLQ failure, the Weak Area entry must carry the failure ID and a link to its logs.

Validation Checkpoints

  • Before delegating: chosen agent has a Strong area matching the task and no conflicting Weak entry.
  • After completion: expertise file has the new entry, timestamped today.
  • After pruning: rg "— [0-9]+ tasks" .opencastle/AGENT-EXPERTISE.md shows no stale paths.

Pruning

Prune entries older than 6 months; remove familiarity for deleted paths; consolidate duplicates.

Knowledge Graph

Read the full file on GitHub · 60 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 60 lines · 69 tokens per session scan A c93ea1d6749d

Subscribe to this mod's changes

agent-memory is a skill published in the GitHub repository monkilabs/opencastle (61 stars, last pushed 4d ago), licensed MIT. It adds 69 tokens to every session and 686 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

codex-delegation

Use when a coding task would benefit from delegating work to Codex in the background — a deep independent second opinion, security or architecture analysis, or a parallel implementation running while the session continues. Lets Claude drive the codex companion itself (task, review, status --wait, result) without the…

zebbern/agent-collab · 74 tokens

cursor-delegation

Use when a coding task would benefit from delegating work to Cursor in the background — fast parallel implementation, scaffolding, or an everyday review running while the session continues. Lets Claude drive the cursor companion itself (task, review, status --wait, result) without the user typing /cursor: commands.

zebbern/agent-collab · 66 tokens

cursor-prompting

Internal guidance for composing cursor-agent prompts and picking models for coding, review, diagnosis, and research tasks inside the Cursor Claude Code plugin.

zebbern/agent-collab · 31 tokens

cursor-result-handling

Internal guidance for presenting Cursor helper output back to the user.

zebbern/agent-collab · 16 tokens

agentflow

Expert guidance for building, debugging, and extending applications with AgentFlow (10xscale-agentflow). TRIGGER when: code imports from agentflow (e.g. from agentflow import, StateGraph, Agent, ToolNode, AgentState); user references agentflow.json or CLI commands (agentflow init, agentflow api, agentflow play…

10xHub/agentflow-cli · 145 tokens

agentflow

Expert guidance for building, debugging, and extending applications with AgentFlow (10xscale-agentflow). TRIGGER when: code imports from agentflow (e.g. from agentflow import, StateGraph, Agent, ToolNode, AgentState); user references agentflow.json or CLI commands (agentflow init, agentflow api, agentflow play…

10xHub/agentflow-cli · 145 tokens