Loading learning content…
Loading learning content…
Learn the anatomy of a Claude Code prompt and how to communicate tasks clearly.
Read through the lesson, mark it complete when the concept is clear, then move to the next lesson in the sequence or jump back to the module map.
Claude Code prompts are more like instructions to a senior engineer than chat messages. You don't need to explain what files to read — Claude will find them. Focus on the outcome, not the steps.
A strong prompt has three parts:
Example of a weak prompt:
"Fix the login"
Example of a strong prompt:
"The login form at
src/app/(auth)/login/page.tsxthrows a 401 on valid credentials when the email contains uppercase letters. Fix the comparison logic in the auth handler without changing the existing error message format."
The more specific your prompt, the more predictable the output. Vague prompts produce exploratory responses; specific prompts produce surgical changes.
If you don't know the file path, ask Claude first:
"Where is the user authentication logic? Read the relevant files and explain the flow."
Then follow up with a targeted edit request.
Don't try to accomplish everything in one prompt. Claude Code excels at incremental work:
Explain before edit: "Explain how the caching layer works, then propose a fix for the race condition."
Constrained edit: "Update the Button component to accept a loading prop. Don't change the existing prop interface."
Test-first: "Write a failing test for this edge case, then make it pass."