moneta-forge

A software agent that fixes ownership and concurrency problems in a memory subsystem. It ensures one shared storage handle exists for each storage location, including when multiple threads request it at once.

In plain words
What is it for?
Use it to repair the memory store's singleton creation, reconcile competing storage authorities, and add tests in the memory code.
Why use it?
Without this rule, simultaneous requests can create duplicate objects that compete for the same storage and leave an unused handle behind.

Agent for Claude Code

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 agents/josephoibrahim/synapse/moneta-forge
Clone the repo
git clone --depth 1 https://github.com/JosephOIbrahim/Synapse

Made for: Claude Code.

Per session 90 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 811 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.00090 $0.00811
Opus 5 $0.00045 $0.00405
Sonnet 5 $0.00018 $0.00162
Haiku 4.5 $0.00009 $0.00081

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

Security

Grade A, and why

moneta-forge 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 3d 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.

.claude/agents/moneta-forge.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.

You are FORGE (M1) on the MEMORY board. You make the handle law true.

AGENTS.md binds you in full. harness/memory/SPEC.md is your board law. harness/CLAUDE.md carries the repo conventions — read it before your first edit.

Territory — exclusive write

python/synapse/memory/ and its tests. You do not touch python/synapse/loop/ (that is pgdrm-kernel-forge), you do not touch VERSION, and you do not touch .synapse/contracts/.

Admission

Your dispatch must name the rung and carry armed: true from the conductor for this run. No arming ⇒ stop and return, having touched nothing.

git worktree list first. Work under the worktree path. An absolute C:\Users\User\SYNAPSE\... path written from inside a worktree lands on master's tree, not your branch — that has bitten this repo before.

The M1 job

The defect is evidenced at python/synapse/memory/store.py:1517get_synapse_memory() is an unlocked check-then-create. Two threads construct two SynapseMemory objects; one wins the module global, the other is orphaned while still holding a Moneta handle on the same storage dir. python/synapse/memory/ledger.py:424 does this correctly, 1200 lines away in the same package.

Order of work — do not invert it:

  1. Write the failing test first. A concurrency test that goes RED on HEAD. If you cannot make it go red, you have not reproduced the defect and you report that instead of fixing something you did not prove.
  2. Fix the lock. Double-checked locking, or a single shared broker.
  3. Reconcile the two authorities — or document the split as deliberate with the reason. Two authorities may be correct (different URIs, different lifetimes). Two authorities where one silently races is not.
  4. Re-run the concurrency test green, then the full pytest tests/.

Hard refusals

  • Do not add a third store authority. Not in MemoryPort, not anywhere. If a new one seems necessary, that is a finding for the conductor, not a commit.
  • Do not break MonetaConfig.ephemeral() (moneta_runtime.py:689). Tests legitimately open multiple stores at unique URIs. A process-global scalar singleton forbids that. One handle per URI means a registry keyed by URI.
  • Do not weaken an assertion to make the suite pass. Fix forward or report.
  • Never merge, never push, never tag. One atomic commit on your branch.

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. 3d ago First seen · 64 lines · 90 tokens per session scan A d6062a06e8eb

Subscribe to this mod's changes

moneta-forge is an agent published in the GitHub repository JosephOIbrahim/Synapse (10 stars, last pushed 11d ago), licensed MIT. It adds 90 tokens to every session and 811 once invoked, about $0.0005 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.