Direct answer
Separate a Claude Code brief into a goal, rules, examples, and context. Put the desired result in one place, constraints in another, representative behavior with the examples, and repository evidence with the context. A reader should not have to infer which sentence is a requirement and which sentence is only an illustration.
For example, a goal might be “add the issued date to the invoice export.” Rules might preserve current filters and money formatting. An example might show the new column beside existing columns. Repository evidence might name the export handler and its current output.
The separated format is a readability aid, not an enforcement mechanism. Official guidance supports descriptive XML-style labels and relevant examples, but labels do not force compliance. Keep the format proportional to the task, inspect the proposed interpretation, and check the resulting edit against the same separated blocks.
Why mixed instructions are hard to interpret
A single paragraph often blends several kinds of information. One sentence states the feature, the next protects a behavior, the third describes an example, and the fourth mentions a file. Compression saves space but hides the role of each statement.
That creates two interpretation problems. Claude Code may treat an example as a strict implementation rule, or treat a constraint as a suggestion. A human reviewer faces the same ambiguity when deciding whether the edit followed the brief.
Mixed wording also makes revision harder. When a rule changes, the author must search prose that looks similar throughout. When an example is wrong, it can be difficult to tell whether the goal was wrong too. Separate blocks give each kind of statement a clear home.
The cost is not merely stylistic. A rule buried after an example may be skipped during planning. A goal repeated in several forms may drift between versions. A context note may be mistaken for permission to redesign the surrounding module.
Official, F006: Claude Code best practices advises against relying on emphasis keywords such as IMPORTANT and favors plain instructions. Adding louder words to a mixed paragraph does not clarify its roles. Clear sentences and explicit boundaries do more useful work.
The Claude Code overengineering analysis provides the related scope warning. A heavily decorated brief can encourage a larger response without making the desired outcome more precise.
Evidence and its limits
Official, F004: Claude prompting best practices recommends consistent, descriptive XML-style tags to structure instructions and context. Tags such as <goal>, <rules>, and <examples> can make roles visible. They are an organizational technique, not an enforcement mechanism.
Official, F005: The same guidance recommends relevant, diverse examples to steer format, tone, and structure. That supports using examples when they clarify a boundary or output shape. The documented range is guidance, not a minimum number for every small task.
Official, F006: Claude Code best practices favors plain instructions over emphasis keywords. A rule should say what must remain true rather than rely on capital letters to imply importance.
Official, F018: Official prompting guidance suggests showing the prompt to a colleague with minimal task context as a clarity check. A fresh reader can reveal which role a sentence appears to play. This is a heuristic, not a validation benchmark.
No verified community report is used. The research register contains no measured comparison of tagged and untagged Claude Code prompts. The method below is an editorial workflow grounded in official guidance, with its limits stated.
State the goal in one outcome
The goal block should describe the result that justifies the task. Keep it separate from the method, the file list, and the evidence used to reach it.
A useful goal names the affected behavior and the intended change. “Add the issued date to the invoice export” is narrower than “improve reporting.” It still leaves room to investigate the current export path and choose an implementation.
If the goal contains several independent outcomes, split them or order them. A request to add a column, redesign the page, and change the billing schedule is not one goal. It is a small program of work with different risks and approval needs.
Avoid turning the goal into a command sequence. “Open the export file, add a property, update the template” may be a valid suggested method after investigation, but it is not the outcome. A method-first goal can hide a better route or make the brief brittle when the named file differs from the real entry point.
| Goal-block content | Useful wording | Problematic wording |
|---|---|---|
| Result | Export includes the issued date | Improve the export |
| Affected behavior | Existing invoice export gains a column | Touch reporting code |
| Completion target | Date appears with the current invoice fields | Make it production-ready |
| Non-goal pointer | Visual redesign is outside this goal | Modernize everything |
The Claude Code observable requirements guide goes deeper on actor, trigger, and evidence. Structure comes after that target is clear; headings cannot rescue an undefined goal.
Put boundaries in a separate block
Rules answer a different question: what must remain true while the goal is pursued? Put them in their own block so they can be reviewed independently.
Good rules are concrete and testable by inspection. “Preserve the current filter behavior” names a protected behavior. “Do not change money formatting” names an output constraint. “Do not add a scheduled export” excludes an adjacent feature.
A weak rule says “keep the change minimal” without defining the protected surface. Another weak rule says “follow best practices,” which delegates a product decision to general advice. Replace both with statements tied to the actual task.
Not every constraint is equally hard. A required interface field may be non-negotiable, while a preferred naming pattern may allow a justified exception. Labeling that difference helps the reviewer understand where judgment is permitted.
Rules block: Preserve current invoice filters and money formatting. Keep the existing export filename pattern. Do not add scheduling or change the page layout. If the issued date is unavailable for an invoice, show the existing blank-value convention and report that case in the plan.
The final sentence matters because it identifies a possible conflict without silently deciding policy. It asks the plan to expose the case before implementation.
Official, F007: Official prompting guidance calls for clear, explicit instructions and specific output formats, while F004 supplies the caveat that structure itself is not enforcement. Inspect the resulting edit rather than assuming the rules block controlled every choice.
Add examples that demonstrate the boundary
Examples belong with the brief, but not inside the goal as if they were additional objectives. Their job is to show what a rule means in a concrete situation.
An output example can clarify column order without prescribing the function that writes the file. A short before-and-after pair can show that existing fields remain. An exception example can reveal whether “unavailable date” has an agreed visible representation.
Keep the example set relevant. One normal case and one meaningful exception often teach more than a long catalogue of near-duplicates. F005 supports relevant, diverse examples, but it does not establish a universal count or complete functional coverage.
Use a label that says what the example demonstrates. “Example of unchanged money formatting” is more useful than “Example 1.” The reader should understand why the example exists.
Output example: Current fields are invoice number, customer, and total. The requested output keeps those fields in the same order and adds issued date after invoice number. The example does not require a particular CSV library or component structure.
This example exposes an interpretation question: does “add the issued date” mean a new first column or a date beside the invoice number? The goal alone did not settle that. The example does, provided the product owner agrees that column order matters.
The Claude Code acceptance examples guide covers selection in more depth. Here, the structural point is narrower: examples should be visibly separate from rules so a demonstration is not mistaken for an exhaustive requirement.
Separate context from instructions
Repository evidence supplies context. It can include file names, symbols, symptoms, relevant output, and constraints discovered in the codebase. Context should help Claude Code investigate, not smuggle in unapproved goals.
A context block might name the current export handler, the component that triggers it, and the existing test fixture that demonstrates output shape. Those pointers reduce search ambiguity. They do not prove that the named file is the only relevant location.
Official, F016: Claude Code best practices recommends precise prompts with file names and symptoms. A prompt can be specific and still point at the wrong location. Treat named files as starting evidence and leave room to follow call sites or shared helpers.
Context also includes what has already been ruled out. “The page already receives issued date in the current response” can prevent a redundant data-layer change. “A previous attempt changed the shared formatter and was rejected” can explain a protected boundary.
Do not paste the whole repository into the context block. Relevant evidence should earn its place by changing the interpretation or the proposed method. The Claude Code file reference guide explains how to add pointers without turning the brief into a data dump.
| Block | Question it answers | Typical content | Common failure |
|---|---|---|---|
| Goal | What result is wanted? | One observable change | Several unrelated objectives |
| Rules | What must stay true? | Protected behavior and exclusions | Vague minimality language |
| Examples | What does the rule look like? | Input and output pairs | Example treated as full coverage |
| Context | What evidence guides investigation? | Files, symbols, symptoms | Context treated as permission |
Use consistent descriptive labels
Consistency makes a brief easier to scan and revise. Choose labels that describe function, then use them the same way across the document.
Plain headings can be enough. XML-style tags are another option supported by F004. Either approach should expose the same roles. Avoid switching between “Goal,” “Objective,” and “Desired outcome” for the same block unless the distinction is meaningful.
Labels should not carry hidden semantics. A <rules> block containing optional preferences weakens the word “rules.” An <examples> block containing required new features confuses demonstration with scope. If an item is optional, say so directly.
Proportional structure matters. A one-line correction may need only an exact target and a protected behavior. A multi-file feature may benefit from full blocks. More headings do not automatically produce more clarity.
The Claude Code prompt specificity guide helps with the contents of a context block. This article focuses on the container that keeps those details from blending into rules.
Check the brief with a fresh reader
F018 recommends a colleague read with minimal task context. Use that check before execution when the brief carries product or interface decisions.
Ask the reader to identify the goal, the protected behavior, and the example’s purpose without explaining the task first. If the reader gives different answers, the structure or wording needs revision.
A useful review question is: “Which sentence would you refuse to violate?” That reveals whether the rules block is legible. Another is: “What does the example prove, and what does it leave open?” That reveals whether an illustration has been mistaken for complete acceptance.
Do not turn the fresh-reader check into a compliance score. It is a way to expose ambiguity, not a benchmark of model performance or a guarantee that every reader will agree.
The Claude Code code review bottleneck guide explains why unclear intent can move work downstream. A brief review before editing is cheaper in attention than reconstructing roles from a finished diff.
Worked example: structured invoice export brief
Consider the original request: “The invoice export needs the issued date, but do not mess with the rest.” The sentence contains a goal and an undefined boundary.
A separated brief could read:
Goal: Add the issued date to the existing invoice export so each exported row carries that field. Rules: Preserve current filters, field order except for the new date column, money formatting, and the existing filename pattern. Do not add scheduling or redesign the invoice page. Example: For an invoice with number INV-100 and issued date 2026-11-20, show the date beside the invoice number while retaining customer and total. This identifier and date are illustrative fixture data, not product facts. Context: Start from the current export handler and the output fixture that defines existing columns. Follow related call sites if the handler delegates formatting. Report any unavailable-date case before choosing new behavior.
The goal names the result. Rules protect current behavior. The example clarifies placement. Context points at evidence while leaving the investigation open.
Derived arithmetic for the illustrative fixture: The export receives two invoice rows. Both remain eligible under the current filter, so exported rows = 1 + 1 = 2. Adding a column must not remove a row. This calculation checks a requirement interpretation; it is not an observed performance result.
A reviewer can now ask focused questions. Is the date placement agreed? What happens when the date is missing? Does the filename pattern include date information? Each question belongs to a visible block rather than being buried in prose.
Revise missing context before execution
If the plan reveals that the named handler delegates to a shared formatter, update the context block. If the example conflicts with an existing interface contract, resolve the product choice rather than asking Claude Code to improvise.
A revision should name what changed. “Context updated after inspecting the formatter call site” is more useful than silently replacing the whole prompt. The change log helps the reviewer understand why the method widened or narrowed.
Do not use restructuring to hide a new goal. Adding a rule does not authorize a feature. Adding an example does not approve a design. Keep the goal stable unless the requirement owner changes it.
The Claude Code plan revision guide explains when new evidence should trigger fresh approval. A newly discovered file may refine context without changing direction; a changed output contract may require a new decision.
Brief review checklist
Use this checklist when a prompt blends several concerns. It is intentionally short enough to apply before a normal edit.
| Check | Pass condition | Revision if it fails |
|---|---|---|
| One goal | The result fits in a direct sentence | Split unrelated outcomes |
| Explicit rules | Protected behavior is named | Replace vague minimality words |
| Relevant examples | Each example explains a choice | Remove duplicates or label purpose |
| Evidence context | Pointers guide investigation | Separate facts from instructions |
| No hidden method | The goal does not dictate unnecessary steps | Move method to a suggestion |
| Fresh-reader check | Roles are understood without a talk-through | Rewrite ambiguous blocks |
| Open decisions | Missing policy has an owner | Pause the affected scope |
| Proportional format | Structure matches task size | Remove ceremonial sections |
A practical runbook is to draft the goal first, rules second, examples third, and context last. That order prevents repository details from defining the product outcome. Then ask for a plan that restates each block before any edit.
The Claude Code plan mode guide supplies the approval boundary. Approval should confirm that the proposed direction matches the separated brief, not merely that the plan looks organized.
Concrete win, honest loss, and implication
Win: In the invoice example, the date-placement question becomes visible in the example block instead of being guessed during implementation. A reviewer can reject the placement without rejecting the entire goal.
Loss: Clear blocks can create false confidence. A well-organized brief may still encode the wrong output contract, and examples may omit a consequential case. F004 and F005 describe prompting techniques, not proof of semantic correctness.
Implication: Use separated blocks when a prompt carries an outcome, protected behavior, and illustrative evidence at the same time. For a tiny exact-text change, a shorter form is enough. Structure should reduce interpretation work, not become a ceremony.
The Claude Code verification guide remains the acceptance boundary. A tidy prompt does not replace inspection of the files and behavior it requested.
Connect structure to the batch
Requirements come first: turn vague goals into observable outcomes, then protect them with negative requirements and scope boundaries.
Examples need their own selection method in acceptance examples with observable results. Missing policy belongs in clarification before choosing.
Concrete pointers belong in prompt specificity for files, symbols, and exceptions. Approval belongs in plan mode before editing.
When discovery is needed, use exploration plans that resolve unknowns. Execution becomes inspectable through task steps with exit conditions.
Dependency order is separate from prose order. Read-before-edit plan dependencies keeps producer-consumer calls explicit.
New evidence may require replanning when assumptions change. Early work can follow reversible planning with small steps.
Always-loaded instructions should stay essential in CLAUDE.md guidance. Narrow rules can use progressive disclosure by path.
Evidence selection matters more than volume. Use context relevance for the smallest useful evidence set and repair conflicting instructions with clear precedence.
A screenshot can inform image prompts with written constraints, while file references can reduce context noise.
Before adding another block, audit loaded context files. Ask for investigation before an answer without assuming API-only controls apply to Claude Code.
Independent reads may use parallel tool calls without conflicting state. Integration work should respect structured outputs only on supported surfaces.
Tool evidence belongs in evidence-rich result contracts. API-specific loading patterns remain separate in deferred tool discovery and unambiguous tool schemas.
Long tasks benefit from inspectable checkpoints. Edits should use exact target blocks, follow local style patterns, and preserve refactoring behavior contracts.
Finish with stop conditions at the agreed boundary. The session handoff guide helps preserve these separated decisions for the next engineer.
Data gap and future update
No verified benchmark in the research register compares goal-rule-example structure with free-form prompts. No token saving, adherence rate, or defect reduction is claimed.
The independent requirements guide is search-index evidence only. It supports documenting constraints and assumptions, but its full text was not fetched. A later editorial pass can replace it with a more accessible primary source.
Official documentation is live. Recheck the cited pages before publication, and keep the distinction between organization and enforcement even if the examples change.
One AI API Key option for OpenAI-format agents
The One AI free IDs do not work as a Claude Code model source. Claude Code uses an Anthropic-format route, and the packet records Claude IDs as unavailable on 2026-11-27.
A separate OpenAI-format agent can use One AI API Key at https://api.oneaiapikey.com/v1 with one key and 46 live free IDs. That is a different integration path, not a Claude Code configuration trick. Check the free model list for the current eligible options.
FAQ
Do XML-style tags guarantee that Claude Code follows each block?
No. F004 presents tags as an organizational technique. A clear structure can make roles easier to inspect, but the resulting plan and edit still need review.
How many examples should a prompt include?
There is no universal minimum in the fact pack. F005 recommends relevant, diverse examples, not a fixed count. Include enough to expose the interpretation that matters, then keep the set proportional.
Should file names go in the goal or the context block?
Usually in context. The goal states the result, while file names guide investigation. F016 supports precise pointers but warns that a named location can still be wrong.
Can emphasis words replace a rules block?
No. F006 advises plain instructions instead of reliance on keywords such as IMPORTANT. State the protected behavior directly and inspect whether the edit preserved it.
Sources
- Official: Claude Code best practices, supporting plain instructions and precise context (F006, F016).
- Official: Prompt engineering overview, supporting clear success criteria.
- Official: Claude prompting best practices, supporting descriptive tags, examples, and fresh-reader checks (F004, F005, F018).
- Independent: Atlassian acceptance criteria guide, available only as a search excerpt in the research pass.
- Independent: Software requirements specification guide, search-index evidence only for constraints and assumptions (F008).