- Prompt recipes for exploring code, fixing bugs, refactoring, testing, PRs, and documentation
- Resume previous conversations so a task can span multiple sittings
- Run parallel sessions with worktrees so concurrent edits don’t collide
- Plan before editing to review changes before they touch disk
- Delegate research to subagents to keep your main context clean
- Pipe Claude into scripts for CI and batch processing
Prompt recipes
These are prompt patterns for everyday tasks like exploring unfamiliar code, debugging, refactoring, writing tests, and creating PRs. Each works in any Claude Code surface; adapt the wording to your project.Understand new codebases
For configuring Claude Code in a monorepo or large codebase, see Monorepos and large repos.Get a quick codebase overview
Suppose you’ve just joined a new project and need to understand its structure quickly.Navigate to the project root directory
Start Claude Code
Ask for a high-level overview
Dive deeper into specific components
Find relevant code
Suppose you need to locate code related to a specific feature or functionality.Ask Claude to find relevant files
Get context on how components interact
Understand the execution flow
Fix bugs efficiently
Suppose you’ve encountered an error message and need to find and fix its source.Share the error with Claude
Ask for fix recommendations
Apply the fix
Refactor code
Suppose you need to update old code to use modern patterns and practices.Identify legacy code for refactoring
Get refactoring recommendations
Apply the changes safely
Verify the refactoring
Work with tests
Suppose you need to add tests for uncovered code.Identify untested code
Generate test scaffolding
Add meaningful test cases
Run and verify tests
Create pull requests
You can create pull requests by asking Claude directly (“create a pr for my changes”), or guide Claude through it step-by-step:Summarize your changes
Generate a pull request
Review and refine
gh pr create, the session is automatically linked to that PR. To return to it later, run claude --from-pr 123, replacing 123 with the PR number, or paste the PR URL into the /resume picker search.
Handle documentation
Suppose you need to add or update documentation for your code.Identify undocumented code
Generate documentation
Review and enhance
Verify documentation
Work in notes and non-code folders
Claude Code works in any directory. Run it inside a notes vault, a documentation folder, or any collection of markdown files to search, edit, and reorganize content the same way you would code. The.claude/ directory and CLAUDE.md sit alongside other tools’ config directories without conflict. Claude reads files fresh on each tool call, so it sees edits you make in another application the next time it reads that file.
Work with images
Suppose you need to work with images in your codebase, and you want Claude’s help analyzing image content.Add an image to the conversation
- Drag and drop an image into the Claude Code window
- Copy an image and paste it into the CLI with Ctrl+V. On macOS, Cmd+V also works in iTerm2.
- Provide an image path to Claude. E.g., “Analyze this image: /path/to/your/image.png”
Ask Claude to analyze the image
Use images for context
Get code suggestions from visual content
Reference files and directories
Use @ to quickly include files or directories without waiting for Claude to read them.Reference a single file
Reference a directory
Reference MCP resources
Run Claude on a schedule
Suppose you want Claude to handle a task automatically on a recurring basis, like reviewing open PRs every morning, auditing dependencies weekly, or checking for CI failures overnight. Pick a scheduling option based on where you want the task to run:Ask Claude about its capabilities
Claude has built-in access to its documentation and can answer questions about its own features and limitations.Example questions
/powerup for interactive lessons with animated demos, or refer to the specific workflow sections above.Resume previous conversations
When a task spans multiple sittings, pick up where you left off instead of re-explaining context. Claude Code saves every conversation locally.No conversation found to continue and exits. Use claude --resume to choose from a list, or /resume from inside a running session. See Manage sessions for naming, branching, and the full picker reference.
Run parallel sessions with worktrees
Work on a feature in one terminal while Claude fixes a bug in another, without the edits colliding. Each worktree is a separate checkout on its own branch..worktreeinclude, and non-git VCS support. To monitor parallel sessions from one screen instead of separate terminals, see background agents.
Plan before editing
For changes you want to review before they touch disk, switch to plan mode. Claude reads files and proposes a plan but makes no edits until you approve.Shift+Tab mid-session to toggle into plan mode. See Plan mode for the approval flow and editing the plan in your text editor.