Claude Code Prompts Reference
A comprehensive collection of effective prompts for Claude Code, organized by task type.
File Operations
Reading Files
"Read the package.json file"
"Show me what's in src/index.ts"
"Look at that screenshot at /path/to/image.png"
"Read lines 50-100 of src/app.js"
"What's in the config directory?"
"Show me the main entry point"
Creating Files
"Create a new file called utils.js with a helper function"
"Write a Dockerfile for this project"
"Create a .gitignore file with Node.js defaults"
"Make a new React component called Button"
"Create a test file for the UserService"
Editing Files
"Add a new import at the top of this file"
"Fix the typo on line 42"
"Replace the old function with this new implementation"
"Add error handling to this function"
"Remove the deprecated code"
"Rename the variable from 'data' to 'userData'"
Code Search
Finding Files
"Find all TypeScript files"
"What test files exist?"
"Show me all files named config"
"List all React components"
"Find package.json files in the project"
"Where are the migration files?"
Searching Code
"Search for 'TODO' in the codebase"
"Find where UserService is imported"
"Look for uses of deprecated API"
"Find all console.log statements"
"Search for functions that call the database"
"Where is 'handleSubmit' defined?"
"Find all API endpoints"
Code Understanding
Exploration
"Explain how authentication works in this codebase"
"What does this function do?"
"How is state managed in this app?"
"Walk me through the request flow"
"What's the architecture of this project?"
"How are errors handled?"
Analysis
"Are there any security issues in this file?"
"What dependencies does this project use?"
"Find potential bugs in this function"
"What's the test coverage like?"
"Are there any circular dependencies?"
Development Tasks
Running Commands
"Run the tests"
"Install the dependencies"
"Build the project"
"Start the dev server"
"Check git status"
"Run the linter"
"Format the code"
Background Tasks
"Start the dev server in the background"
"Run the build in the background"
"Watch for file changes in the background"
Git Operations
"What changed since last commit?"
"Show me the git history"
"Create a commit with these changes"
"What branch am I on?"
"Show the diff for staged files"
"Create a new branch called feature/auth"
Feature Implementation
Planning
"Help me plan how to add user authentication"
"What's the best approach for caching here?"
"How should I structure this new feature?"
"Plan the database schema for this feature"
Implementation
"Add a logout button to the header"
"Implement pagination for this list"
"Add form validation to the signup form"
"Create an API endpoint for user profiles"
"Add dark mode support"
"Implement the search functionality"
Refactoring
"Refactor this to use async/await"
"Extract this logic into a separate function"
"Convert this class to a functional component"
"Split this file into smaller modules"
"Simplify this complex function"
Debugging
Understanding Errors
"Why am I getting this error?"
"Debug this failing test"
"What's causing the memory leak?"
"Why isn't this component rendering?"
"Help me understand this stack trace"
Fixing Issues
"Fix the failing tests"
"Fix the TypeScript errors"
"Resolve the merge conflict"
"Fix the broken import"
"Handle the null pointer exception"
Documentation
Code Documentation
"Add JSDoc comments to this function"
"Document this API endpoint"
"Create a README for this module"
"Add inline comments explaining this algorithm"
Project Documentation
"Create a CONTRIBUTING.md file"
"Document the setup process"
"Write API documentation"
"Create architecture documentation"
Research & Learning
Web Search
"Search for how to configure ESLint for TypeScript"
"Look up the latest React 19 features"
"Find documentation for this library"
"What are best practices for X?"
Reading Documentation
"Read the documentation at [URL]"
"What does this GitHub issue say?"
"Summarize the article at [URL]"
"Check the API docs for this endpoint"
Multi-Step Tasks
Complex Operations
"Set up a new Express API with TypeScript, tests, and linting"
"Migrate this codebase from JavaScript to TypeScript"
"Add comprehensive error handling throughout the app"
"Implement a complete CRUD API for products"
Investigation
"Find all places where we're not handling errors properly"
"Audit the codebase for security issues"
"Find all deprecated API usages"
"Identify performance bottlenecks"
Prompt Patterns
Be Specific
# Good
"Add a validation check for email format in the signup form at src/components/SignupForm.tsx"
# Less Good
"Add validation"
Provide Context
# Good
"The tests are failing because of the recent auth changes. Fix the tests in auth.test.ts"
# Less Good
"Fix the tests"
State Your Goal
# Good
"I want to add rate limiting to prevent abuse. Add rate limiting middleware to the Express app"
# Less Good
"Add rate limiting"
Ask for Explanation
"Explain your changes after implementing"
"Walk me through what you changed and why"
"Show me the key parts of the implementation"
Power User Prompts
Session Control
"Use the Explore agent to investigate the caching system"
"Run these three commands in parallel"
"Create a plan before implementing"
"Break this into smaller tasks"
Quality Checks
"After implementing, run the tests"
"Check for TypeScript errors after changes"
"Verify the build still works"
"Make sure the linter passes"
Iteration
"That's close, but also handle the edge case where X is null"
"Good, now add tests for this"
"Refactor to make it more readable"
"Add error handling to what you just wrote"