Brief Claude like a colleague: make it ask before it builds
Prompting for direction, not magic words: the brief, the questions and the plan I used to build filters for SpaceCare's resource libraries.
Module 1
Brief Claude like a colleague: make it ask before it builds
How a product manager gives an AI coding agent clear direction, shown on a real feature: a five-part brief, an interview round where the agent asks only questions whose answers change the plan, plan mode with a written plan to approve, standing rules in AGENTS.md and memory, and a review sub-agent briefed as if it knows nothing.
The expensive mistake is the confident wrong thing
Prompting an AI coding agent well is mostly briefing, not wording. Give it the goal and why, the limits and how you will review, then let it ask before it builds. Here is the pattern I use with Claude Code, shown on a real SpaceCare feature.
With an AI coding agent, a wrong line of code is cheap: a test catches it, or you do. The expensive mistake is a well-built version of the wrong thing.
Agents are very good at filling gaps with plausible guesses. Every gap in your request is a guess you did not get to review.
So prompting for agentic work is the job a good product manager already does for a new team member. Say what we are trying to achieve and why, what is off the table, where to look, and what done looks like. Then let them ask questions before they start.
"Think of Claude as a brilliant but new employee who lacks context on your norms and workflows." - Anthropic, Prompting best practices
The same guide has a practical test: show your prompt to a colleague with minimal context, and "if they'd be confused, Claude will be too."
The worked example is a real feature: filters for a creator's resource library. SpaceCare creators publish courses, downloads and webinars on their own website. Once a library grows, visitors need a way to narrow it down, the way good resource sites show a sidebar of filter groups with checkboxes.
Step 1: Write a five-part brief
| Part | The question it answers | In the filters brief |
|---|---|---|
| Goal and why | What outcome, for whom, and why now? | Visitors to a large library find the right resource without scrolling through all of it |
| Deliverable | What exactly comes back, in what shape? | Creator-defined filter groups, managed in the library, shown as a filter sidebar on the creator's website |
| Constraints | What is ruled out, and what to do when stuck? | Don't break the groupings creators already use; AI may help file resources but the creator stays in charge; if unclear, ask |
| Where to look | Which files, docs and examples matter? | The library page, the website's visitor tabs, the existing folder and category code, and a reference site with the sidebar I liked |
| Review gate | When do I check in, and on what? | A clickable prototype and a written plan before any real code |
Condensed, the opening request read like this:
Add filters to a creator's resource library, so visitors to their website
can narrow a big library down by topic. Model it on resource sites with a
left sidebar of filter groups and checkboxes (reference link attached).
- Cover courses, downloads and webinars.
- Creators define the categories. AI can help file resources, but the
creator stays in control.
- Don't break the folders and categories creators already use.
- Look at the library page, the website's visitor tabs and the existing
folder code before proposing anything.
Before building: ask me what you need to know, then show me a clickable
prototype and a plan I can approve.Two lines do more work than they seem to. "The creator stays in control" is a constraint the agent can apply to cases I never listed, such as what undo should touch. And the review gate stops it from writing migrations before we agree what the feature is.
Step 2: Make it interview you
The brief is never complete, and you do not know which gaps matter. The agent, after reading the code, often does.
Left alone, it will not ask. Anthropic's Claude Code guide notes that "Claude tends to read a request conservatively and build the smallest thing that satisfies it". It suggests prompts like "Interview me until you could write the spec, then write it to SPEC.md."
So the second move is to ask for questions, with a filter:
Before you plan, ask me only the questions where my answer would change
what you build. For anything you can find in the code, look it up instead
of asking. For each question, recommend an option and say why.In Claude Code, questions like these come back as a short multiple-choice form, so answering takes a minute. For filters there were six, and every answer changed the build:
- How do filters combine? OR within a category, AND across categories. A visitor who ticks "sleep" and "stress" under Topic, then "worksheet" under Format, sees worksheets about either topic.
- Which resources? Courses, downloads and webinars, filtered on every visitor tab of the website.
- What may the AI do? Apply categories directly, but marked as the AI's, undoable as one batch, and never on a resource the creator has already filed.
- What about existing groupings? Keep folders and the existing Resources categories; filters sit alongside them.
- Tags? Per-resource keywords that make search better, but never shown in the sidebar.
- Should AI filing cost the creator anything? I said no.
The next day I reversed 1 out of 6 answers. AI filing would cost one AI run from the creator's monthly allowance, refunded if the job fails, because a free model call is a cost with no ceiling. Changing that answer took one message, because the decisions were written down where I could see them.
Step 3: Agree a written plan before any code
"Plan mode tells Claude to research and propose changes without making them." - Anthropic, Claude Code permission modes
You enter plan mode with Shift+Tab, or with /plan in front of a single prompt. The agent explores the repository, asks its questions, writes the plan to a Markdown file and waits for approval.
A good plan file reads like a short PRD. Mine have the same skeleton:
# <What we are building, in one line>
## Context
Why this change, what prompted it, the intended outcome.
## Approach
The steps, the files that change, existing code to reuse.
## Out of scope
What we noticed and deliberately are not doing.
## Verification
How we will know it works: commands, tests, what to check by hand.The filters plan proposed a separate Categories page. I rejected it: it overcomplicated the whole thing for creators. Everything moved into the library page, with an AI button in the categories panel that drafts categories and keywords from the creator's own library. One sentence of feedback, before a single route existed.
"Out of scope" is the section that saves the most time. For filters it read:
## Out of scope (noted, not done)
- Category chips on resource cards.
- Suggesting categories automatically on upload.
- One search-engine landing page per category.
- Reading PDF text for the AI (titles and descriptions only for now).Each line is a reasonable idea the agent chose not to build. Listing them means I disagree before the work happens, not after.
"Verification" keeps the plan honest. Ours said: run the AI filing for real against a seeded test creator, and tick filters on all 4 out of 4 visitor tabs. Then check that a filter ticked on one tab carries over to the next through the URL.
Step 4: Keep standing rules in AGENTS.md and memory
Some things you would say to every new team member. Those belong in a file every session reads, not in each request. In SpaceCare that is AGENTS.md: the stack, the commands, the security rules that are not negotiable, and a short product-scope "no" list.
Two rules from it shaped the filters build without me saying a word. Every write must be scoped to the resource's owner. And settings stored in the website's configuration must be carried forward on every save, because the settings route drops keys it does not know. So the website's "filters on" setting got its own column instead.
Keep that file short. Anthropic's post on context engineering frames the goal as "the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome". The Claude Code docs suggest keeping each CLAUDE.md under 200 lines, because "the more specific and concise your instructions, the more consistently Claude follows them."
Length also hides things. Liu and colleagues found that performance "is often highest when relevant information occurs at the beginning or end of the input context", and degrades in the middle. Keep the critical rules short and near the top.
Preferences that are mine rather than the codebase's live in small memory files, each with the rule, the reason and how to apply it. This one decided how creators turn filters on for their website, lightly edited:
For a binary state a creator can change, do NOT use a switch or toggle,
and do NOT use a filled primary button for the action. Use a coloured dot
+ the state in words, followed by one quiet underlined link with a verb
("Make it public" / "Switch back to coming soon"), same shape in both states.
**Why:** a UX review showed creators don't understand switches: they
can't tell what "on" means.
**How to apply:** for new state controls, propose status-plus-link first.
Keep both states visually identical in weight.Step 5: Brief sub-agents as if they know nothing
When Claude Code hands work to a sub-agent, the sub-agent sees only the brief it is given. It sees none of your conversation and none of the decisions you made.
Before merging filters, I had a sub-agent review the change. Its brief carried everything a reviewer would need:
Review the resource-filters change on this branch before it merges.
Context: creators define categories; AI may file resources but must never
touch one the creator already filed, and undo must remove only what the
AI added. Visitors filter courses, downloads and webinars on the website.
Look for: data the public website page exposes that it shouldn't, writes
not scoped to the owner, races between quick clicks, AI runs charged
twice, and undo touching creator-made links.
Report each finding with file, line, a failing scenario and a fix.
Don't fix anything yourself.It found real problems, all fixed in a second commit before merge. The website page was shipping the identifiers of unlisted drafts in its data. Undo would have removed category links the creator had added by hand. And a double click on the AI button could start two runs and charge for both.
None of those came from clever wording. They came from a brief that said what the feature promised.
Habits that matter more than wording
- Say why. A goal with its reason survives contact with cases you did not foresee.
- Show, don't describe. One reference page or screenshot beats three adjectives.
- Separate instructions from material. Put pasted documents, logs and data in clearly marked sections, and say they are data, not instructions. Anthropic recommends XML tags for this.
- Name the output format and length. "A table with these columns" or "one finding per line with file and fix" removes a whole class of rework.
- Be literal. OpenAI's GPT-4.1 guide says the model is "trained to follow instructions more closely and more literally than its predecessors". Its GPT-5 guide warns that vague or contradictory instructions do more damage to a model that follows them precisely.
- Know the map exists. For the full catalogue of techniques, The Prompt Report surveys 58 of them. For day-to-day agent work, the habits above cover most of the value.
What went wrong
- A race the brief never mentioned. A creator who ticked a category off and on again quickly lost it: the two saves raced and the older one won. The fix was a queue that sends one save at a time, plus a version check per resource. Verification now always includes clicking fast.
- Two branches, one migration number. Filters and another feature, built in parallel worktrees, both claimed the same database migration number. Whoever merges second renumbers, and the plan now says so.
- A rule read one way and meant another. I once told an agent we should "never use the API key, always Bedrock" for model calls. It recorded that as "Bedrock everywhere". I meant "Bedrock in the cloud, the API key only on a developer's laptop". Now I ask for a restatement whenever a rule says "never" or "always".
- Plans in chat scroll away. A plan that exists only in the conversation gets lost once the context is summarised. Plans now always live in a file, and the agent rereads the file instead of its memory of the chat.
Copy this: a brief template
## Goal
<outcome> for <who>, because <why now>.
## Deliverable
<what comes back>, in <format>, about <size>.
## Constraints
- Ruled out: <things not to do or touch>
- If stuck or information is missing: <skip / ask / mark as unknown>
## Where to look
<files, docs, examples, reference pages, prior decisions>
## Review gate
Before building, ask me only the questions whose answers would change
your plan, then write the plan to a file for me to approve.
Tell me where my assumptions look wrong.Sources
- Anthropic docs, Prompting best practices
- Anthropic docs, Prompt engineering overview
- Anthropic Engineering (September 2025), Effective context engineering for AI agents
- Claude Code docs, Best practices for Claude Code
- Claude Code docs, Choose a permission mode (plan mode)
- Claude Code docs, How Claude remembers your project (CLAUDE.md)
- OpenAI Cookbook, GPT-4.1 Prompting Guide and GPT-5 prompting guide
- Liu et al. (2023), Lost in the Middle: How Language Models Use Long Contexts
- Schulhoff et al. (2024), The Prompt Report: A Systematic Survey of Prompting Techniques