Skip to content

Building with context For engineers

How much context should one task retrieve?

Start with the task and its current contract. Spend another lookup where a specific, permitted source could change a material decision. Keep a small ledger of what each read earned, and hold the dependent action when the evidence budget or access runs out.

Budget the next lookup against the decision it could change

Write down the choices the task still depends on. For each, name the source most likely to settle it and what would change if you found the answer. Start with the ticket, the current contract, and the nearest relevant test. Search the repository directly when you know the identifier. Save broader history search for a question the initial sources leave open.

Set aside time for checking sources and the resulting action before spending the rest on search. Bound the search by elapsed time and source reads, and keep the excerpts carried into the task small enough to review. A read of the controlling contract can be worth more than several hits repeating a proposal. A larger context window gives you room to keep evidence but leaves you with the work of checking it. Set the limits for the task's stakes and evidence access. There is no universal token count.

Anthropic's context engineering guide describes keeping lightweight references and loading their contents as needed. Apply that pattern by keeping an exact source locator in the ledger and loading the passage only when it helps with the decision at hand.

Record what each read bought

For every proposed read, enter the open choice and the expected cost. Once you inspect a source, add its exact locator, status, and applicable scope. Check whether the decision was accepted or superseded and whether the caller, version, or cohort matches. A result can be useful to inspect and still stay out of the working context. If it repeats a source you already checked, keep one locator. If it conflicts, resolve which source governs before relying on either.

Fictional expiry decisionEvidence ledger and budget
When does the v2 expiry clock start?Current v2 contract §4 and the adjacent test use ready_at. Keep the contract locator. First pass took four minutes.
Should the job expire legacy rows with no ready_at?Open the accepted replacement for the proposal linked from §4. Its legacy-row clause excludes them. Add an exclusion check. Four minutes.
Would reading the old incident thread change either check?Skip it. Its index entry identifies the retired v1 job and points to the same proposal. Zero additional reads.
Can the job run for enterprise accounts?The current rollout checklist points to a restricted policy. Record access unavailable after two minutes. Hold enterprise enablement.

Spend an extra read on the missing legacy case

In this fictional task, an engineer is planning automatic expiry for generated export links. They give the initial pass five minutes, with two targeted follow-ups in the next ten minutes and a separate block for drafting checks. The v2 contract on the target branch settles whether the clock starts when the export is requested or when it becomes ready. The adjacent test supports that reading for ordinary v2 rows and leaves the older records unresolved.

The linked proposal would use request time for older rows. A targeted read follows its supersession pointer to the accepted decision and checks that its legacy cohort matches the rows in this task. The engineer drops the fallback from the plan and drafts a fixture that expects those rows to be excluded. The old incident thread offers no sign of a different applicable rule, so it stays out of the search budget.

Hold the rollout gate when the source is unavailable

The enterprise exception policy is still inaccessible through the approved route. The engineer has spare minutes, but an extra history query cannot verify the current policy. They leave enterprise enablement on hold pending a scoped answer from the policy owner and continue drafting checks for the standard and legacy cases. The handoff carries the checked contract and decision locators, the unresolved policy reference, and the condition for lifting the hold. Implementation and test execution are still pending.

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.

Connect one supported source and inspect the context Shifu brings back. Start with a task you understand well enough to check.

Build with Shifu

Keep reading