Skip to navigation

Claude Code Acceptance Examples: Show Inputs and Observable Results

In short: Give Claude Code a few representative input and result examples that reveal edge cases without prescribing the entire implementation.

Published 18 min read
On this page

Direct answer

Choose acceptance examples that expose a decision, not examples that describe every implementation step. Give Claude Code a normal case, a meaningful boundary, and an exception or refusal case, then state what an observer can see for each.

For example: “Given two eligible selected invoices, exporting produces a file containing those invoices with the current fields. Given an empty selection, no file is produced and the reason is visible. Given a user without export permission, the existing permission policy determines whether the action is hidden or refused.”

These examples clarify expected behavior while leaving components, functions, and libraries open. They do not guarantee adherence or complete coverage. Use them to revise the plan before editing, and treat unresolved policy as a human decision rather than something the example can invent.

Acceptance example evidence map covering normal, boundary, and exception cases with observable results.
Editorial evidence map based on F010, F011, and F012. The examples expose interpretation gaps; they do not establish exhaustive coverage or a guaranteed prompt fix.

Why examples beat abstract adjectives

Adjectives leave interpretation open. “Fast,” “clear,” and “robust” do not tell Claude Code which input matters or what result should appear. A concrete example makes a disagreement visible before the edit exists.

An example also separates behavior from mechanism. Showing the expected columns in an exported file does not require a particular CSV library. Showing an empty-selection message does not dictate a component structure. That distinction keeps the brief focused on the contract.

Poorly chosen examples can mislead. A single happy path may imply that errors do not matter. An example full of internal function names may prescribe a design accidentally. A precise expected result may encode a product decision that nobody approved.

The useful question is not “Can I add more examples?” It is “Which ambiguity would change the edit?” Add an example when the answer exposes a boundary, an exception, or a visible output that prose alone leaves unclear.

Official, F010: Claude prompting best practices says examples steer the format, tone, and structure of responses. That supports using examples to clarify shape and interpretation. It does not establish complete functional coverage.

The Claude Code prompt structure guide explains where examples belong. Keep them separate from the goal and rules so an illustration is not mistaken for an additional requirement.

Evidence and its limits

Official, F010: Official prompting guidance supports relevant examples as a way to steer response format, tone, and structure. The guidance is about prompting behavior, not proof that a generated change satisfies every case.

Independent, F011: Atlassian presents Given-When-Then and checklist formats as ways to write acceptance criteria. This is vendor guidance, not a universal standard or a completion guarantee. The research pass retrieved only a search excerpt because the full page returned an access error.

Independent, F012: Parallel describes acceptance criteria as predefined conditions a user story or deliverable must satisfy. This evidence is search-index only. It supports the idea of conditions, but it does not validate any specific example set.

Official, F014: In plan mode, Claude Code reads files and proposes a plan but makes no edits until the user approves. Examples can help review that proposal before the edit boundary opens. Approval still does not prove that the plan covers every case.

No verified community report is used. The research register contains no benchmark showing that a particular number of acceptance examples improves Claude Code outcomes. The selection method below is an editorial adaptation of the cited guidance.

Choose a normal case

A normal case establishes the main path. It should use a small, legible input and show the result that justifies the feature.

Keep the fixture minimal. If the behavior concerns selected invoices, two rows are easier to reason about than a large data dump. Include only the fields needed to understand the expected result.

The normal case should not smuggle in unrelated requirements. If the example shows a new filename pattern, a redesigned page, and a changed response field, it silently expands the task. Each visible detail should serve the stated outcome.

A useful normal case names the actor and action as well as the result. “Given two eligible selected invoices, when an authorized user requests an export, the resulting file contains those invoices with the current fields” is more precise than “export works.”

Example element Normal-case wording Why it helps
Actor Authorized user Establishes the main permission context
Input Two eligible selected invoices Keeps the fixture inspectable
Action Requests an export Identifies the trigger
Observable result File contains those invoices and current fields Defines acceptance without naming a library

The Claude Code observable requirements guide supplies the actor, trigger, outcome, and evidence frame. An acceptance example applies that frame to a concrete situation.

Choose a boundary case

A boundary case sits at an edge where a reasonable implementation may differ. An empty selection, an already-applied action, or a value with no optional data can expose hidden assumptions.

Choose a boundary that changes the expected behavior. If every boundary produces the same normal result, it may not add much clarity. The best boundary makes two interpretations visibly different.

For an invoice export, an empty selection is useful because one implementation might produce an empty file while another might refuse the action. Those outcomes are not equivalent. The requirement owner should choose one before the example becomes acceptance language.

Boundary wording should state what does not happen as well as what does. “No file is produced and the reason is visible” prevents a solution that creates an unusable artifact while still showing a message.

Do not invent a limit to make the example feel rigorous. If the product has no verified size or count threshold, do not add one. A boundary can be structural, such as zero selected rows, without introducing an unsupported number.

The Claude Code negative requirements guide helps name what the boundary must not change, such as current filters or export fields.

Choose an exception or refusal case

An exception case covers a failure or disallowed action that the normal path does not explain. It reveals whether the brief has confused an empty result with an error or a permission refusal with missing data.

For the invoice export, a user without export permission is a useful refusal case. The example should not invent the product’s permission policy. It should expose the decision: does the interface hide the action, disable it, or show a refusal after an attempt?

That question may already be answered by existing code and product rules. If so, cite the current behavior in the example. If not, record it as a blocking product decision rather than asking Claude Code to choose.

An operational failure is another exception shape. A rejected export request should not be presented as a successful empty export. The exact message and retry behavior may belong to existing design rules, so include only what the requirement actually needs to settle.

Case Input or situation Observable result Decision exposed
Normal Two eligible invoices selected File contains those invoices Main output contract
Boundary No invoices selected No file; reason visible Empty selection policy
Refusal User lacks export permission Existing permission behavior applies Hide, disable, or refuse
Failure Export request rejected Error state, not a successful empty file Failure presentation

A refusal example is not a security guarantee. It states expected behavior for review. The actual permission implementation still needs inspection under the project’s existing security practices.

State what the observer can see

An acceptance example needs an observation point. “The system handles it correctly” leaves the reviewer without an artifact. Name the screen state, file, response, record, or notification that carries the result.

Different examples may use different observation points. A normal export can be checked through the resulting file. An empty selection can be checked through the visible control state. A permission refusal can be checked through the existing access behavior.

Do not demand evidence that the requirement does not need. A component change may not require a new API response. A file change may not require a screenshot. Match the observation to the behavior being accepted.

A compact format keeps the example readable:

Given two eligible selected invoices, when an authorized user requests an export, then the file contains those invoices with the current fields, and no unrelated field changes.

F011 identifies Given-When-Then and checklists as acceptance-criteria formats. The format is a convenience, not a standard that every task must adopt. Plain input-and-result sentences can work just as well.

The Claude Code verification guide explains why a summary is weaker than inspectable evidence. Acceptance examples should point toward that evidence without turning the article into a testing methodology.

Separate examples from implementation steps

Examples describe behavior. Implementation steps describe how code should change. Mixing them can prevent Claude Code from finding a better route or can make the example impossible to satisfy for reasons unrelated to the requirement.

“Use a new helper called buildInvoiceFile” is an implementation instruction. “The resulting file contains the selected invoices with current fields” is an observable result. The first belongs in a plan only if a real constraint requires it.

A useful test is to remove function names, class names, and library choices from the example. If the expected behavior remains clear, the example is probably focused on the contract. If it becomes vague, the requirement may need a better outcome statement rather than more implementation detail.

Sometimes implementation is part of the requirement. A public interface name or a mandated library can be a real constraint. In that case, label it as a rule and explain why it is required instead of hiding it inside an example.

Implementation-heavy example Observable rewrite What stays open
Call buildCsv() in the component Export produces the selected rows Helper, library, and component structure
Add a canExport flag Unauthorized users receive existing permission behavior Where the policy is enforced
Create an empty-file branch Empty selection produces no file and a visible reason Control flow and error component
Rename the response field Existing response fields stay unchanged Internal types and helper names

The Claude Code prompt specificity guide covers useful concrete pointers. Specificity should identify evidence and exceptions, not dictate every edit.

Check for missing product decisions

An example can reveal a gap that the original goal hid. If two reasonable expected results exist, the example is not ready to become acceptance language until someone chooses.

For the invoice export, the empty-selection case raises a product choice: should the action be unavailable before a request, or should an attempted request receive a refusal? Both prevent an empty file, but they create different user experiences.

Record the choice with an owner. “Product owner must choose empty-selection behavior before implementation” is more useful than “Claude Code should use best judgment.” The latter delegates policy without authority.

Not every gap blocks the whole task. A failure-message wording question may be deferred if the current design system already supplies it. A permission-policy question usually blocks the affected behavior because different answers change who can act.

The Claude Code ambiguity clarification guide separates discoverable code facts from human decisions. Use repository evidence to learn what exists, then ask only the question that changes the edit.

Gap Discoverable from code? Blocking? Resolution
Current export field order Yes, by inspecting output No if the requirement preserves it Record current shape
Empty-selection behavior Sometimes Yes if no current rule exists Product owner chooses
Permission presentation Often Yes for the affected role Confirm existing policy or decide
Error copy Sometimes Usually no if design rules exist Follow existing pattern

Worked example: invoice export acceptance set

Suppose the feature request says, “Let people export selected invoices.” The sentence does not explain empty selections, permission behavior, or the expected file contents.

A representative example set could read:

Normal: Given two eligible selected invoices, when an authorized user requests an export, the resulting file contains those invoices with the current fields. Boundary: Given no selected invoices, when the user attempts to export, no file is produced and the reason is visible according to the approved empty-selection policy. Refusal: Given a user without export permission, the product follows its existing permission policy rather than creating a file. Failure: Given a rejected export request, the user sees an error state rather than a successful empty export.

The examples leave the file-building method open. They also expose two decisions that prose ignored: what the empty-selection policy is and how permission is presented.

Derived arithmetic for the normal fixture: The user selects three invoices, but one is ineligible under the existing rule. Eligible invoices = 3 - 1 = 2, so the file contains two rows. This arithmetic verifies the illustrative input contract; it is not a measured export result.

For the boundary fixture, selected invoices = 0. Expected exported rows = 0 and expected files = 0. The visible reason is the acceptance point, not an empty artifact.

A reviewer can now compare the plan with each example. A plan that only builds the normal file path has not explained the boundary or refusal. A plan that redesigns the permission system has expanded beyond the example unless the requirement explicitly calls for it.

The concrete win is that interpretation errors become discussable before code changes. The concrete loss is that the example set still cannot cover every operational failure, data shape, or permission context.

Use examples to revise the plan

Place the examples beside the goal when asking for a plan. Official documentation says plan mode researches and proposes changes without editing until approval (F014). This makes it a useful place to test interpretation.

Ask the plan to map each proposed change to an example. If a change serves none, it may be unrelated. If an example has no corresponding behavior in the plan, the plan may be incomplete.

Do not demand a one-to-one mapping between examples and files. One example may require several coordinated changes, and one shared change may serve several examples. The purpose is traceability of behavior, not a mechanical checklist.

When an example changes, update the brief visibly. “Empty-selection behavior changed from no file with a message to a disabled action after product review” is more honest than silently replacing the sentence. The change may alter the plan and the scope.

The Claude Code plan revision guide explains when new evidence should trigger fresh approval. An example that encodes a new product decision belongs in that review.

Representative versus exhaustive examples

A small example set is easier to review, but it cannot prove complete behavior. State that limitation directly so the examples do not become a false completeness claim.

Representative examples should cover distinct interpretations. Ten variations of the same successful export add less than one empty-selection case and one permission refusal. Diversity matters more than volume for this purpose.

Exhaustive coverage requires a defined input space and a method for checking it. That is outside this article’s scope. The practical goal is to expose important ambiguity while leaving implementation and verification choices to the project.

Example set Strength Limitation Good use
Normal only Shows the main result Hides boundaries and failures Tiny, well-understood change
Normal plus boundary Exposes an edge interpretation May omit refusal or error behavior Data-shape changes
Normal, boundary, exception Covers distinct outcomes Still not exhaustive User-facing feature work
Large duplicate set Looks thorough Adds review burden without new decisions Rarely useful

F010 supports examples as steering, not complete coverage. F011 and F012 provide supporting acceptance-criteria concepts, but neither turns a few examples into proof of completion.

Practical checklist

Use this checklist to select examples without turning them into a miniature implementation plan.

Selection question Pass condition Revision if it fails
Does the normal case show the goal? Input and result are legible Shrink the fixture
Does the boundary change behavior? Two interpretations produce different results Choose a more meaningful edge
Is refusal or failure represented? Disallowed action is not shown as success Add the missing outcome
Is the observation point named? A reviewer knows what to inspect Replace “works correctly”
Are implementation choices omitted? Method remains open Move required constraints to rules
Are product gaps recorded? Each blocking choice has an owner Pause the affected scope
Is the set proportional? Each example exposes a distinct decision Remove duplicates

A practical runbook is to write the normal case first, add the boundary that worries you most, then add the exception that would be most damaging if mistaken for success. Review those examples with the requirement owner before asking Claude Code to implement them.

Control checklist for normal, boundary, exception, observable-result, and product-decision review.
Editorial checklist based on F010 through F012 and F014. A complete writing checklist does not prove exhaustive behavior coverage or implementation success.

The Claude Code task breakdown guide can turn each example into an inspectable exit condition without claiming that a completed task status proves the behavior.

Concrete win, honest loss, and implication

Win: In the invoice example, an empty selection stops being an unstated assumption. The reviewer can reject an empty-file implementation because the agreed observable result says no file and a visible reason.

Loss: A carefully chosen example can still be unrepresentative. The normal fixture may omit an important data shape, and the refusal case may depend on permission behavior that the example did not fully specify. F010 does not establish complete functional coverage.

Implication: Use acceptance examples when a short concrete situation will settle interpretation faster than another paragraph of adjectives. Keep them behavioral, diverse, and honest about the cases they omit.

Verdict that representative examples expose ambiguity without establishing exhaustive acceptance coverage.
Editorial verdict based on F010 through F012. The benefit is visible interpretation; the limitation is that a small example set cannot prove complete behavior.

The Claude Code false-success discussion is the related warning. Satisfying a few examples does not prove the whole feature works, and an example written after the implementation may simply reproduce its assumptions.

Workflow for choosing normal, boundary, and exception examples before revising the Claude Code plan.
Editorial workflow based on F010 through F012 and F014. The examples support plan review; they do not guarantee adherence or exhaustive acceptance coverage.

Connect acceptance examples to the batch

Start with observable outcomes for vague requirements. Keep the goal, rules, examples, and context distinct through structured prompt blocks.

Protected behavior belongs in negative requirements and scope boundaries. Unresolved policy belongs in clarification before choosing.

Concrete pointers help through prompt specificity for files, symbols, and exceptions. Review direction with plan mode approval before editing.

Discovery should follow exploration plans that resolve unknowns. Each implementation step needs an inspectable exit condition.

Dependencies require read-before-edit ordering. Changed assumptions may require plan revision for new evidence.

Low-impact work can follow reversible planning with small steps. Always-loaded guidance should stay essential in CLAUDE.md.

Narrow rules benefit from progressive disclosure by path. Evidence selection should follow context relevance principles.

Contradictory instructions need clear precedence rules. Visual references work better with written image-prompt constraints.

Add only useful evidence through file references that reduce context noise. Before adding more, perform a loaded-context audit.

Ask for investigation before an answer when an example depends on unknown code behavior. Batch only independent parallel reads.

Integration surfaces should respect structured briefs where supported. Tool calls need evidence-rich result contracts.

Deferred loading and schemas remain API-specific in deferred tool discovery and unambiguous tool schemas.

Long work benefits from inspectable task checkpoints. Edits should target exact replacement blocks and follow local style patterns.

Structural changes need behavior-preserving refactoring scope. End at explicit stop conditions, and preserve decisions through the session handoff guide.

Tradeoff between representative acceptance examples and the remaining gap in exhaustive behavior coverage.
Editorial tradeoff diagram based on F010 through F012. A diverse example set exposes important ambiguity but cannot establish complete functional coverage.

Data gap and future update

No verified benchmark in the research register measures acceptance-example selection, example count, or resulting Claude Code edit quality. No coverage percentage or defect reduction is claimed.

Atlassian was available only through a search excerpt, and Parallel was search-index evidence only. A future editorial pass can replace these vendor summaries with accessible primary requirements material if verified.

Official documentation is live. Recheck the cited pages before publication and preserve the warning that examples steer responses without proving complete behavior.

One AI API Key option for OpenAI-format agents

The One AI free IDs are not 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 route does not make those IDs available inside Claude Code. Check the free model list for the current agent options.

FAQ

How many acceptance examples are enough?

There is no verified universal count. Include a normal case and enough boundary or exception cases to expose the decisions that would change the edit. F010 supports relevant examples, not complete coverage.

Should examples name functions and files?

Only when those details are actual requirements. Usually examples should name inputs and observable results, while file and symbol pointers belong in context.

What if the expected exception behavior is undecided?

Record the product decision and its owner before implementation. Do not ask Claude Code to invent permission, refusal, or error policy.

Can a Given-When-Then example replace verification?

No. F011 presents it as a way to write acceptance criteria. The resulting behavior still needs inspection, and a few examples cannot prove every case.

Sources

More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
  • 100requests
    per day
  • 3Mtokens
    per day
  • 47free
    models
  • $0per
    token
  • No card
  • No end date
Claim $10 credit →