condense-memory

condense-memory is a skill for Claude Code, Codex from event4u-app/agent-config. It costs 51 tokens per session (2,854 once invoked), scanned C, original, MIT.

A method for shortening always-loaded agent instruction files such as AGENTS.md, CLAUDE.md, or .cursorrules.

In plain words
What is it for?
Use it when these memory files are too long or approach the host tool's character limit.
Why use it?
It helps reduce the amount of project guidance loaded into every task while preserving the original file for recovery.

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/event4u-app/agent-config/condense-memory
Any agent
npx skills add event4u-app/agent-config --skill condense-memory
Clone the repo
git clone --depth 1 https://github.com/event4u-app/agent-config

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/event4u-app/agent-config/condense-memory.svg)](https://agentmods.dev/skills/event4u-app/agent-config/condense-memory)
Your own site
<a href="https://agentmods.dev/skills/event4u-app/agent-config/condense-memory"><img src="https://agentmods.dev/badge/skills/event4u-app/agent-config/condense-memory.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,854 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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 $0.00051 $0.02854
Opus 5 $0.00026 $0.01427
Sonnet 5 $0.00010 $0.00571
Haiku 4.5 $0.00005 $0.00285

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

Security

Grade C, and why

condense-memory scanned grade C with 1 finding 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

- Condense a path matching the sensitive-file denylist (`.env*`, `.netrc`, `credentials*`, `secrets*`, `id_rsa*`, `*.pem|key|p12|pfx|crt|cer|jks`, `.ssh/*`) — the script refuses with `SensitivePathError` and so should yo
src/skills/condense-memory/SKILL.md · 130 lines

How it starts

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

condense-memory

Experimental. Output-side telegraph dialect did not meet the kill-criterion in internal/bench/reports/telegraph-v1.md (vs_terse median −9.27 %). Input-side memory condensation is an orthogonal use case: the savings target the always-loaded memory budget, not the reply stream. Treat ship-criterion as per-target measurement, not the v1 verdict.

When to use

Use when:

  • An always-loaded memory file (AGENTS.md, CLAUDE.md, .cursorrules, GEMINI.md, .windsurfrules) is close to or above the host tool's char budget and the maintainer wants to recover input-token headroom.
  • A consumer-shipped templates/AGENTS.md is failing the agents-md-thin-root cap and the pointer-extraction options are exhausted.
  • The maintainer asks to "condense this memory file" or "shrink AGENTS.md" or names input-side telegraph.

Do NOT

  • Condense a reply, commit message, PR body, ticket summary, or any deliverable written for a human reader — those are carve-outs in telegraph-speak § Carve-outs and stay verbatim.
  • Condense a path matching the sensitive-file denylist (.env*, .netrc, credentials*, secrets*, id_rsa*, *.pem|key|p12|pfx|crt|cer|jks, .ssh/*) — the script refuses with SensitivePathError and so should you.
  • Condense a generated file (dist/agent-src/, .augment/, .claude/, .cursor/, .clinerules/, .windsurfrules) — edit the source in src/ and regenerate via the package's sync + generate-tools scripts (scripts/condense.sh --sync + scripts/condense.ts --generate-tools).
  • Hand-edit a condensed memory file in place — run --decondense first; the next condense pass refuses on body-hash drift (CondensationRefused).
  • Commit the condensed file without committing the matching .original.md backup — round-trip breaks otherwise.

Procedure

  1. Analyse the target first. Before any write, inspect the target with view or wc -l to confirm it is an always-loaded memory file (AGENTS.md, CLAUDE.md, .cursorrules, GEMINI.md, .windsurfrules), is not generated, and has prose paragraphs to condense (a pointer-only Thin-Root file may net near-zero). Skip the rest of the procedure if any check fails.
  2. Check denylist gate. Run ./scripts-run src/scripts/condense_memory <path> --check — exit 0 = safe; exit 2 = denylist hit, stop and surface the refusal.
  3. Record baseline. wc -c <path> — capture pre-condensation char count for the commit message.
  4. Condense. ./scripts-run src/scripts/condense_memory <path>. The script writes <path>.original.md (verbatim backup) and rewrites <path> with original_sha256: + condensed_at: frontmatter.
  5. Inspect the diff. Eyeball every Iron-Law fence, numbered-options block, code fence, backtick span, /⚠️/ line, and frontmatter pair — all must be byte-identical. Body prose may have lost articles (the/a/an) and auxiliaries (is/are/was/be/that/which).
  6. Validate idempotency. Re-run ./scripts-run src/scripts/condense_memory <path> — clean re-run is a no-op (body hash matches). Non-zero exit = stop, escalate.
  7. Commit both files together. <path> and <path>.original.md ship as a pair. The backup is the rollback path; never commit one without the other.
  8. Rollback path. If readability fails review at step 5: ./scripts-run src/scripts/condense_memory <path> --decondense restores the backup and deletes .original.md.

Read the full file on GitHub · 130 lines

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 · 130 lines · 51 tokens per session scan C 4572c991ed39

Subscribe to this mod's changes

condense-memory is a skill published in the GitHub repository event4u-app/agent-config (10 stars, last pushed yesterday), licensed MIT. It adds 51 tokens to every session and 2,854 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (reaches for credential files). 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

save-progress

Save current project task progress to local task state file for cross-session continuity. Use when the user asks to save progress, uses an equivalent localized trigger phrase, the session is interrupted, or the user wants to resume work later. Writes to .claude/project-task-state.json so next session can load it via…

KimYx0207/Meta_Kim · 65 tokens

init

Install or update OwnMem in the current repository. Use when the user asks to set up OwnMem, add local project memory for coding agents, or refresh an existing OwnMem installation after a version bump.

grpcer/ownmem · 43 tokens

lov-search-chat

从本机 Ataru 记忆索引里召回过去的 AI 会话上下文,返回可定位的命中与原文片段。 Use when asked what was discussed, decided, or fixed in an earlier session.

lovstudio/skills · 53 tokens

chatcrystal-debug-recall

Recall ChatCrystal memories for debugging tasks involving failing tests, compiler errors, runtime exceptions, dependency issues, environment breakage, or performance regressions. Use when historical root causes, fixes, or pitfalls may accelerate diagnosis before proposing a fix.

ZengLiangYi/ChatCrystal · 54 tokens

memory-tools

Use EverMe memory proactively when the user refers to previous conversations, earlier decisions, "last time", "remember when", existing project conventions, or previously solved errors, and save durable user preferences, habits, and decisions the moment they are stated. Do not repeat a search when a non-empty block…

EverMind-AI/EverMe · 71 tokens

workspace

Scaffold and manage the stateless AI workspace — context, packs, repos, and knowledge for multi-repo orchestration.

ulises-jeremias/agent-toolkit · 27 tokens