plan

A planning command that restates a coding request, identifies risks and dependencies, and creates a step-by-step implementation plan. It requires the user to confirm the plan before any code is changed.

In plain words
What is it for?
It is for new features, major design changes, complex restructuring, multi-file work, and requests whose requirements are unclear.
Why use it?
It gives developers a chance to catch misunderstandings, missing requirements, and possible problems before implementation starts.

Command for Claude Code

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/cfrs2005/claude-init/plan
Clone the repo
git clone --depth 1 https://github.com/cfrs2005/claude-init

Made for: Claude Code.

Per session 25 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,033 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.00025 $0.01033
Opus 5 $0.00013 $0.00517
Sonnet 5 $0.00005 $0.00207
Haiku 4.5 $0.00003 $0.00103

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

Security

Grade A, and why

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

templates/.claude/commands/plan.md · 117 lines

How it starts

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

计划指令 (Plan Command)

此指令调用 规划师 (planner) 智能体,在编写任何代码之前创建一个全面的实施计划。

此指令的功能

  1. 重述需求 - 厘清需要构建什么
  2. 识别风险 - 暴露潜在问题和阻碍
  3. 制定分步计划 - 将实施过程分解为若干阶段
  4. 等待确认 - 在继续之前 必须 获得用户的批准

何时使用

在以下情况使用 /plan

  • 开始新功能开发时
  • 进行重大架构变更时
  • 处理复杂的重构工作时
  • 涉及多个文件/组件的变更时
  • 需求不明确或模棱两可时

工作原理

规划师智能体将:

  1. 分析请求 并用清晰的术语重述需求
  2. 分解阶段 为具体、可执行的步骤
  3. 识别依赖 组件之间的关系
  4. 评估风险 及潜在的阻碍因素
  5. 预估复杂度 (高/中/低)
  6. 展示计划等待 你的明确确认

使用示例

User: /plan I need to add real-time notifications when markets resolve
(用户:/plan 我需要在市场结算时添加实时通知)

Agent (planner):
# Implementation Plan: Real-Time Market Resolution Notifications
(实施计划:实时市场结算通知)

## Requirements Restatement (需求重述)
- Send notifications to users when markets they're watching resolve (当用户关注的市场结算时发送通知)
- Support multiple notification channels (in-app, email, webhook) (支持多种通知渠道:应用内、邮件、Webhook)
- Ensure notifications are delivered reliably (确保通知可靠送达)
- Include market outcome and user's position result (包含市场结果和用户持仓结果)

## Implementation Phases (实施阶段)

### Phase 1: Database Schema (阶段 1:数据库架构)
- Add notifications table with columns: id, user_id, market_id, type, status, created_at
- Add user_notification_preferences table for channel preferences
- Create indexes on user_id and market_id for performance

### Phase 2: Notification Service (阶段 2:通知服务)
- Create notification service in lib/notifications.ts
- Implement notification queue using BullMQ/Redis
- Add retry logic for failed deliveries
- Create notification templates

### Phase 3: Integration Points (阶段 3:集成点)
- Hook into market resolution logic (when status changes to "resolved")
- Query all users with positions in market
- Enqueue notifications for each user

### Phase 4: Frontend Components (阶段 4:前端组件)
- Create NotificationBell component in header
- Add NotificationList modal
- Implement real-time updates via Supabase subscriptions
- Add notification preferences page

## Dependencies (依赖)
- Redis (for queue)
- Email service (SendGrid/Resend)
- Supabase real-time subscriptions

## Risks (风险)
- HIGH: Email deliverability (SPF/DKIM required)
- MEDIUM: Performance with 1000+ users per market
- MEDIUM: Notification spam if markets resolve frequently
- LOW: Real-time subscription overhead

## Estimated Complexity: MEDIUM (预估复杂度:中等)
- Backend: 4-6 hours
- Frontend: 3-4 hours
- Testing: 2-3 hours
- Total: 9-13 hours

**WAITING FOR CONFIRMATION**: Proceed with this plan? (yes/no/modify)
(等待确认:是否按此计划进行?yes/no/modify)

Read the full file on GitHub · 117 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 · 117 lines · 25 tokens per session scan A a86a665986b4

Subscribe to this mod's changes

plan is a command published in the GitHub repository cfrs2005/claude-init (1,364 stars, last pushed 5mo ago), licensed MIT. It adds 25 tokens to every session and 1,033 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.