Claude Code Repo Recon and Implementation Plan for a New Feature

Has Claude Code inspect a repository read-only and produce an evidence-based implementation plan with file-level changes, tests, risks, and open questions. Use it to decide whether to start, split, or clarify a feature before any code is written.

You get: Job-to-be-done and decision supported, verified findings and proposed change plan

More like this

The prompt

claude-code-repo-recon-and-implementation-plan-for-a-new-feature.md
Role: You are a senior software engineer running inside Claude Code with read-only access for this phase. Your job is to plan, not implement.

Context: I need to decide whether {feature_request} can be built safely in the repository at {repo_path}, how large it is, and whether it should be split. Primary language and framework: {stack}. Project conventions may be in CLAUDE.md, README, CONTRIBUTING, or lint and CI config.

Task: Investigate the codebase and produce an implementation plan I can approve, reject, or send back for clarification.

Inputs:
- Feature request: {feature_request}
- Repo path: {repo_path}
- Stack: {stack}
- Constraints (deadline, compatibility, no new dependencies, etc.): {constraints}
- Definition of done from the requester: {definition_of_done}

Constraints:
- Do not edit, create, or delete files. Do not run commands that change state (no installs, migrations, or git commits).
- Use Read, Grep, and Glob to find evidence. Read-only shell commands such as git log, git status, and listing test commands are allowed.
- Cite file paths and line ranges for every claim about existing behavior. If you did not verify something, label it Unverified.
- Keep assumptions in a separate list from verified facts.
- If the request is ambiguous, ask at most 5 targeted questions at the end rather than guessing.

Workflow:
1. Read CLAUDE.md, README, and CI config to learn build, test, lint, and style conventions.
2. Locate the modules, entry points, data models, and existing tests related to the feature.
3. Identify the closest existing pattern in the codebase to reuse.
4. Draft the change list, ordered into small, independently verifiable steps.
5. Identify test strategy, migration or rollout concerns, and failure modes.
6. Estimate size (S, M, L) and recommend proceed, split, or clarify.

Output format:
1. Job-to-be-done and decision supported (2 sentences)
2. Verified findings (table: finding | file:line | relevance)
3. Assumptions (bulleted, separate from findings)
4. Proposed change plan (table: step | files | change | how to verify)
5. Test plan (unit, integration, manual) with exact commands if discoverable
6. Risks and missing information (table: risk | likelihood | impact | mitigation)
7. Recommendation: proceed, split, or clarify, with reasons
8. Next actions (max 5, imperative)

Acceptance criteria:
- Every step in the plan maps to at least one named file and one verification method.
- No file was modified during the run.
- Each finding has a file path; unverified items are labeled.
- The plan can be executed by a different engineer without extra context.

Quality checks:
- Re-scan the plan for steps that lack a verification method and fix them.
- Confirm no claim is based on a file you did not open.
- Confirm that open questions are not hidden inside assumptions.
- Confirm the recommendation is consistent with the size estimate and risks.

Tips and common edits

Run in Claude Code plan mode or with edit permissions denied. Add repo-specific rules to CLAUDE.md first for better results. After approving the plan, start a fresh session to implement one step at a time.

Questions about this prompt

Agent Session Handoff Brief with Resume Checklist and Verified State

Makes Claude Code produce a handoff file capturing goal, verified repo state, decisions, blockers, and exact resume commands so another engineer or agent session can continue without rework. Use it before ending a long task.

Characterization-Test-Backed Refactor with Incremental Commits

Guides Claude Code to refactor a module safely by first pinning current behavior with characterization tests, then making small, reversible commits. Helps you decide whether the refactor preserved behavior and is worth merging.

Pre-Merge Self-Review of a Git Diff: Correctness, Security, and Test Gaps

Has Claude Code review a branch diff like a skeptical maintainer, producing severity-ranked findings with evidence and a clear merge, fix, or block recommendation. Use it before opening or approving a pull request.

Reproduce-First Bug Fix: Failing Test, Minimal Patch, and Regression Proof

Directs Claude Code to reproduce a reported bug with a failing test, apply the smallest fix, and prove the fix with command output. Use it to decide whether a bug is fixed and safe to merge.

Claude Code Plan-Then-Implement a Feature With Approval Checkpoints

Makes Claude Code explore the repo, write a step-by-step plan for your approval, then build the feature in small verified steps, stopping at each checkpoint for your go-ahead.

Interview Me Then Plan: Requirements Interview Before Any Code

Claude Code questions you about a feature's requirements and edge cases, then delivers an implementation plan with acceptance criteria and test commands, without writing code first.

Agent Run Post-Mortem: Trace Root Cause and Prompt or Tool Fixes

Analyzes a pasted agent trace to find the first real failure and proposes exact prompt rewrites or tool changes, each with a test.

Characterization Tests Before a Refactor

Writes tests that lock in a module's current behavior, including edge cases and quirks, so you can refactor safely.

Checkpoint and Rollback Manager with Compensation Steps and Failure Injection Tests

Guides Claude Code to implement checkpoint snapshots, rollback modes, and compensating actions for side-effecting agent phases, then prove them with failure-injection tests. Helps you decide the rollback strategy per phase.

Claude Code Behavior-Preserving Refactor with Characterization Tests and Staged Commits

Guides Claude Code to refactor a module safely by first pinning current behavior with characterization tests, then applying small reversible steps with verification after each. Delivers a diff, risk register, and rollback plan.

Claude Code Feature Implementation Plan and Build from a Ticket with Repo Convention Discovery

Has Claude Code investigate how similar features are built in the repository, produce an implementation plan with acceptance tests, then implement it in verified increments. Surfaces risks, open questions, and next actions before and after coding.

Claude Code Hook Writer: Auto-Run Lint, Typecheck or Tests After Edits

Produces a PostToolUse hook entry for settings.json, the script it calls and a concrete procedure to test that the check runs after file edits.