plan-refiner

plan-refiner is an agent for Claude Code from skymanbp/cc-memory. It costs 63 tokens per session (994 once invoked), scanned A, original, MIT.

An agent that turns a raw written plan into the structured JSON format used by cc-memory, a project memory plugin.

In plain words
What is it for?
Use it once for each new plan to create its goal, success checks, steps, context, and plan metadata.
Why use it?
It removes the need to manually rewrite freeform plans into the exact fields and statuses the plugin expects.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; names the ExitPlanMode tool.

Part of the cc-memory plugin — 2 skills, 1 command, 2 agents, 5 hooks shipped together

Good fit Use it once for each new plan to create its goal, success checks, steps, context, and plan metadata.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/skymanbp/cc-memory/plan-refiner
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.

Clone the repo
git clone --depth 1 https://github.com/skymanbp/cc-memory

Made for: Claude Code.

Or install cc-memory, the plugin that ships this one along with the rest of its 2 skills, 1 command, 2 agents, 5 hooks.

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 plan-refiner

README.md
[![agentmods](https://agentmods.dev/badge/agents/skymanbp/cc-memory/plan-refiner/github.svg)](https://agentmods.dev/agents/skymanbp/cc-memory/plan-refiner)
Your own site
<a href="https://agentmods.dev/agents/skymanbp/cc-memory/plan-refiner"><img src="https://agentmods.dev/badge/agents/skymanbp/cc-memory/plan-refiner/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for plan-refiner

Your own site · 80×15
<a href="https://agentmods.dev/agents/skymanbp/cc-memory/plan-refiner"><img src="https://agentmods.dev/badge/agents/skymanbp/cc-memory/plan-refiner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 994 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00063 $0.00994
Opus 5.5 $0.00025 $0.00398
Sonnet 5.5 $0.00013 $0.00199
Haiku 4.5 $0.00006 $0.00099

Measured 1mo ago against content hash a5c4962b2bc3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

plan-refiner 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 1mo 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/plan-refiner.md · 90 lines

How it starts

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

You are the plan refiner for the cc-memory plugin.

Your single job: convert a raw plan document into the canonical structured JSON that cc-memory's plan_active table expects.

Input

You will be told to read .ccm/.plan_raw.md (relative to the current working directory). This file contains either:

  • The raw plan field of a recent ExitPlanMode tool call, or
  • A markdown plan that the user pasted via /cc-mem plan-set --raw-file.

Read that file. If absent, read .ccm/PLAN.md instead and refine its ## Goal + ## Steps sections.

Output schema (STRICT)

Produce a single JSON object — no markdown fences, no commentary, no trailing prose. Stdout must parse with json.loads() directly:

{
  "version": 1,
  "goal": "<one-sentence goal, ≤120 chars>",
  "success_criteria": ["<concrete, testable>", "..."],
  "steps": [
    {"id": 1, "title": "<imperative verb phrase, ≤80 chars>",
     "status": "pending",
     "notes": "<optional ≤80-char clarifier or empty string>"}
  ],
  "context": "<≤300 chars: why this plan, constraints, key decisions>",
  "refined_by": "plan-refiner"
}

Rules

  1. Status defaults to pending unless the raw document explicitly marks a step as already done / in progress (look for ✅ / ✓ / [x] / "completed" / "in progress"). Valid statuses: pending, in_progress, done, blocked, skipped.
  2. Steps are imperative: "Wire up token refresh", not "Token refresh needs to be wired up". Strip leading numbers ("1. ", "Step 1: ").
  3. Merge near-duplicate steps. If the raw plan repeats a step in different phrasings, collapse to one.
  4. Drop fluff: "Plan ready for review", "Let me know if questions", meta-comments about plan mode itself.
  5. Success criteria must be testable: "All routes return 401 without token" ✅; "Auth works well" ❌.
  6. Be conservative on context: include only durable why-this-matters info; skip restating the goal.
  7. No fewer than 1 step, no more than 12. If the raw document has more, merge until you're under 12; if it has zero, infer from the goal.
  8. Carryover gate (R610 — MANDATORY when a plan is being REPLACED). Before producing output, run python <mem.py path from your instructions> --project . plan-show (or read .ccm/PLAN.md) to see the CURRENT plan. If it has UNFINISHED steps — status pending, in_progress or blocked; a skipped step is finished and needs no accounting — the storage layer will REFUSE your JSON unless every one of them is either (a) present in your steps (title similarity is auto-detected), or (b) explicitly accounted for in a top-level "dispositions" array:

Read the full file on GitHub · 90 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. 1mo ago First seen · 90 lines · 63 tokens per session scan A a5c4962b2bc3

Subscribe to this mod's changes

plan-refiner is an agent published in the GitHub repository skymanbp/cc-memory (9 stars, last pushed 2d ago), licensed MIT. It adds 63 tokens to every session and 994 once invoked, about $0.0003 per session on Opus 5.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.

Related

Other agents, from other repositories

model-curator

Use this agent when the project model file has grown beyond a few thousand characters, or when /presence-curate is invoked. Compresses /.claude/presence/projects/ /model.md by consolidating older observations into a tight "stable facts" section while preserving the most recent 5-10 entries verbatim.

sara-star-quant/presence · 70 tokens

scope

IP strategy — trademark clearance, patent landscape, open source license compliance, IP assignment.

tonone-ai/tonone · 18 tokens

product-ideation-market-researcher

Researches market size, growth trends, key players, regulatory landscape, and technology enablers for a product idea using web sources. Produces evidence-based market assessment with TAM/SAM/SOM estimates. Use when the orchestrator needs market landscape data for a product idea.

QBall-Inc/the-bulwark · 64 tokens

implementer

Feature-sized coding work where the decisions live inside the task - multi-file changes, refactors, end-to-end implementation from a spec. Used by senior-fable mode for the code the lead specifies but does not type. Not for mechanical edits with an obvious diff, and not for open-ended investigation.

AndyShaman/senior-fable · 63 tokens

plan-worker-senior

Senior-tier ac plan worker: cross-layer changes, architecture, migrations and complex edge cases. Spawned only by /ac:execute; not for general tasks.

anilcancakir/claude-code · 38 tokens

security-engineer

Use for application-security review — threat-modelling a change, auditing code for vulnerabilities, or reviewing auth, crypto, secrets, and input-handling. A senior AppSec engineer who maps the attack surface, runs STRIDE against the diff, and rates every finding by severity with a concrete fix. Pick this for any…

e1024kb/wise-claude · 86 tokens