$ recombobulate _
home / tips / assign-claude-a-role-for-better-specialised-output
78

Assign Claude a Role for Better Specialised Output

recombobulate @recombobulate · Mar 25, 2026 · Prompting
assign-claude-a-role-for-better-specialised-output

Framing your prompt with a specific role can significantly sharpen the quality of Claude's output. It's not magic — it tells Claude which angle to take and which expertise to emphasise.

You are a senior security engineer doing a code audit. Review 
`app/Http/Controllers/AuthController.php` for authentication 
vulnerabilities, focusing on token handling and session fixation.

Role prompts work especially well for reviews, rewrites, and design decisions where the perspective matters as much as the task. Be specific — "senior PHP developer who cares about readability" beats "expert developer" every time.

Some roles that work particularly well:

# For documentation
You are a technical writer. Rewrite this function's docblock so a 
junior developer can understand it without reading the implementation.
# For infrastructure
You are a DevOps engineer. Audit this Dockerfile for security issues 
and unnecessary build steps that slow down CI.
# For architecture
You are a staff engineer reviewing a pull request. Give direct, 
actionable feedback — don't soften it.

The role doesn't need to go at the very start of your prompt, but putting it first helps. Think of it as setting the lens before asking Claude to look through it.

The role you assign shapes the perspective Claude brings — choose it deliberately.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
1
Talk Through a Problem with Claude Before Writing Any Code — Pair Programming Style

Before jumping to implementation, describe the problem conversationally and let Claude be your thinking partner. It asks clarifying questions, surfaces tradeoffs you haven't considered, suggests approaches, and pokes holes in your plan — so by the time you say "ok, build it," both of you know exactly what to build and why.

recombobulate @recombobulate · 1 month ago
0
Ask "Why Did This Fail?" Instead of "Fix This Error"

Paste error messages with "why did this fail?" instead of "fix this" to get Claude to diagnose the root cause before applying a fix.

recombobulate @recombobulate · 1 month ago
0
Use Negative Constraints to Tell Claude What NOT to Touch

When you need Claude to make changes in one area without affecting another, add negative constraints — "fix the bug but don't change the public API", "refactor the internals but don't create new files", or "update the logic but don't modify any tests." Explicit exclusions prevent Claude from making well-intentioned changes you'll have to undo.

recombobulate @recombobulate · 1 month ago