Skip to content

Building with context For engineers

Missing context: when should an agent ask?

An AI agent should ask questions when an unresolved decision changes the next consequential action and available evidence cannot settle it. Inspect accessible sources first, use current instructions that already resolve the question, and keep bounded independent work moving. Harmless reversible choices rarely need another approval round.

Name what could settle the gap.

A coding agent says it needs more context. That can mean several things: a referenced decision has not been read, the current behavior is unknown, the team has not chosen a policy, or the agent has reached an ordinary implementation choice. Asking the user to resolve all four wastes effort and can leave the real decision unclear.

Start with the next action. Write the missing fact or decision and explain how different answers would change that action. Then identify what could settle it: an accessible source, an observation of current behavior, an authorized decision, or a small choice within the task’s existing scope.

This routing method is a proposed way to plan work. It is not an implemented Shifu policy, a universal source hierarchy or evidence that more questions produce better engineering. The useful question is the one whose answer changes what should happen next.

Route the gap to its actual resolver.

Read the current request and applicable instructions before asking for clarification. They may already settle both the behavior and permission to act. Historical records can explain the reason or reveal a consequence; they do not override the user’s current authorized direction.

An existing policy and current behavior answer different questions. AWS’s architectural decision record process distinguishes proposed and accepted decisions. Inspecting a proposal does not show adoption, and inspecting code does not by itself establish which future behavior the owner wants. Preserve those distinctions when selecting the next step.

GapWhat can settle itBounded next actionWhat remains held
A relevant source is referenced but unread.The permitted original source and its scope/status.Locate and inspect it; summarize only what affects this task.The decision depending on it, until applicability is checked.
Current implementation behavior is unknown.The relevant code, configuration or a scoped executed check.Inspect or test the permitted path; record the boundary.A stronger claim about uninspected behavior.
A consequential policy or permission is unsettled.The authorized owner or an instruction that already settles it.Ask one focused question after checking available evidence.Only the action that depends on that decision or permission.
A harmless reversible detail is unspecified.Existing conventions and the task’s granted scope.Choose a simple option, make the assumption visible when useful.No extra approval unless the choice changes a material boundary.

Work through a fictional scheduling plan.

This entire example is fictional. An engineer is planning a weekly summary job that delivers on a subscriber’s selected weekday. The request refers to an earlier scheduling decision, but the decision is not included. The engineer also needs to understand the existing scheduler. No job is enabled and no summary is sent in this exercise.

First inspect the permitted scheduling records. An accepted decision may already define whether “weekday” uses the subscriber’s timezone, the organization’s timezone or UTC. Check that its scope covers this job. If the current request has already specified the timezone, use that direction and do not ask the same question again.

Separately inspect the current implementation. Suppose that inspection finds UTC-based calculation in one path. That observation describes the inspected implementation. It cannot settle whether UTC is the intended rule for this new job. A successful test of the current calculation would still not make that policy decision.

If bounded source inspection cannot establish the governing rule, keep the uncertainty precise: “I have not established the weekday’s timezone from the accessible records.” That does not prove no decision exists. The scheduling or product owner can supply the existing decision or choose the new policy. Do not silently substitute a timezone and enable deliveries.

Ask a question that changes the plan.

Explain the missing choice and its consequence, then ask for the answer or the governing source. Avoid a broad “please provide more context” request that requires the owner to reconstruct the entire task.

For the fictional schedule: “For this weekly job, does the selected weekday follow the subscriber’s timezone, the organization’s timezone or UTC? I could not establish the rule from the available decision records. The choice determines the delivery day for some subscribers; please identify the governing rule and scope.” The alternatives make the gap concrete without implying that the engineer has already selected one.

Ask about actual permission only when the next action needs permission that has not been granted. Do not turn an ordinary clarification into a fresh approval request for work already authorized. Once a current answer resolves the issue, record it and continue; do not keep reopening the same question because older material is less explicit.

A question can uncover another material dependency. Handle that dependency on its merits. A fixed quota of clarification rounds and a rule to ask about every unspecified detail both measure conversation instead of progress.

Hold the dependent action and continue the rest.

The missing timezone rule blocks committing to the schedule’s delivery behavior. It need not block reading the scheduler, locating the responsible owner, preparing a draft plan or describing the cases a future check must cover. Keep those cases conditional; a fixture with an invented expected delivery day would silently choose the unresolved policy.

Choosing a filename for that local fixture is different. Follow the repository convention and use a normal descriptive name. If the choice is easy to change and does not alter a contract, shared data, permissions or external behavior, a new approval round usually adds no useful decision.

Reversibility is a practical consideration, not a blanket authorization. An apparently local edit can affect a shared interface. Check its actual scope, and ask a focused question if that consequence is material and unsettled. Conversely, an irrelevant unknown should not stop a step that does not depend on it.

Gap card — fictional weekly summary plan
Task: plan a job for the subscriber’s selected weekday; no job enabled.
Missing decision: whose timezone defines that weekday?
Source route: inspect the referenced scheduling decision and its current scope.
Observation route: inspect existing calculation; label code behavior separately from policy.
Owner question if still unresolved: subscriber timezone, organization timezone or UTC?
Consequence: different rules can choose different delivery days.
Proceed: permitted source/code inspection, owner identification and a conditional check plan.
Hold: selecting the unresolved delivery behavior or enabling sends on that assumption.
Local choice: name the fixture using the existing repository convention.
Resolved when: current authorized direction or an applicable accepted source settles the rule.
After the answer: update expected cases and continue within existing authorization.
Execution status: no scheduling test, deployment or send result supplied.

Stop gathering when the next action is supported.

Keep the search proportional to the decision. Inspect the likely permitted sources and their coverage. If a bounded search leaves the same material gap, ask the owner or narrow the action; repeating an unchanged query cannot supply a never-made decision. A missing result remains a retrieval limit rather than proof of absent history.

Once evidence or a current instruction settles the gap, carry only the applicable choice, its source and the remaining uncertainty into the plan. There is no need to collect every surrounding fact before making a small supported step. If the owner is unavailable, record the affected hold and the independent work that can still proceed.

A team lead can review one gap with the task owner: did the agent inspect available evidence, ask the person who could settle the actual decision, and continue the work already authorized? Count the resolved decision and its evidence rather than praising either more questions or fewer questions.

Ordinary repository search, current inspection and an owner answer may be sufficient. A context engine can help locate earlier reasoning, but retrieval cannot make an unaccepted proposal authoritative or grant permission. For your next task gap, write the one observation or decision that would change the next action, then choose the smallest route to it.

Frequently asked questions

When should an AI coding agent ask a clarifying question?

When an unresolved decision changes the next consequential action and the available evidence cannot settle it. Before asking, read the current request and applicable instructions, inspect accessible sources and current behavior, and check whether a decision already covers the case. Then ask the person who can settle the actual decision one focused question.

Should an AI agent ask before making small choices?

Usually not for harmless reversible details. If a choice is easy to change and does not alter a contract, shared data, permissions or external behavior, follow existing conventions and make the assumption visible when useful. Reversibility is not blanket authorization, though: if an apparently local edit affects a shared interface, check its actual scope and ask if the consequence is material.

How should an agent phrase a question about missing context?

Explain the missing choice and its consequence, then ask for the answer or the governing source. Name the concrete alternatives without implying one has been chosen. Avoid broad requests to provide more context that force the owner to reconstruct the task. Once a current answer resolves the issue, record it and continue rather than reopening it.

What should an agent do while waiting for an answer?

Hold only the action that depends on the missing decision and continue the rest. It can still read the relevant code, identify the responsible owner, prepare a draft plan and describe the cases a future check must cover. Keep those cases conditional, because inventing an expected result would silently choose the unresolved policy.

Sources and further reading

Prepared with AI assistance and reviewed for source fidelity and practical usefulness. Examples marked fictional are illustrations, not customer results.

PUT THE CONTEXT TO WORK

Try it on one feature.

Review one of your recent agent sessions and see where a context gap changed the next action and how it was resolved.

Review a session

Keep reading