swarm-memory

swarm-memory is a skill for Claude Code, Codex from chadixearth/graphyloop. It costs 56 tokens per session (778 once invoked), scanned A, original, MIT.

A memory workflow for coding agents that searches past project knowledge before work and records useful decisions or lessons afterward.

In plain words
What is it for?
Use it to recall project context, save reusable patterns, record task outcomes, and correct inaccurate memories.
Why use it?
It prevents an agent from repeating mistakes or overlooking earlier decisions, while avoiding storage of information that should not be remembered.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; mentions OpenCode.

Good fit Use it to recall project context, save reusable patterns, record task outcomes, and correct inaccurate memories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chadixearth/graphyloop/swarm-memory
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.

Any agent
npx skills add chadixearth/graphyloop --skill swarm-memory
Clone the repo
git clone --depth 1 https://github.com/chadixearth/graphyloop

Made for: Claude Code, Codex.

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.

agentmods badge for swarm-memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/chadixearth/graphyloop/swarm-memory/github.svg)](https://agentmods.dev/skills/chadixearth/graphyloop/swarm-memory)
Your own site
<a href="https://agentmods.dev/skills/chadixearth/graphyloop/swarm-memory"><img src="https://agentmods.dev/badge/skills/chadixearth/graphyloop/swarm-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.

agentmods 80×15 button for swarm-memory

Your own site · 80×15
<a href="https://agentmods.dev/skills/chadixearth/graphyloop/swarm-memory"><img src="https://agentmods.dev/badge/skills/chadixearth/graphyloop/swarm-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 778 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00056 $0.00778
Opus 5 $0.00028 $0.00389
Sonnet 5 $0.00011 $0.00156
Haiku 4.5 $0.00006 $0.00078

Measured 5d ago against content hash 51f7db59c282, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

swarm-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 5d 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.

skills/swarm-memory/SKILL.md · 64 lines

How it starts

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

Swarm memory

Memory is only useful if it is read before deciding and written after learning. A store that is written but never searched is a diary; one that is searched but never corrected repeats its mistakes forever.

When to activate

  • START of any non-trivial task, before planning.
  • END of any task that produced a decision, a gotcha, or a reusable approach.
  • When a past decision is being revisited ("why is it done this way?").

Procedure

  1. Recall first. memory_search with 2-4 concrete keywords from the task (component names, error text, feature nouns). Optional type filter: decision, pattern, lesson, event, task.
    • Results exist → use them, and say which memory informed the plan.
    • Nothing → say nothing and proceed. Never invent a recalled memory.
  2. Store at the end, one entry. memory_store with the right type:
    • decision — a choice made and why (the alternative rejected matters more than the choice).
    • lesson — a gotcha hit and how it was resolved. This is the highest-value type.
    • pattern — a reusable approach with the file that demonstrates it.
    • event — something that happened (a deploy, a migration, an incident).
  3. Correct, do not accumulate. A wrong or outdated memory gets memory_forget with its id, then a corrected entry. Leaving both means the next session gets contradictory advice with no way to pick.

What makes an entry worth keeping

Good: one dense line, searchable nouns, an anchor.

decision: state lives in <project>/.graphyloop/state.json (was .opencode/graphyloop) — three of four harnesses are not opencode; migration in lib/engine.mjs
lesson: node --test hangs when a failing assert skips stdin.end() on a spawned server — the child holds the stdio pipes; close it in a finally
pattern: file-to-file credential sync (env_sync) keeps values out of the model context — see lib/secrets.mjs

Bad, and why:

  • "fixed the bug" — unsearchable, no anchor, no cause.
  • A pasted 200-line diff — the repo already has it; memory is for the why.
  • "user prefers dark mode" when it was said once about one screen — over-generalized preferences become wrong rules.

Read the full file on GitHub · 64 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. 5d ago First seen · 64 lines · 56 tokens per session scan A 51f7db59c282

Subscribe to this mod's changes

swarm-memory is a skill published in the GitHub repository chadixearth/graphyloop (2 stars, last pushed 23d ago), licensed MIT. It adds 56 tokens to every session and 778 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-09-03.