Claude Code Prompts

Note: This post is outdated. It was written before slash commands, skills, custom agents, etc, existed. Still good for reference material when writing prompts.

On this page, I will create a collection of reusable prompts for Claude Code that I found helpful and worth saving. You may find some of these helpful in your workflow too.

For best results, start a new chat or use the /clear or /compact command before using one of these prompts.

1. Full Codebase Audit Prompt (Plan Mode)

Are there redundant, deprecated, or legacy methods that remain in this codebase? Is there duplication or scattered logic? Is there confusion, mismatches, or misconfiguration? Overengineering, dead code, or unnecessary features? Is the system completely streamlined and elegant, with clear separation of concerns, and no security vulnerabilities? Audit DEEPLY and provide a clear, actionable response, and a highly specific plan to resolve any issues you discover. Do not guess or make assumptions. Review the codebase directly. Keep the big picture in mind always, tracking how files interact and the overall structure of the system. You will need supporting evidence and data flow from the codebase to approve the plan and move forward. If the intended functionality is muddy or difficult to understand, STOP, ask the user to clarify. The intended functionality must be CRYSTAL CLEAR.

The STOP line is helpful to avoid wasting credits if the model chooses the wrong thread to pull or gets confused. Providing instructions about expectations helps the model retain focus.

2. New Feature Prompt (Plan Mode)

We would like to add [FEATURE] to this system. This feature should [DESCRIBE]. It must align with our existing system of [EXPLAIN]. Create a detailed implementation plan that outlines each file that must be touched, and specific changes that must be made. We are looking for a clean, seamless implementation strategy. You must conduct thorough research during this planning phase. Your plan should not contain any analysis or code review. I expect analysis and code review to be completed by the time you present your plan. Prepare a detailed action plan for my review. Together we will finalize and refine the plan for execution.

This prompt provides a solid framework for adding new features to a codebase. It provides guardrails for the model and forces them to research. The detailed research step ensures that updates are made without unintended consequences. Read the provided plan carefully. If you disagree, push back, and ask for refinement.

3. Specific Feature Audit Prompt (Plan Mode)

Audit the [FEATURE] system for completeness, security standards, and correct wiring, specifically related to [REQUIREMENT]. Identify dead or redundant code, scattered or overly complex logic, and areas where things can be simplified but maintain functionality. Also note gaps in implementation or incomplete refactors, loose ends, and sources of confusion. Present a focused audit with a step-by-step action plan that outlines the current implementation, discovered errors, opportunities for improvement, and potential for optimization. Prepare to enhance, debug, or refactor the system as needed according to user feedback in order to ensure a robust and reliable operation that is flexible, extensible, easy to maintain, and crafted with precision.

This is useful when you have one specific feature that needs a close review and cleanup. Explaining both the feature and the requirement, followed by the audit instructions, causes the model to spend time considering and truly reviewing the system.

← Back to Blog