Prompt Engineering & Structured Output

20% of the CCAR-F exam. Read each answer, then drill this domain.

Drill this domainAll study notes

What makes a prompt work well with Claude?

Be explicit about the task and the output, give context and the reason behind constraints, be specific about format and limits, and show a few varied examples. Use tags to separate instructions from content, and give Claude a way to say it doesn't know.

Source: Anthropic: Best practices for prompt engineering

How do you get reliable structured output?

Use structured outputs: JSON outputs for the response format and strict tool use for tool inputs, both enforced by constrained decoding. Check for refusals and truncation, and still validate business rules, because a schema-valid answer can be wrong. Retry with the specific error or send the case for review.

Source: Claude docs: Structured outputs

How do you cut cost and latency without losing quality?

Lay prompts out with stable content first so prompt caching hits, keep volatile values out of the prefix, use the Batches API for non-urgent volume, and pick smaller models for routine steps. Drop rituals and emphasis that make frontier models do extra work.

Source: Anthropic: Reducing cost and improving performance

When should Claude think before answering?

Use extended thinking for complex, multi-step reasoning such as comparing conflicting sources or planning. It costs more tokens and time, so simple, well-defined tasks usually don't need it.

Source: Claude docs: Extended thinking

How should prompts change when you move to a newer model?

Remove scaffolding written for older models: verification rituals, shouted emphasis, fixed reasoning templates and examples tuned to old mistakes. Resolve contradictory rules and update dated settings. Newer models follow instructions closely, so say plainly what you need.

Source: Anthropic: Reducing cost and improving performance

Drill this domain