Workflows

Give your AI coding agent better context

Turn a vague request into a useful working brief. Supply the right constraints, examples, and evidence without burying the task in irrelevant material.

Scattered notes converge into a structured working brief with three clear rows: Goal, Constraints and Checks.
In this guide
  1. Start with a working brief
  2. Put context in the right place
  3. Make ambiguity testable
  4. Keep context useful over time
  5. Sources & further reading

Start with a working brief

“Make the search better” leaves an agent to invent the problem. Does better mean faster, more tolerant of spelling errors, easier to use with a keyboard, or more accurate? A useful brief makes that decision visible before implementation begins.

Describe what a person does, what happens today, and what should happen instead. Then identify the constraints that make the task yours: the data source, the existing interface, the supported platforms, and the behavior that must remain stable. A short concrete brief often gives the agent more usable direction than a long history of the project.

Vague requestWorking instruction
Improve searchMatch article titles and descriptions without case sensitivity.
Make it accessibleGive the search field a visible or programmatic label; announce result counts.
Handle edge casesWhitespace-only input shows every article in the selected category.
Keep it fastFilter the small local article registry; do not add a search service.
Illustrative brief for an article library. Each replacement describes something a reviewer can observe.

The goal is not to prewrite every line of code. Give the agent enough constraints to avoid making product decisions accidentally, while leaving ordinary implementation choices open. If a choice matters to the user, make it an explicit part of the task.

Put context in the right place

Context includes instructions, examples, tool descriptions, retrieved files, and previous results. Anthropic’s context engineering guide frames the problem as selecting useful information within a limited working context. More material is not automatically more useful.

Rules, task, evidence, and decisions contribute equally to a working brief.
AI-generated explanatory illustration. An editorial organization pattern, not a claim about a particular tool’s instruction precedence.
Read the diagram explanation
  • Durable rules. Repository conventions and required checks
  • Task brief. One outcome and its boundaries
  • Relevant evidence. Current files, errors, and examples
  • Recent decisions. What changed and what remains open

Put stable project guidance in the repository’s supported instruction file. Put a one-off request in the task. Link to relevant files instead of pasting an entire codebase, and ask the agent to inspect the implementation before proposing changes. Tool-specific instruction names and precedence differ; check the tool’s documentation rather than assuming every file is loaded automatically.

Include negative constraints only when they prevent a realistic mistake. “Do not change the public URL” matters in a routing task. A page of unrelated prohibitions makes it harder to find the actual requirements. If an older note contradicts current code, call out the conflict and establish which source should govern the decision.

Make ambiguity testable

For the article search example, supply a tiny dataset and expected results. The example below is deterministic JavaScript, independent of any model. Save it as context-example.mjs and run node context-example.mjs. The assertions describe the agreement a future implementation must satisfy.

Executable acceptance examples
import assert from 'node:assert/strict';
const articles = [
  { title: 'Agent loops', description: 'Tools and feedback', category: 'Foundations' },
  { title: 'Git worktrees', description: 'Parallel coding', category: 'Workflows' },
];
const search = (query, category = 'All') => articles.filter(a =>
  (category === 'All' || a.category === category) &&
  (a.title + ' ' + a.description).toLowerCase()
    .includes(query.trim().toLowerCase())
);
assert.equal(search('  TOOLS  ')[0].title, 'Agent loops');
assert.equal(search(' ', 'Workflows').length, 1);
assert.equal(search('missing').length, 0);
console.log('3 acceptance examples passed');

This example locks down case folding, whitespace handling, category filtering, and the empty result. It does not establish full-text relevance, Unicode normalization, or typo tolerance. If those capabilities matter, add examples for them before choosing an algorithm or service.

Keep context useful over time

Long tasks collect failed hypotheses, stale screenshots, superseded plans, and partial results. Preserve the current state deliberately. A handoff should explain the goal, the chosen approach, exact relevant files, verification already completed, and the next unresolved step. Avoid a transcript-shaped recap that makes the next reader reconstruct the decisions.

For example: “Title and description search works. Category selection is retained when the query clears. Empty results have a reset action. Keyboard focus and screen-reader announcements still need browser verification.” That is useful because it tells the next person where confidence ends.

When a new requirement arrives, update the brief rather than attaching a contradictory instruction at the bottom. For concurrent work, establish a shared contract first; the guide to splitting agent tasks shows how to keep those boundaries explicit.

Sources & further reading

Primary references checked . Version-specific examples identify the version used; current product behavior may differ.

  1. Anthropic: Effective context engineering ↗

    Context selection, retrieval, and maintaining useful state across long tasks.

Max Burleigh is the creator of Codeck, an independent macOS app for switching between Codex and Claude Code tasks. He writes about the tools, workflows, and verification practices behind building with AI.

Have a correction? Send it to Codeck. Read our editorial policy, including how AI assists production.

Working across coding tasks?

Codeck puts your Codex and Claude Code tasks in one macOS keyboard deck.

Meet Codeck ↗