Getting it into your agent
There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.
Wrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/songhonglei/better-agent-skills/collective-memory)<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/collective-memory"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/collective-memory/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/collective-memory"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/collective-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00145 | $0.01857 |
| Opus 5 | $0.00072 | $0.00928 |
| Sonnet 5 | $0.00029 | $0.00371 |
| Haiku 4.5 | $0.00015 | $0.00186 |
Grade B, and why
collective-memory scanned grade B with 1 finding 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 10d 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
stored in .secrets/api-keys.env (chmod 600)" How it starts
The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Collective Memory
- Author: Evan Song · github.com/Songhonglei
- Repository: https://github.com/Songhonglei/better-agent-skills
- License: MIT
Broadcast a single memory note to multiple agent workspaces in one shot —
idempotent upsert into MEMORY.md, AGENTS.md, TOOLS.md, USER.md, or
any Markdown file across all targets.
Pure file-ops, zero network, zero LLM. The calling agent decides what to write and which key to look up; this script does the file work atomically.
Execution Flow
Step 1 — Extract the memory
From the user's request, extract three things:
content: the full Markdown block (must include its own##heading line)key: 1–5 word lookup phrase used to find an existing heading to updatefile: which file to write into (defaultMEMORY.md)
File routing rules:
| Content type | Target file |
|---|---|
| Facts, rules, lessons, tool paths, APIs | MEMORY.md |
| Workflows, do/don't, dev conventions | AGENTS.md |
| Tool commands, config params, account info | TOOLS.md |
| Information about the user themselves | USER.md |
When unsure, default to MEMORY.md.
Step 2 — Resolve agent targets (hybrid: explicit > discovery > confirm)
Pick the first strategy that yields targets:
A. Explicit (preferred when known)
--target /path/to/ws1:MEMORY.md \
--target /path/to/ws2:MEMORY.md
Or via env: COLLECTIVE_MEMORY_TARGETS="/ws1:MEMORY.md,/ws2:MEMORY.md".
B. Auto-discover (when user says "all my agents")
--discover-under ~/.claude/projects --file MEMORY.md
--discover-under ~/.openclaw/agents --file MEMORY.md
--discover-under ~/code --file AGENTS.md
Each --discover-under <parent> finds first-level subdirectories.
Discovery defaults to check (in order, stop at first non-empty):
$COLLECTIVE_MEMORY_TARGETSenv~/.claude/projects/(Claude Code)~/.openclaw/agents/(OpenClaw)- CWD's immediate sibling directories
- Ask the user
What ships with it
4 files 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.
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.
- 10d ago First seen · 219 lines · 145 tokens per session scan B 51dc09199f4f
collective-memory is a skill published in the GitHub repository Songhonglei/better-agent-skills (3 stars, last pushed 3d ago), licensed MIT. It adds 145 tokens to every session and 1,857 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
Context Doctor
Identify and repair degradation in system prompt, external memory, and skills preventing you from following instructions or remembering information as well as you should.
memanto-companion
Inspect and manage the cross-session engineering memory that Memanto maintains for your Claude Code skills. Use when the user asks what Memanto remembers, wants to see their engineering profile, manually recall context for a skill, or store a decision. The automatic lifecycle hooks handle capture/injection on their…
system-monitor
Monitor system health: CPU, memory, disk, processes, and network. Alert on thresholds via any channel.
mnemon
Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle.
mnemon
Persistent memory for MiniMax Code. Recall durable context, store important facts and decisions, and link related memories with the mnemon CLI.
init
Install or update OwnMem in the current repository. Use when the user asks to set up OwnMem, add local project memory for coding agents, or refresh an existing OwnMem installation after a version bump.