compartmentalize

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

A memory-saving assistant that reviews a conversation and stores useful facts, decisions, observations, and open items in Compartment, an encrypted memory vault. It searches existing memories before adding or updating information.

In plain words
What is it for?
Use it to save project decisions, contacts, links, credentials locations, session outcomes, and unresolved work for future retrieval.
Why use it?
It helps preserve important context so it is not lost when a conversation is shortened or revisited later.

Skill for Claude CodeCodex

Part of the compartment plugin — 2 skills, 1 MCP server shipped together

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

Made for: Claude Code, Codex.

Or install compartment, the plugin that ships this one along with the rest of its 2 skills, 1 MCP server.

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/compartmentalize.svg)](https://agentmods.dev/skills/maxfreedompollard/compartment/compartmentalize)
Your own site
<a href="https://agentmods.dev/skills/maxfreedompollard/compartment/compartmentalize"><img src="https://agentmods.dev/badge/skills/maxfreedompollard/compartment/compartmentalize.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 573 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.1 $0.00052 $0.00573
Opus 5 $0.00026 $0.00287
Sonnet 5 $0.00010 $0.00115
Haiku 4.5 $0.00005 $0.00057

Measured 5d ago against content hash 0ddb1ec0911c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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

Copies of this mod

1 near-identical copy found in the catalogue:

skills/compartmentalize/SKILL.md · 53 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. 5d ago First seen · 53 lines · 52 tokens per session scan A 0ddb1ec0911c

Subscribe to this mod's changes

compartmentalize is a skill published in the GitHub repository MaxFreedomPollard/Compartment (590 stars, last pushed yesterday), licensed Apache-2.0. It adds 52 tokens to every session and 573 once invoked, about $0.0003 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.

Related

Other skills, from other repositories