plan — Claude Code rule: plan with docs and tasks context
Makes the agent read your docs, task notes and source before planning, ask clarifying questions, and only then propose a solution.
no license ★ 1,054 updated 2025-07-17
.cursor/rules/plan.mdcWhat plan does
The rule covers planning and architecture work. Before the agent proposes anything it reads docs/architecture.md, docs/product_requirement_docs.md, docs/technical.md, then tasks/active_context.md and tasks/tasks_plan.md, and after that the code under src.
A fixed cycle follows. The agent keeps asking about unclear requirements, splits the problem into sub-problems, weighs candidate approaches against stated trade-offs, and iterates until one solution holds up. Web lookups go through an MCP server named perplexity-mcp with its search tool, invoked via use_mcp_tool. The resulting plan has to name its assumptions and cover failure cases.
When the work is done, the rule asks for the plan to be written back into the same docs/ and tasks/ files. Those exact names matter: point it at a repo with no docs/ and tasks/ folders and the agent chases paths that are not there, so create the files first, empty ones will do. Cline users place the same text at .clinerules/plan.md.
What it helps with
- get requirements clarified before any code changes
- bring existing architecture notes into a planning session
- split a large task into sub-problems with selection criteria
- keep the plan in
tasks/next to the active context - record assumptions and failure cases before implementation
Example prompts for the agent
- Read
docs/architecture.mdandtasks/tasks_plan.md, then draft a plan following theplanrule. - Plan the payments module rewrite and write the result into
tasks/active_context.md. - Ask me about anything unclear in the requirements, then propose a solution with its trade-offs.
How to install plan
Manually: put the files in place
.cursor/rules/plan.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/plan.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/plan.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/plan.mdManually: put the files in place
.clinerules/plan.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about plan
How do I install the plan rule in Claude Code?
Create .claude/rules/plan.md in your project and copy the rule text from the Bhartendu-Kumar/rules_template repository into it.
What does the plan rule do?
It sets the order of work for planning: repository docs and task files first, then clarifying questions, option comparison and validation. At the end the plan goes back into docs/ and tasks/.
Which files does the rule expect in the repo?
docs/architecture.md, docs/product_requirement_docs.md, docs/technical.md, plus tasks/active_context.md and tasks/tasks_plan.md. Without them the agent follows paths that do not exist.