compartmentalize

compartmentalize is a skill for Claude Code, Codex from MaxFreedomPollard/Compartment. It costs 52 tokens per session (639 once invoked), scanned A, a copy of compartmentalize, Apache-2.0.

A skill that saves useful information from a conversation into Compartment, an encrypted memory vault for AI agents.

In plain words
What is it for?
Reviewing a conversation, finding related stored memories, updating them when needed, and saving new facts or decisions as separate memory items.
Why use it?
It prevents important decisions, contacts, links, and unfinished work from being lost when a conversation is shortened or revisited later.

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/maxfreedompollard/compartment/agent-skill
Any agent
npx skills add MaxFreedomPollard/Compartment --skill agent-skill
Clone the repo
git clone --depth 1 https://github.com/MaxFreedomPollard/Compartment

Made for: Claude Code, Codex.

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 compartmentalize

README.md
[![agentmods](https://agentmods.dev/badge/skills/maxfreedompollard/compartment/agent-skill.svg)](https://agentmods.dev/skills/maxfreedompollard/compartment/agent-skill)
Your own site
<a href="https://agentmods.dev/skills/maxfreedompollard/compartment/agent-skill"><img src="https://agentmods.dev/badge/skills/maxfreedompollard/compartment/agent-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 92% copy Near-identical to another mod 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.00052 $0.00639
Opus 5 $0.00026 $0.00319
Sonnet 5 $0.00010 $0.00128
Haiku 4.5 $0.00005 $0.00064

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

Security

Grade A, and why

compartmentalize 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 4d 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.

Origin

This is a copy

92% identical to compartmentalize — 10 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

src/compartment/data/agent-skill/SKILL.md · 57 lines

What it actually says

Save to Compartment before compacting.

Sweep the entire conversation, including any part already summarized, and store to Compartment everything potentially worth knowing again later that is not common public knowledge. This is encrypted storage, so when in doubt, store it.

For each item, memory_search first, then memory_store: update the existing memory when one already covers it, create a new one when none does.

Always store, when present: people, contacts and addresses. Passwords, API keys, tokens, account IDs, and where each one lives. URLs, hostnames, repo and release locations.

Then properly associate and store any observation, decision, opinion and any thought that is not publicly available. Anything that would be expensive or impossible to work out again from scratch.

Also store the session itself - as several one-claim memories, never one narrative: one for what was asked, one for what it turned into, one for what changed by the end, one for what is still open. That the work happened and what it did is information in its own right, sometimes more useful than any single detail inside it, and each of those claims is recalled on its own.

Skip: common public knowledge, anything already stored unless it is an update with additional or changed information, and the Compartment vault passphrase itself.

Write each memory to stand alone: ONE claim of at most 200 characters by default - the vault enforces this and refuses lists, headings and paragraphs - with no pronouns pointing back at this conversation and no "as discussed above". Never leave out information that is necessary to understand the memory on its own. Several facts go through memory_store_many, one record each, in one call. Store preferences, stances and judgement calls with kind='opinion': opinions update instead of accumulate, and one resembling a live opinion comes back for an explicit supersedes=[old id] resend. Set namespace, tags and importance. When a fact was established before today, pass discovered=YYYY-MM-DD; the vault stamps every memory's dates itself, so never type dates into the text.

Do not stop early. Finish the sweep, then report how many were stored and how many updated.

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. 4d ago First seen · 57 lines · 52 tokens per session scan A ca093d481f57

Subscribe to this mod's changes

compartmentalize is a skill published in the GitHub repository MaxFreedomPollard/Compartment (590 stars, last pushed today), licensed Apache-2.0. It adds 52 tokens to every session and 639 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to compartmentalize, differing in 10 lines, and is treated as a copy.

Related

Other skills, from other repositories

openclaw-skill

Gives your OpenClaw agent persistent, encrypted memory that survives across sessions. Store thoughts, decisions, skills learned, and preferences. Recall them next session. Share knowledge with other agents via the Commons.

MastadoonPrime/sylex-memory · 0 tokens

cognee-cli

Use when the user wants to drive cognee from the terminal with cognee-cli — remember/recall/forget/improve memory commands, managing datasets and config, or database migrations.

topoteretes/cognee · 42 tokens

Context Doctor

Identify and repair degradation in system prompt, external memory, and skills preventing you from following instructions or remembering information as well as you should.

letta-ai/letta-code · 30 tokens

memanto-companion

Inspect and manage the cross-session engineering memory that Memanto maintains for your Claude Code skills. Use when the user asks what Memanto remembers, wants to see their engineering profile, manually recall context for a skill, or store a decision. The automatic lifecycle hooks handle capture/injection on their…

moorcheh-ai/memanto · 72 tokens

gitnexus-exploring

Navigate unfamiliar code using GitNexus knowledge graph.

doobidoo/mcp-memory-service · 16 tokens

memory-recall

Search and recall relevant memories from past sessions via memsearch. Use when the user's question could benefit from historical context, past decisions, debugging notes, previous conversations, or project knowledge -- especially questions like 'what did I decide about X', 'why did we do Y', or 'have I seen this…

zilliztech/memsearch · 149 tokens