Specificity
beginnerDefinition
Being precise about exactly what you want. Instead of vague requests like 'fix the code,' a specific prompt names the file, function, and expected behavior. The more details you give, the less the AI has to guess.
In the wild
Vague: 'Make the login work.' Specific: 'In auth.js, update the login function to return an error message when the password is shorter than 8 characters.' The specific version gives Claude everything it needs in one shot.
More from Prompt Engineering Basics
Constraints
Boundaries you set on what the AI should or shouldn't do. Constraints prevent unwanted changes: like modifying files you didn't ask about, adding dependencies, or changing existing behavior.
Context Window
The amount of text an AI model can 'see' at once: your prompt, the conversation history, and any files it's reading. Think of it as the AI's working memory. If important information falls outside the window, the AI can't use it.
Decomposition
Breaking a complex request into smaller, manageable pieces. Instead of asking for an entire feature at once, you split it into steps that each build on the last. This produces more reliable results because each step is easier to verify.
Example-Driven Prompting
Showing the AI a concrete example of the input and output you expect, rather than only describing it in words. Examples remove ambiguity because the AI can pattern-match on what you showed, not just what you said.
Iteration
Refining your results through follow-up prompts. Your first prompt rarely produces a perfect result. Iteration means reviewing what you got, identifying what's off, and asking for targeted adjustments rather than starting over.
Output Format
Telling the AI exactly how you want the result structured. Without format guidance, the AI picks its own layout. Specifying the format, a function, a JSON object, a bullet list, a code block, means less cleanup afterward.