A Hacker News thread titled "Ask HN: What are your best Claude hacks?" collected 13 comments on effective prompting patterns for Anthropic's Claude models.
The discussion surfaced repeated techniques around structured output, context management, and iterative refinement rather than one-off prompts.
What the Thread Revealed
Commenters described Claude's strength in following explicit formatting instructions when prompts use XML-style tags or numbered sections. Multiple users noted that wrapping instructions in <thinking> and <output> blocks reduced hallucinated steps compared to plain prose prompts.
The thread also highlighted Claude's willingness to maintain long context across multi-turn refinements, provided the initial prompt states a clear role and output schema.
Concrete Techniques Reported
- Prefix the system message with "You are a senior engineer reviewing code for correctness and security" to shift Claude toward concise, evidence-based replies.
- Require step-by-step reasoning inside
<thinking>tags before any final answer. - Ask Claude to generate both the solution and a one-paragraph critique of its own solution in the same response.
- Use a "revision pass" instruction: after the first answer, reply with "Identify the weakest assumption and revise."
How to Try These Hacks
Start at claude.ai or the Anthropic API. Paste the following template and replace the bracketed sections:
You are [role].
<thinking>Break the request into sub-tasks.</thinking>
<output>Deliver only the requested format.</output>
Run the same query twice—once with tags and once without—to measure differences in structure and length.
Comparison with Other Models
| Technique | Claude 3.5 Sonnet | GPT-4o | Gemini 1.5 Pro |
|---|---|---|---|
| XML tag adherence | High | Medium | Low |
| Long context coherence | 180k+ tokens | 128k | 1M+ |
| Self-critique quality | Strong | Medium | Medium |
| Speed on 4k prompts | ~2.1s | ~1.8s | ~2.4s |
Claude currently leads in strict formatting compliance, while Gemini handles larger context windows at the cost of tag precision.
Who Benefits Most
Developers building internal tools that require consistent JSON or Markdown output gain immediate value. Researchers running multi-step reasoning chains also see gains. Teams needing sub-second latency or heavy image analysis should evaluate GPT-4o or Gemini first.
Trade-offs Observed
The same thread noted that heavy use of tags can make prompts longer and occasionally trigger refusals on borderline topics. Some users reported Claude becoming overly verbose when asked for both thinking and output in one pass.
Bottom line: The HN discussion shows Claude responds reliably to explicit structural constraints that other models still ignore.
Early testers report the largest gains appear in code review and technical writing workflows rather than creative tasks.
"Additional context from the thread"
Commenters linked to Anthropic's own prompting guide and noted that the XML patterns discussed predate the current model release but remain effective.
The patterns remain useful as long as Claude's context window and instruction-following behavior stay stable.

Top comments (0)