✦ Prompt Engineering Fundamentals
Claude responds best when prompts are clear, specific, and contextual.
Unlike search engines, Claude benefits from natural language that explains the
goal, not just the topic.
The STAR framework for prompts
- Situation — give Claude the context it needs.
- Task — state exactly what you want produced.
- Action constraints — specify format, length, tone, or style.
- Role — optionally assign a persona or expertise level.
Tip Good prompts front-load the most important instruction. Claude reads the whole prompt but weighs the beginning and end most heavily.
Example — before and after
// ✗ Vague
"Tell me about Python."
// ✓ Specific with STAR
"You are a senior Python developer reviewing a junior's code.
Explain the top 5 performance pitfalls in Python 3.12, with a
one-sentence fix for each. Use bullet points. Keep it under 300 words."
prompting
fundamentals
STAR
✦ System Prompts & Role Assignment
A system prompt (the first "system" message in the API, or the initial
instructions in Claude Code's CLAUDE.md) shapes Claude's entire
conversation persona, knowledge scope, and output style.
Best practices
- Define the role first: "You are an expert technical writer…"
- State what Claude should never do before what it should do.
- Include output format expectations (JSON, Markdown, plain text, etc.).
- Keep system prompts under ~2 000 tokens; longer prompts dilute focus.
Key insight Claude treats system prompt instructions as its operating
contract. Contradictions between system and user messages are resolved in
favour of the system prompt.
system-prompt
roles
API
✦ Claude Code — Daily Workflow Tips
Claude Code is Anthropic's official CLI/IDE assistant. The following patterns
improve its effectiveness in a coding workflow.
CLAUDE.md as a living document
Keep a CLAUDE.md in every project root. This file is automatically
loaded into every conversation, so it acts as a persistent system prompt.
Include: tech stack, build/test commands, naming conventions, and any
architectural decisions that Claude should always respect.
Parallel tool calls
Claude Code can call multiple tools simultaneously when they are independent.
Prefer asking for several things at once rather than one at a time —
e.g. "Read files A, B and C and tell me how they interact" is faster than
three sequential prompts.
Memory files
Use the persistent memory directory (~/.claude/projects/…/memory/)
to store cross-session context. Write a concise MEMORY.md with
stable project facts; keep it under 200 lines so it fits in context without
truncation.
Warning Never store secrets, tokens, or credentials in
CLAUDE.md or memory files — they are plain text and may be
version-controlled.
Useful slash commands
/help — list all built-in commands
/clear — reset conversation context
/fast — toggle faster (Opus 4.6) output mode
/commit — run the guided commit skill
claude-code
workflow
CLAUDE.md
memory
✦ Extended Thinking & Deep Reasoning
Claude's latest models support an extended thinking mode where the
model reasons step-by-step before producing its final answer. This significantly
improves accuracy on complex, multi-step problems.
When to enable it
- Multi-step maths or logic problems
- Architecture decisions with many trade-offs
- Debugging subtle, hard-to-reproduce issues
- Writing that requires extensive planning (e.g. long-form documents)
How to trigger it in a prompt
// Ask Claude to think before answering
"Think through this carefully before responding.
Explain your reasoning step by step, then give your final answer."
Tip For Claude Code, prefix complex tasks with
"Think carefully before acting" — this activates deeper
planning before any file edits are made.
extended-thinking
reasoning
accuracy