plan-refine

plan-refine is a command for Claude Code from primeline-ai/universal-planning-framework. It costs 16 tokens per session (1,667 once invoked), scanned A, original, MIT.

A command that tests and strengthens a multi-step project plan by examining it from six challenging viewpoints. It reads the plan, checks its structure, and records issues or improvements.

In plain words
What is it for?
Use it to review a software, infrastructure, research, business, content, or multi-agent plan. It can apply the review sequentially or, when configured, through multiple agents working in parallel.
Why use it?
It can reveal missing assumptions, weak dependencies, unclear responsibilities, and risks before work begins. It is intended for complex plans with at least several phases.

Command for Claude Code

Part of the universal-planning-framework plugin — 2 skills, 4 commands, 1 agent shipped together

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/primeline-ai/universal-planning-framework/plan-refine
Clone the repo
git clone --depth 1 https://github.com/primeline-ai/universal-planning-framework

Made for: Claude Code.

Or install universal-planning-framework, the plugin that ships this one along with the rest of its 2 skills, 4 commands, 1 agent.

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-refine

README.md
[![agentmods](https://agentmods.dev/badge/commands/primeline-ai/universal-planning-framework/plan-refine.svg)](https://agentmods.dev/commands/primeline-ai/universal-planning-framework/plan-refine)
Your own site
<a href="https://agentmods.dev/commands/primeline-ai/universal-planning-framework/plan-refine"><img src="https://agentmods.dev/badge/commands/primeline-ai/universal-planning-framework/plan-refine.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,667 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.00016 $0.01667
Opus 5 $0.00008 $0.00834
Sonnet 5 $0.00003 $0.00333
Haiku 4.5 $0.00002 $0.00167

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

Security

Grade A, and why

plan-refine 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 4d 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.

.claude/commands/plan-refine.md · 190 lines

How it starts

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

Autonomous Plan Hardening (Stage 1.5)

You are hardening this plan: $ARGUMENTS

Read the plan file and stress-test it from 6 adversarial perspectives. Fix what you can, flag what needs user input. Do NOT ask the user any questions - work autonomously.


Pre-Flight Checks

  1. Read the plan file using the Read tool
  2. Check idempotency: If a "Hardening Log" section already exists, inform the user and stop (plan already hardened)
  3. Count phases: If < 3 phases, inform the user that hardening is designed for complex plans and offer to proceed anyway
  4. Detect domain: Determine which of the 8 domains apply:
    • Software Development, Multi-Agent / AI System, Business / Strategy, Content / Marketing
    • Infrastructure / DevOps, Data & Analytics, Research / Exploration, Multi-Domain

Mode Selection

Simple mode (default): Single-agent, sequential. You role-switch through all 6 perspectives yourself.

Team mode (--team flag): Only when CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set:

  • Spawn 6 agents (one per perspective), each reads the ORIGINAL plan in parallel
  • Collect findings, deduplicate, resolve conflicts
  • Conservative fix wins. Pedantic Lawyer takes priority on gates.
  • Apply fixes, run consolidation check, append Hardening Log

If --team is in the arguments but the env var is not set, fall back to simple mode with a note.


6 Perspectives (Simple Mode - Sequential)

For each perspective, read the plan through that lens. Record findings and fixes.

Perspective 1: Outside Observer

"I'm reading this plan for the first time with no context."

  • Can I summarize the goal in 15 words or fewer?
  • Are success metrics unambiguous? Would two people measure them the same way?
  • Is there an End State paragraph? Can I picture what success looks like?
  • Are all abbreviations and jargon defined?
  • Does Context & Why explain WHY, not just WHAT?

Perspective 2: Pessimistic Risk Assessor

"Everything that can go wrong, will go wrong."

Read the full file on GitHub · 190 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. 4d ago First seen · 190 lines · 0 tokens per session scan A cbb092cb6508

Subscribe to this mod's changes

plan-refine is a command published in the GitHub repository primeline-ai/universal-planning-framework (45 stars, last pushed 10d ago), licensed MIT. It adds 16 tokens to every session and 1,667 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-08-30.