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.
npx agentmods add skills/vbcherepanov/total-agent-memory/memory-protocolnpx skills add vbcherepanov/total-agent-memory --skill memory-protocolgit clone --depth 1 https://github.com/vbcherepanov/total-agent-memoryWhat 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 | $0.00120 | $0.02653 |
| Opus 5 | $0.00060 | $0.01326 |
| Sonnet 5 | $0.00024 | $0.00531 |
| Haiku 4.5 | $0.00012 | $0.00265 |
Grade A, and why
memory-protocol 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.
How it starts
The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory Protocol — Universal Skill
You have access to a persistent cross-session memory via the total-agent-memory MCP server (60+ tools). Knowledge survives between sessions and is shared across agents working on the same project.
This skill is universal — the same MCP tools, the same triggers, the
same templates work in every supported environment (Claude Code, Codex,
Cursor, Cline, Continue, Aider, Windsurf, Gemini CLI, OpenCode). Hooks
and sub-agents are environment-specific and documented separately
(see references/hooks-explained.md and references/ide-setup.md).
The five non-negotiables
- Session start →
session_initfirst, thenmemory_recall. Always. Skip only if you have already calledsession_initin this session. - Before any non-trivial task →
memory_recall(query, project). Use the recipe instead of guessing the convention. - After every significant action →
memory_saveimmediately. Don't batch. A decision, a fix, a new convention — one save per fact, not one save per session. - On error / bash non-zero / stuck →
learn_error(orself_error_log) with root cause + fix. Pattern auto-consolidates after 3 occurrences. - End of session →
session_endwith summary + next_steps + pitfalls.
If you only remember one thing: session_init → memory_recall →
work → memory_save → session_end.
Trigger table — when to call what
| Event | Tool | Why |
|---|---|---|
| Session opens | session_init(project) |
Returns previous summary + next_steps + pitfalls and marks them consumed. Call first. |
| Any task starts | memory_recall(query, project) |
Recipe-first; never invent a convention twice. |
| Before edit/write to a file | file_context(path) |
Returns risk_score + warnings (past errors on this path, hot spots). |
| Before architecture choice | memory_recall + analogize(query, exclude_project) |
Cross-project analogy. |
| Bash returns non-zero (and reproducible) | learn_error(file, error, root_cause, fix, pattern) |
Auto-consolidates to a rule after N≥3. |
| Architectural decision made | save_decision(title, options, criteria_matrix, selected, rationale) |
Structured; auto-tagged structured; goes into recall with decisions_only=True filter. |
| Tech-stack/dependency/config change | kg_add_fact(subject, predicate, object) |
Temporal; auto-invalidates old facts. |
| Solution that other projects could reuse | memory_save(type='solution', tags=['reusable', '<tech>']) |
Surfaces in analogize() for sibling projects. |
| Reusable pattern / idiom | memory_save(type='convention') |
|
| Lesson learned (regression / postmortem) | memory_save(type='lesson') |
Higher recall weight on similar tasks. |
| Episode (story of how something was done) | memory_episode_save(narrative, outcome) |
Narrative form — "what was tried, what failed, what worked". |
| Error worth a one-time note | self_error_log(description, category, fix?) |
Cheaper than learn_error; no auto-rule. |
| User prompt that should be remembered | save_intent(prompt, project) |
Auto-captured by hook if installed. |
| Major task starting | workflow_predict(task_description) |
If confidence < 0.3 ask the user about approach. |
| Major task ending | workflow_track(workflow_id, outcome) |
Trains the predictor. |
| "What was the stack at date X?" | kg_at(timestamp) |
Time-travel query. |
| "Find similar in other projects" | analogize(text, exclude_project) |
Jaccard + Dempster-Shafer fusion. |
| Indexing an external repo | ingest_codebase(path, languages) |
AST tree-sitter, 9 languages. |
| Show recent saves chronologically | memory_timeline(limit) |
Replays session → session. |
| Build per-project digest | memory_wiki_generate(project) |
Markdown to <MEMORY_DIR>/wikis/<project>.md. |
| Session closes ("сохранись" / "save") | session_end(session_id, summary, next_steps, pitfalls) + dual-write to Obsidian if available |
Picked up by next session_init. |
What ships with it
10 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.
- references/hooks-explained.md 8.1 KB
- references/ide-setup.md 9.8 KB
- references/subagent-protocol.md 4.9 KB
- references/tool-cheatsheet.md 14 KB
- references/workflow-recipes.md 12 KB
- templates/claude-code-settings.json 1.5 KB
- templates/cline-rules.md 1.7 KB
- templates/codex-AGENTS-block.md 1.3 KB
- templates/codex-config.toml 783 B
- templates/cursor-rules.mdc 2.0 KB
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.
- 3d ago First seen · 223 lines · 120 tokens per session scan A 3e1238a16d28
memory-protocol is a skill published in the GitHub repository vbcherepanov/total-agent-memory (66 stars, last pushed 6d ago), licensed MIT. It adds 120 tokens to every session and 2,653 once invoked, about $0.0006 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.
Other skills, from other repositories
mulch-record-from-evidence
Turn the evidence of a finished work session — git commits, changed files, recently-touched seeds issues — into well-formed ml record invocations. Use at session close, when an agent has made changes worth preserving as mulch expertise but hasn't yet recorded them.
implement
End-to-end workflow for taking MCP work items from backlog to merged PR. Handles git branching, schema-driven planning, implementation, independent review, and PR creation. Composes spec-quality, review-quality, and schema-workflow skills into a single pipeline. Use when a user says "implement this", "work on this…
session-retrospective
Analyzes the current implementation run — evaluates schema effectiveness, delegation alignment, note quality, and plan-to-execution fit. Captures cross-session trends and proposes improvements when patterns repeat. Use after implementation runs, or when user says 'retrospective', 'session review', 'what did we learn'…
ralph
Launcher for the Ralph-style queue drain script — emits the right node ralph-loop.mjs invocation based on the user's filter and bounds. The actual loop runs as a Node script that spawns one claude -p --worktree per iteration; this skill is the configurator, not the loop. Use when a user says: drain the backlog, ralph…
prepare-release
End-to-end release automation — reads commits since last tag, infers semver bump, drafts changelog, creates release PR, merges it, waits for CI green, tags, and monitors the Docker build to completion. Use when the user says: prepare release, cut a release, bump version, create release PR, ship a new version, tag a…
quick-start
Interactive onboarding for the MCP Task Orchestrator. Detects empty or populated workspaces and walks through how plan mode, persistent tracking, and the MCP work together. Use when a user says "get started", "how do I use this", "quick start", "first time setup", "onboard me", "what can this MCP do", or "help me…