agent-memory

agent-memory is a skill for Claude Code from kouroshez/coding-os. It costs 121 tokens per session (2,650 once invoked), scanned A, original, Apache-2.0.

A guide to using Coding OS's cross-session memory tools, which store useful observations about past code changes, decisions, and failures. It explains how to search that memory, inspect details and timelines, and run its learning process.

In plain words
What is it for?
Use it when recalling a past pattern, checking earlier decisions or failures, reviewing a timeline, suggesting learned improvements, or understanding how observations are captured.
Why use it?
It helps an agent recover relevant knowledge from earlier sessions instead of repeating solved problems or decisions. It also clarifies which memory is captured automatically and which actions are explicit.

Skill for Claude Code

Written for Claude Code: PostToolUse hook event. Also seen: mentions Codex.

Good fit Use it when recalling a past pattern, checking earlier decisions or failures, reviewing a timeline, suggesting learned improvements, or understanding how observations are captured.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kouroshez/coding-os/agent-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 kouroshez/coding-os --skill agent-memory
Clone the repo
git clone --depth 1 https://github.com/kouroshez/coding-os

Made for: Claude Code.

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 agent-memory

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kouroshez/coding-os/agent-memory"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/agent-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 121 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,650 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.00121 $0.02650
Opus 5.5 $0.00048 $0.01060
Sonnet 5.5 $0.00024 $0.00530
Haiku 4.5 $0.00012 $0.00265

Measured 1mo ago against content hash 413aa0d6eac6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agent-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 1mo 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.

src/core/skills/agent-memory/SKILL.md · 192 lines

How it starts

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

agent-memory

Purpose: turn the policy in src/core/rules/memory.md into mechanical recipes the agent can execute. The rule answers when and what; this skill answers how — the exact tool signatures, what is automatic vs explicit, and what the return envelopes look like. Every signature here is verified against src/core/thinking_os/server.py; a CI drift-guard test fails if any drifts.

Read when: recalling from memory (cos_search, cos_details, cos_timeline, cos_learn_suggest), running the learning loop (cos_learn_extract / cos_learn_validate), or understanding how observations get captured.

Skip when: the query target is current code (use graph-explorer) or current docs (use cos_doc_search per search). Memory is the third-priority retrieval layer.

The mental model — writes are automatic, you mostly READ

The single most important fact: you do not hand-author observations. Memory is written automatically by PostToolUse capture hooks — every Write/Edit/MultiEdit derives a sanitized, deduped, impact-scored observation (capture.py), and separate hooks capture tool failures and session events. Confidence on learned patterns is system-computed by brain-inspired LTP/LTD formulas, not a number you set. The agent's job is to read memory in the Orient phase and reinforce patterns via the learn loop. There is no freeform record(title, body, confidence) tool — by design.

The Decision Gate — before any memory call

Question                                  → Layer + Tool
─────────────────────────────────────────────────────────
"Where is function X defined?"            → graph    cos_graph_query
"What does spec Y say?"                   → docs     cos_doc_search
"What's in flight / blocked?"             → tasks    cos_task_board
"Have I seen this pattern before?"        → memory   cos_search
"Why did we choose approach Z?"           → memory   cos_search (memory_type=decision)
"Which patterns apply to my task?"        → memory   cos_learn_suggest(domain=, complexity=)
"What changed in the last N days?"        → memory   cos_timeline(days=N)
"How does X work / who calls X / rename"  → graph    cos_graph_* (graph/code FIRST)
"Not sure which layer"                    → default to graph/code; memory only for cross-session recall

Read the full file on GitHub · 192 lines

Files

What ships with it

2 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.

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. 1mo ago First seen · 192 lines · 121 tokens per session scan A 413aa0d6eac6

Subscribe to this mod's changes

agent-memory is a skill published in the GitHub repository kouroshez/coding-os (6 stars, last pushed 5d ago), licensed Apache-2.0. It adds 121 tokens to every session and 2,650 once invoked, about $0.0005 per session on Opus 5.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.

Related

Other skills, from other repositories

shodh-memory

Persistent memory system for AI agents. Use this skill to remember context across conversations, recall relevant information, and build long-term knowledge. Activate when you need to store decisions, learnings, errors, or context that should persist beyond the current session.

varun29ankuS/shodh-memory · 53 tokens

ori-memory

Persistent agent memory with learning retrieval. Knowledge graph on markdown files — capture insights, decisions, research, and learnings during work, then retrieve them weeks or months later. Use when knowledge is too valuable to lose but too much to inject into every prompt.

aayoawoyemi/Ori-Mnemos · 54 tokens

lemmalog

Externalize working memory and logical state into the lemmalog Datalog engine (MCP). Use for ANY multi-step task where state should outlive one context window or span agents: long investigations, debugging sessions, audits, multi-agent searches, systematic explorations, planning with many interdependent constraints…

JordyZomer/lemmalog · 105 tokens

linglu-discipline

A set of 16 operating rules for an AI coding agent, including when to read or write long-term memory and how to report completed actions. It is designed to work with the Lingshu memory service through an MCP connection.

FuRongJun-1999/dsh-memory · 73 tokens

braindb-agent

Persistent memory across sessions via the BrainDB agent. Use at conversation start and whenever you need to recall what you know about the user or save new information to long-term memory.

dimknaf/braindb · 40 tokens

forgetful-entities

Model the things knowledge attaches to — people, organisations, devices, products, system components. Use when a new thing surfaces that memories will reference, when relationships between things need recording (owns, depends on, part of), or when another skill routes a pointable thing here. Litmus: an entity is a…

ScottRBK/forgetful · 80 tokens