dark-memory

A governance and memory toolkit for AI agents, using a local service to store knowledge, track work, detect drift, and keep an audit trail. It also includes tools for research, monitoring, error tracking, and delegated tasks.

In plain words
What is it for?
Use it to save and search persistent agent memory, publish and check work specifications, detect differences between plans and results, review claims, monitor agent activity, and investigate errors.
Why use it?
It reduces the risk of agents forgetting important information, losing track of changes, or making decisions without a record. It also helps compare ongoing work with its original specification.

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/opita-code/dark-memory-mcp/dark-memory
Any agent
npx skills add Opita-Code/dark-memory-mcp --skill dark-memory
Clone the repo
git clone --depth 1 https://github.com/Opita-Code/dark-memory-mcp

Made for: Claude Code, Codex.

Per session 353 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,831 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00353 $0.07831
Opus 5 $0.00177 $0.03915
Sonnet 5 $0.00071 $0.01566
Haiku 4.5 $0.00035 $0.00783

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

Security

Grade A, and why

dark-memory scanned grade A 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 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

not a code bug. Verify with curl before touching the Go code.
skills/dark-memory/SKILL.md · 469 lines

How it starts

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

dark-memory-mcp — Harness Skill

Targets dark-memory-mcp v2.13.0 — 52 canonical + 3 red-team tools, schema v25.

Self-update: call dark_memory_health_ping. If server.version > target_version, the server was upgraded. Re-ingest via dark_memory_agent_bootstrap(surface='system_prompt') and check the latest GitHub release for an updated copy of this skill. If server.version < target_version, your binary is stale — rebuild from the repo tag that matches this skill.


TL;DR — 8 rules that prevent 90% of friction

# DO DON'T
1 session_start before any write tool Call write tools without a session (ErrFrameStaleTooFar)
2 health_ping first — cheap, no side-effects Assume the MCP is healthy after a restart
3 agent_memory_recall or research_recall first, then webfetch last Jump to web search for facts you already stored
4 agent_memory_save for persistent knowledge (survives sessions). vibe_publish for work-in-progress (spec + judge + drift gate) Mix them up: specs don't survive, memories don't get judged
5 consensus(n=3) on high-stakes claims, judge for routine Ship debatable claims without a second opinion
6 On drift_detected: fix and re-publish. On needs_human: STOP Ignore drift verdicts — they block the vibe loop
7 session_close(reason=clean) at the end Leave sessions dangling (sweeper closes them, but loses context)
8 Sub-agent spawn: delegate_intent for routing decisions, mindset_apply for prompt composition, agent_memory_delegate for context handoff Spawn sub-agents blind — they inherit no dark-memory context and their writes pollute your ContextRecap

0. Decision tree — which tool when

Need Tool
Start tracking work session_start → get session_id back
Store a fact, decision, finding, or todo for later agent_memory_save(kind=...)
"What do we know about X?" agent_memory_recall(query="X") (FTS5-BM25 ranked)
Browse all memories by type agent_memory_list(scope=project, kind=...)
Research something new (CVE, paper, domain, IP) research_topic(query=...), then research_recall to retrieve
Create a governed spec with tasks vibe_spec(vibe_case=C1..C7, tasks=[...])
Publish an artifact under a spec + get drift verdict vibe_publish(artifact={...}, spec={vibe_case:...})
Self-check a claim `judge(eval_type=drift_judge
N-shot verification consensus(eval_type=..., n=3)
"Should I delegate this work to a sub-agent?" — decide + plan + prompt delegate_intent(vibe_case=C7, task_description="...")
"Just give me a sub-agent prompt for X" — compose only mindset_apply(vibe_case=C1..C7, task_description="...")
Hand off dark-memory context to a sub-agent agent_memory_delegate → inject delegation_context into sub-agent prompt
Isolate sub-agent writes (C2) subagent_register before spawn, subagent_unregister after
Diagnose "the MCP seems broken" health_pingerror_summaryerror_list
Check drift status of a published artifact pipeline_status(artifact_id=N)
Accept/reject a drift report `resolve_drift(drift_id=N, decision=accept
See what changed recently writes(session_id=...) or recall(scope=session)
Check schema version / run migrations admin_schema_statusadmin_migrate
Create a new tenant/project project_create(project_id="...", display_name="...")

Read the full file on GitHub · 469 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 · 469 lines · 353 tokens per session scan A 1a238c2ca9c9

Subscribe to this mod's changes

dark-memory is a skill published in the GitHub repository Opita-Code/dark-memory-mcp (0 stars, last pushed 12d ago), licensed MIT. It adds 353 tokens to every session and 7,831 once invoked, about $0.0018 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

agentbook-version-control

Coordinate Git and Cross-Session Memory as version control for agent work. Use when Codex needs AgentBook status, checkpoints, history, resume or handoff, provenance, isolated agent approaches, semantic comparison, or an evidence-backed game-development tuning and playtest iteration with an explicit keep or revert…

NovasPlace/CSM · 65 tokens

csm-continuity

Use the complete native Cross-Session Memory (CSM) runtime for continuity, memory governance, living state, beliefs, self-model, AgentBook, checkpoints, context cache, goals, work ledger, compaction, re-entry, or handoff across Codex tasks.

NovasPlace/CSM · 60 tokens

csm-governance

Safely deduplicate, review, merge, and archive Cross-Session Memory. Use when memory needs cleanup, dedup, merge, archive-candidate review, or recall-quality assessment.

NovasPlace/CSM · 43 tokens

csm-handoff

Checkpoint expensive state and write a concrete handoff before stopping, compaction, or transferring work in Claude Code.

NovasPlace/CSM · 27 tokens

webmcp-nexus

当接入 webmcp-nexus-sdk 的项目中需要新增 WebMCP 工具函数、将现有业务方法改造为 WebMCP 工具函数,或配置 vite-plugin-webmcp-nexus / webpack-plugin-webmcp-nexus 时使用本技能。本技能约束工具函数的签名、JSDoc、TS 类型写法,并提供零风险的改造流程(仅改签名与注释,不动原方法业务逻辑)。触发示例:"新增一个 WebMCP 工具"、"把这个函数改造成能被 AI Agent 调用的工具"、"让 xxx 函数接入 WebMCP"、"配置 webmcp 构建插件"。.

alibaba/webmcp-nexus · 159 tokens

admin-data-table

Use when creating or editing an admin list/table page in web/src, wiring any paged query, or implementing a paginated repository/endpoint in api/. Covers hook choice (usePagedQuery vs useClientPagination), PageQuery type conventions, the backend paging contract, and the DataTable min-h-0 scroll chain.

VOD-Studio/violet · 68 tokens