compact

compact is a skill for Claude Code, Codex from catlog22/Claude-Code-Workflow. It costs 19 tokens per session (3,073 once invoked), scanned A, original, MIT.

Compact current session memory into structured text for session recovery. Supports custom descriptions and tagging.

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/catlog22/claude-code-workflow/memory-compact
Any agent
npx skills add catlog22/Claude-Code-Workflow --skill memory-compact
Clone the repo
git clone --depth 1 https://github.com/catlog22/Claude-Code-Workflow

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 compact

README.md
[![agentmods](https://agentmods.dev/badge/skills/catlog22/claude-code-workflow/memory-compact.svg)](https://agentmods.dev/skills/catlog22/claude-code-workflow/memory-compact)
Your own site
<a href="https://agentmods.dev/skills/catlog22/claude-code-workflow/memory-compact"><img src="https://agentmods.dev/badge/skills/catlog22/claude-code-workflow/memory-compact.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,073 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00019 $0.03073
Opus 5 $0.00010 $0.01537
Sonnet 5 $0.00004 $0.00615
Haiku 4.5 $0.00002 $0.00307

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

Security

Grade A, and why

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 today.

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.

.codex/skills/memory-compact/SKILL.md · 382 lines

How it starts

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

Memory Compact Command (/memory:compact)

1. Overview

The memory:compact command compresses current session working memory into structured text optimized for session recovery, extracts critical information, and saves it to persistent storage via MCP core_memory tool.

Core Philosophy:

  • Session Recovery First: Capture everything needed to resume work seamlessly
  • Minimize Re-exploration: Include file paths, decisions, and state to avoid redundant analysis
  • Preserve Train of Thought: Keep notes and hypotheses for complex debugging
  • Actionable State: Record last action result and known issues

2. Parameters

  • --description: Custom session description (optional)
    • Example: "completed core-memory module"
    • Example: "debugging JWT refresh - suspected memory leak"
  • --tags: Comma-separated tags for categorization (optional)
  • --force: Skip confirmation, save directly

3. Structured Output Format

## Session ID
[WFS-ID if workflow session active, otherwise (none)]

## Project Root
[Absolute path to project root, e.g., D:\Claude_dms3]

## Objective
[High-level goal - the "North Star" of this session]

## Execution Plan
[CRITICAL: Embed the LATEST plan in its COMPLETE and DETAILED form]

### Source: [workflow | todo | user-stated | inferred]

<details>
<summary>Full Execution Plan (Click to expand)</summary>

[PRESERVE COMPLETE PLAN VERBATIM - DO NOT SUMMARIZE]
- ALL phases, tasks, subtasks
- ALL file paths (absolute)
- ALL dependencies and prerequisites
- ALL acceptance criteria
- ALL status markers ([x] done, [ ] pending)
- ALL notes and context

Example:
## Phase 1: Setup
- [x] Initialize project structure
  - Created D:\Claude_dms3\src\core\index.ts
  - Added dependencies: lodash, zod
- [ ] Configure TypeScript
  - Update tsconfig.json for strict mode

## Phase 2: Implementation
- [ ] Implement core API
  - Target: D:\Claude_dms3\src\api\handler.ts
  - Dependencies: Phase 1 complete
  - Acceptance: All tests pass

</details>

## Working Files (Modified)
[Absolute paths to actively modified files]
- D:\Claude_dms3\src\file1.ts (role: main implementation)
- D:\Claude_dms3\tests\file1.test.ts (role: unit tests)

## Reference Files (Read-Only)
[Absolute paths to context files - NOT modified but essential for understanding]
- D:\Claude_dms3\.claude\CLAUDE.md (role: project instructions)
- D:\Claude_dms3\src\types\index.ts (role: type definitions)
- D:\Claude_dms3\package.json (role: dependencies)

## Last Action
[Last significant action and its result/status]

## Decisions
- [Decision]: [Reasoning]
- [Decision]: [Reasoning]

## Constraints
- [User-specified limitation or preference]

## Dependencies
- [Added/changed packages or environment requirements]

## Known Issues
- [Deferred bug or edge case]

## Changes Made
- [Completed modification]

## Pending
- [Next step] or (none)

## Notes
[Unstructured thoughts, hypotheses, debugging trails]

Read the full file on GitHub · 382 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. today First seen · 382 lines · 19 tokens per session scan A 4ea878a548bc

Subscribe to this mod's changes

compact is a skill published in the GitHub repository catlog22/Claude-Code-Workflow (2,133 stars, last pushed 2mo ago), licensed MIT. It adds 19 tokens to every session and 3,073 once invoked, about $0.0001 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-09-03.

Related

Other skills, from other repositories

alive:mine-for-context

Deep context extraction from source material. Creates reference bundles, builds extraction plans, tracks what's been extracted, and discovers new targets — people, subjects, patterns, connections. The archaeologist that turns raw sources into structured knowledge. Can be invoked by alive:session-history for targeted…

alivecontext/alive · 63 tokens

alive-capture

Capture external content into a walnut bundle -- emails, transcripts, screenshots, documents, research.

alivecontext/alive · 21 tokens

alive-health

Flag walnuts past their rhythm -- health check for the world.

alivecontext/alive · 14 tokens

onboarding

First-run setup for OneBrain : personalize identity, communication style, and vault configuration. Use only on first install or when the user wants to fully reconfigure OneBrain from scratch — manual only. Do NOT use for: teaching a single preference (use learn), updating system files (use update), or reviewing memory…

onebrain-ai/onebrain · 70 tokens

clone

Clone your agent's portable context (agent folder including MEMORY.md) to a folder for transfer to another vault. Use only when the user explicitly wants to migrate or copy agent memory to a new vault. Do NOT use for: backing up the whole vault, updating OneBrain (use update), or reviewing memory (use memory-review).

onebrain-ai/onebrain · 68 tokens

search

General vault retrieval — answers both "what" and "why" questions across MEMORY.md, memory/, session logs, project trackers, and vault notes. Uses the search tools (lex+vec+hyde) with grep fallback.

onebrain-ai/onebrain · 47 tokens