Skip to content

Working notes

Building the Context Layer

·4 min read
A grid of context file cards — company.md, strategy.md, customer.md and others — representing the context layer for an AI agent.

At the end of last year I started prototyping with Replit. Then I moved to CC and local folder structure — agentic development, not vibe-coding. In February I got CC access at work and started applying the same approach to PM work. Context files are what give the agent real grounding — not just for skills, but for every conversation.

Why context files matter

Agents in agentic dev have CLAUDE.md, architecture.md, design.md — files that tell the agent about the world it's operating in. Without a codebase, you need the equivalent. Context files are documents that give your agent knowledge of your company, role, strategy, product, data, and customers.

With OKRs in a strategy.md, for example, the agent can tie a one-pager back to what you're actually trying to achieve — without you having to explain the context every time.

Types of context files

FileWhat it holdsChanges
company.mdWhat the company does, size, markets, business model, competitive positionRarely
product.mdProduct description, features, user flows, key constraintsOccasionally
customer.mdPersonas, segments, jobs to be done, research findingsOccasionally
strategy.mdCurrent OKRs, priorities, bets, north star metricQuarterly
data.mdMetric definitions, how things are measured, what success looks like in numbersAs metrics evolve
role.mdYour role, responsibilities, scope, who you work withInfrequently
content-model.mdContent types, taxonomy, ontology, naming conventionsWhen the model evolves
writing-style.mdYour voice, tone, and anti-patterns for public writingAs voice evolves
design.mdDesign system, brand, voice guidelinesOnly if relevant to your work

You don't have to start with one file per area. The sample below is a hybrid — a single file covering company, product, customer, and strategy. It's a useful starting point before you split things out as your setup evolves.

How to create them

There are two steps: gather, then generate.

First, gather the source data or files:

  • Exports from existing systems (Jira, Airtable, Figma).
  • Docs like PRDs, strategy decks, or user research insights.
  • If sources don't exist, ask Claude what it needs, then use /askuserquestions to generate the file based on what you know.

Second, AI is great at making sense of file dumps. Ask the agent to generate the context files:

  • Use a simple prompt: "Here are my [source docs / notes / exports]. Generate a context file that captures the key facts an AI agent would need to do useful work in this area. Use clear headings. Ask me for anything missing."

How to use them

Not every context file is relevant to every task. Here's how to load the right ones at the right time.

  1. CLAUDE.md / AGENTS.md — signpost them here so that Claude knows where to look if it determines it needs to.
  2. Skills reference them explicitly, pulling the relevant files automatically when they run.
  3. Regular conversations — @-referencing a file gives the agent context for that session without any skill involved.
  4. Agents — include the relevant context files in the agent's prompt for one-off tasks, or bake them into the agent's definition so they're included automatically every time it runs.

The difference it makes

I found improvements in agent output as I've improved my context files:

  1. Strategic alignment — With access to my OKRs via strategy.md, the agent knows what we're working to achieve. It can use that as a basis to critique, evaluate, and score ideas. It can then use those KRs to brainstorm related metrics to determine success in my one-pager.
  2. Writing requirements — I have context files with our design system component library, analytics event definitions, and content model ontology. The agent can reliably suggest if existing components or events can be used, or if new ones need to be created.
  3. Market and user research — With context files that represent what markets we serve and what our customers' core pain points are, research prompts return more pointed, relevant information. Claude has cross-referenced existing research and flagged gaps.

What I found is that the output quality is higher. I spend less time editing and more time deciding.

Creating context files, much like skills and knowledge files, are a new muscle you need to develop.

The whole point of this isn't to produce less while the AI does it all. Context files give the agent grounding for better critique, sharper questions, and spotting what you missed. That's why it's worth pairing this with critical-thinking, anti-sycophant instructions in your CLAUDE.md.