cc-mem

A command-line front end for querying and managing cc-memory, a plugin that stores project memories and work state.

In plain words
What is it for?
Use it to check health and statistics, search or list memories, add a memory, inspect topics and sessions, view pending observations, and print schemas or file paths.
Why use it?
It gathers common project-memory tasks in one command instead of requiring direct database or file operations.

Command

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 commands/skymanbp/cc-memory/cc-mem
Clone the repo
git clone --depth 1 https://github.com/skymanbp/cc-memory
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,783 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 $0.00049 $0.02783
Opus 5 $0.00024 $0.01392
Sonnet 5 $0.00010 $0.00557
Haiku 4.5 $0.00005 $0.00278

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

Security

Grade A, and why

cc-mem 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 2d 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.

commands/cc-mem.md · 134 lines

How it starts

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

/cc-mem — cc-memory CLI front-end

Run cc-memory CLI commands against the current project. The wrapper resolves --project . for you.

Subcommands

Every subcommand cc_memory/cli/mem.py defines is listed here, and tests/smoke_test.py fails if one is missing — an undocumented subcommand is one nobody uses, and sql's read-only guard is a security fix that only helps someone who knows the command exists.

Subcommand Effect
stats Database statistics + supersede-chain count
status Full health check (hooks, DB, API key, PROGRESS state)
search <q> FTS5 search across memories
list [category] List memories (filter by decision/result/bug/...)
add <category> "<text>" Add one memory through the anti-patch writer
topics Show topic summaries
keywords Top project vocabulary by frequency
sessions Compaction history with archive paths
observations Raw PostToolUse rows still awaiting extraction
schema Print the live SQLite schema (tables, indexes, migrations)
paths [--json] Print the resolved project artifact paths — database, PROGRESS.md, PLAN.md, MEMORY.md — each with an exists/absent verdict. Read-only: an absent artifact is an answer, not an error. Exists because status reports counts with no locations, and hunting for the DB with an rglob found another project's file first
sql "<SELECT ...>" [--json|--full] Run a read-only query. Write statements are refused — only plain SELECT, WITH … SELECT, EXPLAIN and read-only PRAGMA run, and the PRAGMA name(value) setter form is refused too (an =-only test used to let it through). The default table truncates cells at 60 chars; --full prints untruncated column: value blocks, and --json emits pure-ASCII JSON (\uXXXX escapes), which no capturing shell's decode codec can garble — use it whenever CJK text comes back as
progress Force-regenerate .ccm/PROGRESS.md from DB and print it
supersedes <id> Walk the supersede chain for a memory ID (anti-patch history)
archive <id>... [--supersedes ID] Retire memories found to be WRONG: is_active=0, recoverable, never DELETE. The supported exit from "this stored fact is false" — sql is read-only and add reconciles only when the new text scores similar enough to the old. --supersedes records which memory replaced them, keeping the chain walkable. Refuses ids from another project (memories.id is global to the DB file)
consolidate [--deep] [--no-llm] Run the full LLM-backed consolidation pipeline, then stamp the cadence marker (so the Stop hook's backpressure probe doesn't re-run what you just ran). --deep first loops the semantic-dedup judge until a round confirms nothing new — the way to pay a months-old backlog down in one sitting; already-refused groups are never re-judged within the run
cleanup Lightweight no-LLM cleanup + MEMORY.md regen
summary Latest session summary (request/done/next_steps)
mode [name] Show/set project mode (code/research/writing)
serve [--port N] Launch the browser-based web viewer (stdlib http.server)
dashboard Launch the Tkinter GUI dashboard for this project
plan-status Live-plan counters + freshness summary (no LLM)
plan-show Regenerate + print .ccm/PLAN.md
plan-set --raw '<text>' Capture a raw plan, mark needs_refine=1
plan-set --raw-file FILE Same, but read raw from a file
plan-set --from-refiner Read structured JSON from stdin (refiner output)
plan-check Reset guardian counters + emit plan-guardian invocation hint
plan-replan Re-arm needs_refine on the current raw
plan-clear Drop the active plan + delete PLAN.md. Archived to .ccm/.plan_history/ first; --reason "<why>" is required when unfinished steps exist (refuses and exits 1 otherwise — v2.4.0 carryover gate)
directive-list [--status active|blocked|done|superseded|dropped|all] [--json|--full] Standing user directives, most-repeated first. A directive is a unit of user INTENT and outlives every plan; a plan step is a unit of execution and dies with its plan. Default filter is active; blocked rows show as [b]. --full lifts the per-field truncation, --json emits full rows as pure-ASCII JSON
directive-add <slug> [--quote "..."] [--demand "..."] [--kind standing|feature|process|oneoff|constraint] [--times N] Record a directive. Re-adding the same slug bumps times_stated on the ONE row rather than creating a second — repetition is the importance signal a plan cannot express. --times sets the count outright, for backfilling from a transcript audit. Reference plan steps by TITLE, never by number — step ids are re-assigned on every replacement, and the command warns when the text contains step #N / 步骤 N
directive-edit <slug> [--demand ...] [--quote ...] [--kind ...] [--status active|blocked] Correct a directive's record without bumping its count — an edit is maintenance, not a re-statement, and directive-list sorts by the count. Never creates (exits 1 on an unknown slug). --status blocked parks a directive that is waiting on the user — idle enforcement skips it — and --status active un-parks it; closure stays with directive-close, whose evidence gate this door must not bypass
directive-close <slug> --evidence "<checkable>" [--status done|superseded|dropped] Close a directive. --evidence is mandatory and refuses an empty value (exits 1): a commit sha, file:line, or a gate name. A directive closed on an assertion is the exact failure the ledger exists to prevent
inject-show Show exactly what the last SessionStart injected (ground truth)
inject-usage Deterministic signals: did Claude actually Read PROGRESS.md/MEMORY.md
encoding-check [--apply] Scan for U+FFFD corruption (read-only; --apply quarantines)

Read the full file on GitHub · 134 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. 2d ago First seen · 134 lines · 49 tokens per session scan A 7b7926a90d23

Subscribe to this mod's changes

cc-mem is a command published in the GitHub repository skymanbp/cc-memory (6 stars, last pushed 2d ago), licensed MIT. It adds 49 tokens to every session and 2,783 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-31.