Back to Library
PromptingBeginner
Specify Output Format Explicitly
Tell Claude exactly what structure you want: JSON, Markdown, TypeScript types, numbered lists—avoid post-processing by baking format into the prompt.
jsonformatstructured-output
The Strategy
Unspecified output formats force you to write parsing code. Explicit format instructions mean Claude's output slots directly into your application or workflow.
prompt.txt
<task>
Extract all action items from the meeting notes below.
</task>
<notes>
[Paste notes here]
</notes>
<output_format>
Return a JSON array. Each item must have:
- "owner": string (name of the person responsible)
- "action": string (what they need to do)
- "due": string (due date, or "unspecified")
- "priority": "high" | "medium" | "low"
Return ONLY the JSON array—no markdown fences, no explanation.
</output_format>You might also need
PromptingBeginner
Use XML Tags for Structure
Claude is specifically trained to recognize and parse XML tags to separate instructions from content. Wrapping your prompt in named sections removes ambiguity.
xmlstructureclarity
View snippet
PromptingBeginner
Use Negative Constraints
Tell Claude what NOT to do. "Do not add comments", "Do not use any external libraries" — negative constraints are just as powerful as positive ones.
constraintsguardrailsfocused-output
View snippet