memory-compact

memory-compact is a skill for Claude Code, Codex from anthony-chaudhary/fak. It costs 49 tokens per session (208 once invoked), scanned A, original, Apache-2.0.

A cleanup skill for Claude Code's saved project memory. It keeps the main memory file within the amount loaded at the start of each session, so older content is not silently skipped.

In plain words
What is it for?
Keeping Claude Code's automatic memory compact and structured. It is used when a project's memory file approaches the session loading limit.
Why use it?
It prevents useful memories from disappearing simply because the file is too long. It also organizes the stored information so it remains usable.

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/anthony-chaudhary/fak/memory-compact
Any agent
npx skills add anthony-chaudhary/fak --skill memory-compact
Clone the repo
git clone --depth 1 https://github.com/anthony-chaudhary/fak

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/anthony-chaudhary/fak/memory-compact.svg)](https://agentmods.dev/skills/anthony-chaudhary/fak/memory-compact)
Your own site
<a href="https://agentmods.dev/skills/anthony-chaudhary/fak/memory-compact"><img src="https://agentmods.dev/badge/skills/anthony-chaudhary/fak/memory-compact.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 208 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.00049 $0.00208
Opus 5 $0.00024 $0.00104
Sonnet 5 $0.00010 $0.00042
Haiku 4.5 $0.00005 $0.00021

Measured 5d ago against content hash b79abbfae8b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

memory-compact 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.

.agents/skills/memory-compact/SKILL.md · 18 lines

What it actually says

Canonical project skill adapter

Load and follow ../../../.claude/skills/memory-compact/SKILL.md. This generated discovery adapter contains no maintained workflow body.

Portability contract

  • The linked canonical SKILL.md is the single semantic workflow body for Claude, Codex, and fak-native loaders.
  • This adapter changes discovery only; it must not fork, summarize, or translate the workflow.
  • Harness-native invocation, permissions, hooks, model routing, and worker launch remain typed adapters outside the semantic body.
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 · 18 lines · 49 tokens per session scan A b79abbfae8b0

Subscribe to this mod's changes

memory-compact is a skill published in the GitHub repository anthony-chaudhary/fak (36 stars, last pushed today), licensed Apache-2.0. It adds 49 tokens to every session and 208 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.

Related

Other skills, from other repositories

federated-context-governance

Govern agent-configuration drift once tool orchestration scales from one developer to a team. Detects where independently-authored context configs (CLAUDE.md-style settings + installed skills) diverge, classifies the fragmentation stage, enforces a FEDERATED org base whose nonnegotiable settings (security…

AnthonyAlcaraz/agentic-graph-rag-skills · 184 tokens

bi-temporal-edge

Bi-temporal edge primitive for agentic graph memory. Tracks two independent time dimensions per relationship: when the relationship was VALID in the domain (validfrom / validuntil) and when the system LEARNED about it (ingestedat). Enables point-in-time queries like "What was the EC2 instance type for…

AnthonyAlcaraz/agentic-graph-rag-skills · 193 tokens

graphiti-incremental-update

Graphiti (Zep) incremental-update pattern (Ch4). When new content arrives, process only the new content — never re-process the entire graph. Pipeline: (1) extract entities from new episode, (2) entity-resolve against existing graph (dedupe by canonical name + alias + fuzzy match), (3) incremental- update — touch only…

AnthonyAlcaraz/agentic-graph-rag-skills · 166 tokens

hierarchical-memory

Three-tier hierarchical memory (Letta / MemGPT pattern) — core / recall / archival. Core holds a small, fast, frequently-accessed working set (e.g. corelimit=2000 tokens). Recall holds raw interaction history for "what did we talk about yesterday" questions. Archival holds effectively unlimited overflow, still…

AnthonyAlcaraz/agentic-graph-rag-skills · 151 tokens

letta-failure-modes

Reviewer skill: diagnose an agent's memory architecture against the 8 Letta Leaderboard failure modes (Ch4). Takes a memory snapshot (or a description of the architecture) and reports which failure modes are present, with concrete evidence and recommended fixes. Use BEFORE shipping any memory implementation to…

AnthonyAlcaraz/agentic-graph-rag-skills · 121 tokens

memory-consistency-model-selector

Choose a memory consistency model PER agent-coordination operation — STRONG (linearizable), CAUSAL, READ-YOUR-WRITES, or EVENTUAL — by scoring the operation's requirements (shared authoritative state, conflict intolerance, staleness budget, collaboration, self-session continuity), per Ch4 "Memory consistency models…

AnthonyAlcaraz/agentic-graph-rag-skills · 194 tokens