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 skills add kevin-hs-sohn/hipocampus --skill compactiongit clone --depth 1 https://github.com/kevin-hs-sohn/hipocampusWrote 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.
[](https://agentmods.dev/skills/kevin-hs-sohn/hipocampus/compaction)<a href="https://agentmods.dev/skills/kevin-hs-sohn/hipocampus/compaction"><img src="https://agentmods.dev/badge/skills/kevin-hs-sohn/hipocampus/compaction/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.
<a href="https://agentmods.dev/skills/kevin-hs-sohn/hipocampus/compaction"><img src="https://agentmods.dev/badge/skills/kevin-hs-sohn/hipocampus/compaction.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00045 | $0.03087 |
| Opus 5 | $0.00023 | $0.01543 |
| Sonnet 5 | $0.00009 | $0.00617 |
| Haiku 4.5 | $0.00005 | $0.00309 |
Grade A, and why
hipocampus-compaction 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 9d 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 — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory Compaction Tree
5-level hierarchical index over raw memory logs. Compaction nodes are search indices — originals are never deleted.
Hierarchy
memory/
ROOT.md <- root node (topic index, ~3K tokens, Layer 1)
2026-03-15.md <- raw daily log (permanent, append-only)
daily/2026-03-15.md <- daily compaction node
weekly/2026-W11.md <- weekly compaction node
monthly/2026-03.md <- monthly compaction node
Compaction chain: Raw → Daily → Weekly → Monthly → Root
Tree traversal (search): Root → Monthly → Weekly → Daily → Raw
Fixed vs Tentative Nodes
Every compaction node has a status:
- tentative — period is still ongoing, regenerated when new data arrives
- fixed — period ended, never updated again
# Indicated in YAML frontmatter
---
type: weekly
status: tentative
period: 2026-W11
---
Key: tentative nodes are created immediately — ROOT.md is usable from day one.
When to Run
Called from hipocampus:core Session Start step 7, or directly by an external scheduler (e.g., OpenClaw heartbeat). Check trigger conditions below.
Trigger Conditions
| Level | Tentative Create/Update | Fixed Transition |
|---|---|---|
| Raw → Daily | On each new raw addition | Date changes |
| Daily → Weekly | On daily add/change | ISO week ended + 7 days elapsed |
| Weekly → Monthly | On weekly add/change | Month ended + 7 days elapsed |
| Monthly → Root | On monthly add/change | Never (root accumulates forever) |
Smart Thresholds
Below threshold: copy/concat verbatim (no information loss). Above threshold: generate LLM keyword-dense summary.
| Level | Threshold | Above | Below |
|---|---|---|---|
| Raw → Daily | ~200 lines | LLM keyword-dense summary | Copy raw verbatim |
| Daily → Weekly | ~300 lines combined | LLM keyword-dense summary | Concat dailies |
| Weekly → Monthly | ~500 lines combined | LLM keyword-dense summary | Concat weeklies |
| Monthly → Root | Always | Recursive recompaction | (N/A) |
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.
- 9d ago First seen · 307 lines · 45 tokens per session scan A 45ea0e6f0143
hipocampus-compaction is a skill published in the GitHub repository kevin-hs-sohn/hipocampus (206 stars, last pushed 3mo ago), licensed MIT. It adds 45 tokens to every session and 3,087 once invoked, about $0.0002 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
mnemo-cortex
Installs and wires Mnemo Cortex (local-first persistent memory) into OpenClaw and other MCP-capable agents. Use for cross-session recall, decision history, or multi-agent shared memory.
capture-knowledge
A guide for saving useful, reusable knowledge from conversations and documents into a structured personal knowledge base. It separates original source material from concise pages about individual concepts.
second-brain-doctor
A read-only health check for an agent’s connection to a local Second Brain. It checks the authoritative files, installed skills, supporting service, access rules, version drift, and behavior in a new session.
second-brain-learn
A learning tool that reviews the current conversation and work evidence to find durable preferences, project rules, reusable methods, and lessons. It routes each finding to the appropriate long-term owner or leaves it unsaved when it has no lasting value.
second-brain-attach
A setup process for connecting a new or reset AI agent to a local Second Brain—a personal collection of rules, identity information, and reusable skills. It installs the required skills, connects the supporting service, and checks the setup in a fresh session.
second-brain-distill
A skill for extracting reusable knowledge from selected historical AI-agent conversations and archiving the results. It can process conversations only within a clearly defined, authorized batch.