Claude Prompt Library

Claude Code Prompts for Agentic Coding

21 copy-paste prompts

21 prompts for Anthropic's Claude Code CLI. Plan before you build, set up CLAUDE.md memory, implement features, fix tests, and handle git and PRs, all from the terminal.

In short: This page contains 21 copy-paste ready prompts, organized into 5 categories with a description and pro tip for each. The first 15 prompts are free instantly โ€” no signup needed. Hand-curated and tested by the AI Academy team.

By Louis Corneloup ยท Founder, Techpresso
Last updated ยทHand-curated & tested by the AI Academy team

Planning & Exploration

4 prompts

Explore Before Coding

1/21

Don't write any code yet. Explore this codebase and explain how [feature/area] currently works: which files are involved, how data flows, and the key entry points. Read the relevant files first, then summarize your understanding so I can confirm it before we make changes.

Has Claude Code build an accurate mental model of the code before touching anything, catching wrong assumptions early.

๐Ÿ’ก

Pro tip: Leading with 'don't write code yet' is the single highest-leverage habit, it forces exploration and prevents premature, misguided edits.

Make a Plan First

2/21

I want to add [feature]. Don't implement it yet. Make a step-by-step plan: the files you'll create or change, the order of changes, edge cases to handle, and where tests are needed. Show me the plan and wait for my approval before writing any code.

Produces a reviewable implementation plan so you can redirect before code is written.

๐Ÿ’ก

Pro tip: Reviewing a plan is far cheaper than reviewing a diff, fix the approach here and the implementation usually goes right the first time.

Think Through a Hard Problem

3/21

Before proposing a solution, think hard about how to [tricky task, e.g. migrate this data without downtime]. Lay out two or three approaches with their trade-offs, the risks of each, and your recommendation. Don't write code, I want to decide on the approach with you first.

Asks Claude Code to reason through options and trade-offs before committing to one path.

๐Ÿ’ก

Pro tip: Prompting it to weigh multiple approaches surfaces risks you would otherwise only discover halfway through the implementation.

Set Up CLAUDE.md Memory

4/21

Create or update a CLAUDE.md for this project. Include the key commands (build, test, lint, run), the architecture and where things live, our coding conventions, and any gotchas or rules a new contributor must know. Read the codebase to ground it in reality, and keep it concise and scannable.

Generates the project memory file Claude Code reads automatically, so future sessions start with full context.

๐Ÿ’ก

Pro tip: Keep CLAUDE.md tight and factual, every line is loaded as context each session, so bloat dilutes the signal that actually changes behavior.

XML tags are just the start. Learn the full Claude workflow.

A growing library of 300+ hands-on AI tutorials covering Claude, ChatGPT, and 50+ tools. New tutorials added every week.

Start 7-Day Free Trial

Implementing Features

4 prompts

Implement an Approved Plan

5/21

Implement the plan we agreed on for [feature]. Follow the conventions in CLAUDE.md, match the patterns in the existing files you read, and make the changes in logical steps. After each major step, briefly tell me what you did. Don't add new dependencies without asking.

Executes a previously approved plan in clear stages so you can follow along and intervene.

๐Ÿ’ก

Pro tip: Referencing the earlier plan keeps the implementation anchored, Claude Code won't drift into scope you didn't approve.

Build From an Existing Pattern

6/21

Add [new thing, e.g. a new API route] by following the pattern in [existing file]. Read that file first, then replicate its structure, validation, and error handling for the new case. Point out anywhere the new case genuinely needs to differ from the template.

Builds new code that mirrors a real example in the repo for consistency.

๐Ÿ’ก

Pro tip: Naming a concrete file to mimic beats describing the pattern, Claude Code copies an actual example more faithfully.

Implement Incrementally

7/21

Build [feature] in small, verifiable increments. Start with [smallest working piece], confirm it works, then add the next piece. After each increment, run the relevant tests or tell me how to verify it manually. Pause between increments so I can review.

Breaks a feature into checkpoints you can verify, instead of one big unreviewable change.

๐Ÿ’ก

Pro tip: Pausing between increments turns a risky large change into a series of small, easy-to-trust ones.

Use a Subagent for a Sub-Task

8/21

While we work on [main task], dispatch a subagent to independently [parallel sub-task, e.g. audit the codebase for all places that call the old API]. Have it report back a findings list. Keep our main thread focused on [main task] in the meantime.

Delegates a self-contained investigation to a subagent so the main thread stays focused.

๐Ÿ’ก

Pro tip: Subagents shine for broad searches and audits, offloading them keeps your main context clean and on-task.

Tests & Debugging

4 prompts

Write and Run Tests

9/21

Write tests for [feature/file] using our existing test framework and conventions. Cover the happy path, edge cases, and error handling. Run the tests yourself, fix any failures, and keep iterating until they pass. Then summarize what's covered and what you left out on purpose.

Generates tests and uses Claude Code's ability to run them and iterate until green.

๐Ÿ’ก

Pro tip: Let Claude Code run the test suite itself, the run-fail-fix loop in the terminal is where the agentic workflow pays off most.

Fix a Failing Test Suite

10/21

Run the test suite. For each failing test, investigate the actual cause before changing anything and tell me whether the test or the code is wrong. Fix the genuine issues, don't just make tests pass by weakening assertions, and re-run until everything is green.

Diagnoses real failures rather than papering over them by gutting the tests.

๐Ÿ’ก

Pro tip: Explicitly forbidding weakened assertions stops the agent from 'fixing' tests by deleting the checks that mattered.

Debug From an Error

11/21

I'm hitting this error: [paste error/stack trace]. It happens when [steps to reproduce]. Trace it to the root cause by reading the relevant files, explain what's actually going wrong, then apply the smallest fix. Add a regression test so it can't silently come back.

Drives a root-cause investigation and locks in the fix with a regression test.

๐Ÿ’ก

Pro tip: Asking for a regression test alongside the fix turns a one-off bug into a permanently guarded one.

Reproduce Before Fixing

12/21

Before fixing [reported bug], first write a failing test or a minimal script that reproduces it, and show me it actually fails for the right reason. Only once we've confirmed the reproduction should you implement the fix and prove the test now passes.

Confirms the bug is understood with a reproduction before any fix is attempted.

๐Ÿ’ก

Pro tip: A confirmed reproduction prevents the classic trap of 'fixing' a bug that was never actually the cause of the symptom.

These prompts give you the what. Tutorials give you the why.

Learn when to use extended thinking, how to build Claude Projects, and workflows that compound. 300+ tutorials and growing.

Try AI Academy Free

Refactoring & Codebase

5 prompts

Refactor Safely

13/21

Refactor [file/module] to improve clarity and reduce duplication without changing its behavior. First make sure there are tests covering it (write them if not), then refactor in small steps, running tests after each. Explain each change and flag anything that feels risky.

Performs a behavior-preserving refactor backed by tests at each step.

๐Ÿ’ก

Pro tip: Establishing test coverage before refactoring is non-negotiable, it's what lets you trust that nothing broke.

Answer Questions About the Code

14/21

Without changing anything, answer: where is [behavior, e.g. user authentication] implemented, what's the full path from [entry point] to [outcome], and which files would I touch to change [something]? Read the code to answer accurately and cite the specific files and functions.

Uses Claude Code as a fast, grounded way to understand an unfamiliar codebase.

๐Ÿ’ก

Pro tip: Asking it to cite specific files and functions keeps the answer verifiable instead of a plausible-sounding guess.

Find and Remove Dead Code

15/21

Search the codebase for unused code: exports nobody imports, functions never called, and dead branches. List what you find with its location and why you believe it's unused. Don't delete anything yet, I'll review the list and tell you what to remove.

Audits for dead code and presents findings for review before any deletion.

๐Ÿ’ก

Pro tip: Always review the dead-code list yourself, 'unused' can hide dynamic references or public API the tool can't see.

Create a Custom Slash Command

16/21

Create a custom slash command for our repeated workflow: [describe it, e.g. run lint, type-check, and tests, then summarize failures]. Put it in .claude/commands as a reusable prompt with any needed arguments, and tell me how to invoke it.

Turns a routine multi-step workflow into a reusable slash command for the whole team.

๐Ÿ’ก

Pro tip: Project slash commands live in .claude/commands and are shared via git, encode your common chores once and everyone benefits.

Onboard to an Unfamiliar Repo

17/21

I just cloned this repo and don't know it yet. Give me an orientation: what the project does, the main directories and their purpose, how to run it locally, where the core logic lives, and the two or three files I should read first to understand it. Read the code to answer, don't guess.

Produces a fast, grounded orientation to a codebase you've never seen before.

๐Ÿ’ก

Pro tip: Run this first in any new repo, then have it write the findings into CLAUDE.md so future sessions skip the rediscovery.

Git & Workflow

4 prompts

Commit With a Clear Message

18/21

Review the staged changes, then create a git commit with a clear, conventional message that explains what changed and why. Group unrelated changes into separate commits if needed. Show me the message before committing and don't push.

Produces clean, well-described commits and respects your control over pushing.

๐Ÿ’ก

Pro tip: Have it review the diff before writing the message, the result describes what actually changed rather than what you intended.

Open a Pull Request

19/21

Push the current branch and open a pull request. Write a PR description that summarizes the change, why it's needed, how it was tested, and any reviewer notes or risks. Base it on the actual diff, not assumptions, and share the PR URL when done.

Pushes the branch and drafts a thorough, diff-grounded PR description.

๐Ÿ’ก

Pro tip: Pointing it at the real diff for the PR body produces an accurate summary instead of a generic template.

Review a Diff Before Merging

20/21

Review the diff on this branch as a careful reviewer would. Flag bugs, missing edge cases, security concerns, and anything inconsistent with our conventions in CLAUDE.md. List issues by severity and don't fix them yet, just report so I can decide.

Gives a structured self-review of your changes before they reach a human reviewer.

๐Ÿ’ก

Pro tip: A pre-review pass against CLAUDE.md catches convention slips and obvious bugs before they waste a teammate's review time.

Resolve a Merge Conflict

21/21

I have merge conflicts after [merging/rebasing] [branch]. Walk through each conflicted file, explain what each side changed and why, and resolve it preserving the intent of both changes. Don't just pick one side blindly. After resolving, run the tests and confirm nothing broke.

Handles merge conflicts by understanding both sides' intent rather than discarding one arbitrarily.

๐Ÿ’ก

Pro tip: Asking it to explain each side before resolving stops the common mistake of silently dropping a teammate's change.

Frequently Asked Questions

Claude Code is Anthropic's agentic command-line coding tool. It runs in your terminal, reads and edits files, runs commands and tests, and works with git, all driven by natural-language prompts. It's designed for real software workflows: exploring a codebase, planning, implementing, testing, and shipping.
CLAUDE.md is a project memory file Claude Code reads automatically at the start of a session. It holds your key commands, architecture notes, conventions, and gotchas, so the agent starts every task with the right context. Keeping it concise and accurate is one of the biggest levers for good results.
Asking Claude Code to explore and produce a plan before writing code lets you catch wrong assumptions and redirect the approach while it's cheap. Reviewing a short plan is far faster than reviewing a large diff, and it dramatically reduces wasted, off-target implementation work.
Subagents let Claude Code delegate a self-contained task (like a codebase-wide audit) to a separate context so your main thread stays focused. Slash commands are reusable prompts stored in .claude/commands that encode repeated workflows, like a lint-test-summarize routine, and can be shared with your team via git.
Give it context and structure: maintain a tight CLAUDE.md, tell it to explore and plan before coding, work in small verifiable increments, and let it run tests and iterate. Be explicit about constraints (what not to touch, no weakened assertions) and keep control over commits and pushes.

Prompts are the starting line. Tutorials are the finish.

A growing library of 300+ hands-on tutorials on ChatGPT, Claude, Midjourney, and 50+ AI tools. New tutorials added every week.

7-day free trial. Cancel anytime.