TL;DR. Context engineering means choosing what information an AI model can see at each step, so it can give you the result you want with as little text as possible. For an AI agent like Claude Code or Codex, most of that work happens before the first prompt, in the way its rules, files, and memory are organized.

After more than 1,500 hours with Claude and over ten years in SEO, I built that architecture around the same rules Google’s crawler follows to index websites, with a map the robot reads first, one place for every fact and care for how much it can read in one session.

An AI agent reads your files the way Google reads a website.

Everyone is talking about agents right now. But when you look closely, an agent is a file of instructions that a model reads, and the model can only use what it finds around it.

Without rules, organized files, and memory that carries over from one day to the next, even the best model in the world starts every morning from zero.

This article explains how we built the file architecture for SIGNAL OS, the system we run UNRIVALS on, why we chose that structure, and what we measured after changing how AI searches it.

It’s the practical follow-up to our guide on AI as a cognitive processor for the company, where we explain how AI can extend the way a team thinks without thinking for the team.

What is context engineering?

Context engineering means deciding, at every step, what an AI model gets to see. A model can hold only so much text at once. That limit, its context window, works like short-term memory.

Everything it knows about your company during a task has to fit in that window, so someone has to choose what goes in, in what order, and when.

Anthropic, the company behind Claude, describes it in its 2025 guide to context engineering for AI agents as “the art and science” of curating what goes into that limited window, a phrase its guide links to Andrej Karpathy. The same guide treats context as a finite resource with diminishing returns.

Good context engineering, it says, means finding the smallest possible set of high-signal tokens that makes the result you want most likely.

An AI agent is where context engineering matters most. Anthropic defines an agent as a model that uses tools on its own in a loop. It searches for a file, reads it, writes something, runs a command, checks the result, and keeps going until the task is done. Claude Code and Codex both work this way.

What we usually call a “marketing agent” is a Markdown file of instructions that the actual agent reads before it starts.

Companies are already feeling the cost of skipping this work. In June 2025, Gartner predicted that over 40% of agentic AI projects will be canceled by the end of 2027 because of rising costs, unclear value, or weak risk controls.

In the same release, Gartner estimated that only about 130 of the thousands of vendors selling “agents” have the real thing, and that many others practice what it calls agent washing, putting a new label on old assistants and chatbots.

But the money isn’t following the excitement. McKinsey’s state of AI report for 2026 found that 40% of respondents from organizations with more than $1 billion in revenue are now scaling AI agents, up from 27% a year earlier.

In the same report, the share of all respondents who see any impact from AI on operating profit stayed flat at 37%. Agent use went up, and AI’s effect on profit stayed where it was.

Everyone has access to the same models, at the same price. Where the agent works makes the difference.

Is context engineering replacing prompt engineering?

Context engineering includes prompt engineering. A prompt is one instruction, written once. Context includes the rules, files, history, and earlier results the model sees around that instruction. With an agent, those inputs change at every turn of the loop. Anthropic makes the same distinction. You write a prompt once, while curating context is an ongoing process.

The difference becomes clear at scale. Working with AI on a folder of ten files, as you might in a ChatGPT project, is one thing. A knowledge base with more than 7,000 files I wrote, about as many written by the system, and tens of thousands more for site builds is a different challenge. I counted today.

The UNRIVALS knowledge base, which we call the Brain, has 14,944 text files and close to 97,000 files in total.

With ten files, the AI can read all of them every time and still get it right. At 15,000 files, the AI can’t read them all even once. Once a knowledge base reaches a certain size, what the model can find matters more than what it knows.

I wrote about the limits of plain chat in our guide to ChatGPT for business, and this article picks up where that one leaves off.

Why does an AI agent behave like Google’s crawler?

An AI agent and Google’s crawler both have more to read than their available budget allows. Google’s crawler has a crawl budget, the number of pages it can fetch from a site in a given period. An agent has a context window. Whatever doesn’t fit in either budget is out of reach.

I’ve worked on probably hundreds of websites, from a few pages to millions. The largest had more than 5 million pages and over 3 million products. At that scale, Googlebot can’t reach every page on its own.

Google explains this in its guide to crawl budget, which is written for sites with over a million unique pages that change weekly, or over 10,000 pages that change daily. Working on sites like these taught me how Google indexes them and how its bots behave.

Anyone who has done SEO has heard about “over 200 ranking factors” for years. Internal Google documents leaked in 2024 and analyzed by Rand Fishkin at SparkToro describe 14,014 attributes across more than 2,500 pages of API documentation. The documentation doesn’t show which of them count for ranking, or how much.

Googlebot spends its budget on the pages a site marks as important, and it ranks them on signals.

AI agents face the same challenge, with an added problem. Too much text can make a model perform worse.

The “Lost in the Middle” study, published in 2023 by Nelson Liu and colleagues in the journal TACL, found that model performance drops significantly when the relevant information sits in the middle of a long context, and that models perform best with relevant information at the beginning and end.

In July 2025, Chroma tested 18 models and found the same effect on simple tasks. Researchers now call this effect context rot.

The context window is the agent’s crawl budget. If you’ve managed crawl budget, you know not to fill it with every page. You structure the site so Googlebot reaches what matters quickly.

SEO, for Google File architecture, for AI
sitemap.xml _INDEX.md files, the routers (71 in our Brain)
crawl budget the context window, how much the agent reads before it fills up
canonical each piece of information lives in one place, and the rest only point to it
301 redirect a replaced_by mark on the old source
robots.txt and noindex financial and personal files stay out of the search index
meta tags frontmatter, the header at the top of every file
internal linking links between notes
freshness recency, the newer file ranks higher in search
broken link, orphan page a dead pointer, which fails the router check

What is the file architecture an agent works in made of?

The architecture has five parts, each with a different job. Rules tell the agent what it can do. The Brain shows it what exists. Skills explain how to do each kind of work. The operating system connects those parts and sets the same limits for every agent.

Doctrine gives the agent direction based on what you know about your company, rather than what anyone can find online.

The rules live in a short file loaded at every step of every session. Ours says, for example, that the agent can read and make proposals on its own, but must ask before deleting anything, sending an email, or publishing to a website.

The file has a size cap because the agent rereads it on every turn, and every extra line adds to the cost.

The Brain is the set of files you work with. Their structure matters, along with why you organized them that way and how the AI reads and writes to them. Ours includes routers, state files, system documentation, agent files, and a file about the person who works with it.

I explained what a system like this means for a founder in our guide to an AI Brain for founders. Here I’ll focus on how the agent reads those files.

Skills document how you work. The operating system is the shared rulebook for every agent. The doctrine gives your agents direction. Each has a distinct job, and I’ll explain them one at a time below.

What the agent asks, in order
  1. Rules What am I allowed to do here
  2. Brain What exists and where it lives
  3. Skill How this kind of work gets done
  4. Operating system Which limits I share with every other agent
  5. Doctrine What the person wants to achieve

The SIGNAL OS architecture, December 2026

The chain runs from top to bottom for every task. Most people skip the highlighted link because a good prompt can seem like a substitute for a skill. That shortcut works once, for one task. The next day, you have to write the prompt again.

How does AI find information in a Brain of 15,000 files?

The agent searches the Brain in the same order a crawler moves through a well-built site, from the map to the page. The agent first reads the router, then the state file, then runs a search. Only if those steps fail does it search files with grep, a raw keyword search.

Each step should answer the question before the agent needs the next one.

Step one is the router, which works like a sitemap. The rules file points to a master index, the master index points to an index for each area (social, blog, prospects, ads), and each area index points to the file that says where we left off.

Our Brain has 71 of these routers. The target for each is under 4 KB so the whole file fits in context, and today 60 of the 71 meet it. When I move a file, I update the router in the same turn. An automatic check catches any dead pointer, much like a broken link in an SEO audit.

Step two is the current state, and it arrives on its own. At the start of every session, a script loads the state file (what’s open right now and the next step on each active workstream) and the task list. The agent receives them without having to search.

At startup, the AI reads around 60 KB of rules, indexes, and state. That’s 0.02% of the 336 MB of text in the Brain. It finds the rest when it needs it.

Step three is the Brain search. We put the Brain in a database on a server and keep a copy on my laptop. A script rebuilds that copy every night at 4:30. The search blends several signals, much like a ranking algorithm.

It weighs how many words from the question a passage covers, the sentence’s meaning (through vectors, so “how much does it cost” also finds “price”), the companies and people named, how recent the file is, and where it sits in the hierarchy. It also pushes down any file marked as replaced.

A real example from December 5. I asked, “How much is VANGUARD and how is it sold?” The search returned five results in 2.2 seconds. The first was the company’s state file, which includes the active goal, and its passage said VANGUARD™ costs €7,497 a month and is sold as a six-month pilot.

The agent read five lines like that one, each with a path, date, score, and passage, then opened only the file with the answer.

Step four is grep, the raw keyword search, and the agent uses it only if the earlier steps fail. An empty search result doesn’t mean the information doesn’t exist. Before saying “not found,” the agent moves to the next step and reads the state files.

This is where frontmatter, the metadata header at the top of each file, comes in. You no longer have to read everything because the AI does. The header matters as much as meta tags do on a web page. It holds the date, type, client, and replacement mark.

The robot reads the header and decides whether the file is worth opening. When two files contradict each other, the newer one wins. A file marked as replaced sinks in the results, much like a page behind a 301 redirect.

We added that rule after a baseline test showed us why it was needed. In a test in November 2026, three out of five wrong answers came from old sources the AI picked over newer ones. Since then, whenever a decision changes, we mark the old source right away.

What did we measure when we changed how the AI searches?

We measured three times, twice on real Claude sessions with a fresh session for every question, and once on the search alone. The first test, on November 17, 2026, compared the AI without the search rules with the AI following the order above. Both used the same 30 questions about the company.

Total time fell from 669 seconds to 418 seconds, a 37.5% drop.

The number of steps, or tool calls, fell from 200 to 101, almost half.

The number of steps drives the real cost. At every step, the model rereads the whole conversation so far. But fewer steps don’t mean proportionally less context, and the third test shows why. The second test, on November 30, measured the accuracy of the search, without Claude sessions.

For 36 of 40 new questions written after tuning, the right source appeared in the top five results. That’s 90%, compared with 31 when the search used keywords alone.

The third test, which I ran on December 5 with 50 questions, was the most uncomfortable. Both modes had the same rules, routers, and state file. They differed only in the search tool. The search cut the number of steps by 22%, the text read from tool results by 28%, and the cost by 17%.

But total context loaded fell by only 5%, and time went up 7%.

What changed when the AI searched differently
  1. 49.5% fewer steps with rules and search, compared with neither 30 questions, Nov 17, 2026
  2. 90% right source in the top five results 40 questions, Nov 30, 2026
  3. 22% fewer steps from the search tool alone 50 questions, Dec 5, 2026

UNRIVALS measurements, two on real Claude Code sessions and one on the search itself

The third test says something uncomfortable. On top of an architecture that already existed, the search tool brought a real but small gain. The tests don’t separate exactly how much comes from the architecture and how much from the tool, but my reading is that routers, state files and clear rules about where to look do most of the work.

The same is true in SEO. A plugin can’t fix a badly built site.

What are skills, and why isn’t one app enough?

A skill is a written description of how you do a job, saved in a file the agent loads only when it does that work. Skills capture a person’s experience and expertise in a form the agent can use.

Think about your phone. You have an app for banking, one for travel, and one for shopping. None of them tries to do everything. With AI, a lot of people assume that having Claude or ChatGPT means having it all. Claude or ChatGPT gives them the equivalent of a phone. They still need to build the apps for their work.

I’ve built dozens of skills for the work I do, and today the system has more than 150. Each one reflects how I work, why I work that way, and what I want the work to produce. Every skill has a single job.

One makes an article cover, another writes the first email to a company that doesn’t know us, and another analyzes a prospect using public data. The agent doesn’t load the whole catalog into its working memory. It searches the skill index for the right one, the way you search the App Store.

That’s why AI can write articles even about medicine. It doesn’t know medicine better than a doctor. But it can use a marketing method and working principles, while the doctor supplies the facts. Every skill also has a feedback loop. I add each correction to the skill so the same mistake doesn’t happen on the next run.

Our doctrine gives this principle a plain name, the method settles into the AI through accumulated dialogue. The AI learns from dialogue, and it can carry that learning forward when you save the dialogue in a file it reads next time. A skill is a correction you never have to make twice.

Why does AI need an operating system?

An operating system gives every agent the same rules, files, and permissions. On your phone or laptop, apps don’t know about each other, aren’t allowed to delete your files without asking, and don’t keep their own passwords. That’s why macOS, Windows, and iOS exist.

AI needs the same kind of system, and SIGNAL OS is the operating system we built for our agents.

macOS and its apps SIGNAL OS
the kernel and system rules the rules file that applies to every client, loaded at every step
permissions (“this app wants access to your camera”) three levels, where the agent reads on its own, proposes on strategy and always asks before deleting, emailing or publishing
the file system and Spotlight the Brain and the Brain search
apps skills, more than 150 today
the App Store and macOS updates the system update, which changes the skeleton and leaves your data untouched
Keychain a single vault for every access key
Time Machine the nightly backup, on the laptop and on the server
background processes the nightly jobs that reindex the Brain and refresh public data
the system log and crash reports the change log and the mistakes list, where every mistake becomes a rule
the user account the file about the person who works with the system and how they work

Over time, I’ve run into plenty of questions and gone looking for answers. New problems keep showing up, and AI now solves them quickly and well. I keep improving the system, and I see updating my own system as the same kind of work as Apple updating macOS. A system that doesn’t grow dies.

Our agent can read anything, any time, but it can’t send an email, publish to a site, or delete a file without a written “yes.” We enforce part of that rule in code, so the agent can’t break it even if it gets confused.

What is an internal doctrine, and why does it make the work yours?

The doctrine is the operating context you give the agents, built from what you know rather than from the general knowledge available online. A language model knows what the internet says about marketing. It doesn’t know what you believe about marketing or why you believe it.

Ours is called SIGNAL DOCTRINE™, distilled from more than 35 years of work by the founders of UNRIVALS. Each principle includes how often it came up, which helps the AI distinguish a recurring pillar from an idea mentioned once.

Cognitive ownership, the place you hold in the customer’s mind within a category, comes up 26 times and is the central principle.

Another principle in the doctrine explains why everything else works. The doctrine describes AI as a cognitive processor that extends the team’s thinking. The quality of what it produces depends on how precisely you tell it where to think. A doctrine directs the processor to think in your direction instead of defaulting to the internet’s average.

That’s why your work with AI can be yours alone, just as my work with it is mine. Everyone gets the same model. The doctrine, the skills, and the Brain belong to you. We apply the same idea in our guide to marketing that uses AI, where we show how strategy connects to execution.

How do you keep AI work continuous from one day to the next?

Continuity is the biggest problem for anyone who works seriously with AI, because every session starts with an empty memory. When the window closes, the AI loses what you worked on yesterday, what you decided and why, and where you stopped. Most people explain it all again or paste context into every conversation.

In SIGNAL OS, continuity is built in layers, and each layer has a fixed place and a size cap.

Files that load automatically get cut off silently when they exceed their size caps. The AI can’t see the end or tell that anything is missing. When a layer grows, cut its content and leave the cap alone. Keep each piece of information in one place, too.

Copies can contradict each other, and the AI can’t know which one is right.

Google and AI behave most alike here. When a site has the same page in three versions, those versions split its authority, and Google picks one more or less at random. When a Brain stores the same rule in three files, it creates the same problem. The wrong version can end up in an email to a client.

Which layer of the company does the AI architecture sit on?

The AI architecture sits on the third of the four layers we analyze in every company, orchestration and memory. We start with L1, performance marketing, then move to L2, revenue and the sales process. L3 is orchestration and memory, where the Brain lives. We finish with L4, positioning and the category customers compare you in.

Four layers, and the AI architecture sits on the third
  1. L4 · Positioning and category The criterion customers compare you on
  2. L3 · Orchestration and memory Rules, Brain, skills and doctrine
  3. L2 · Revenue and sales process Opportunities, sales cycle, offers
  4. L1 · Performance marketing Cost per lead, cost per acquisition, conversion

The UNRIVALS four-layer analysis model

Few people look at L3 because it doesn’t produce anything visible on its own. But L3 determines whether work on the other layers adds up or gets lost. Without memory on L3, even a good campaign on L1 starts from scratch next month, with the same mistakes.

One of the oldest principles in our doctrine is that what a client usually lacks is infrastructure, and marketing built on a weak foundation burns money. With AI, the infrastructure is the file architecture. An agent working from a messy Brain produces more, but no better.

What do founders tell us about AI in their companies?

We talk with founders almost every day, and two problems come up often. First, everything still goes through the founder. They’ve tried AI, seen how quickly it writes, and found they have to explain the company to it every time. So AI has become one more person to direct instead of someone who takes work off their plate.

The second problem is unfinished strategy. AI produces drafts, ideas and lists, but they don’t become a system because there’s nowhere to put them. If you can’t find a draft next time, you’ll have to do the work again.

Both problems have the same cause. AI has no place to work. More models or a bigger budget won’t fix that. A method can give AI a place to work, just like any other piece of company infrastructure.

How do you build your own AI agent, step by step?

Build your agent by setting up where it works first, and write the prompt last. If I were starting today with one folder and no special tools, this is the order I’d follow.

  1. Write a one-page rules file. Spell out what the agent can do on its own, what it should propose, and what it must never do without your “yes.” Keep the file short because the agent reads it at every step.
  2. Make a router. This index lists the folders and what’s in each one. Keep it under 4 KB. The agent reads it first, much like Google reads a sitemap.
  3. Make a state file. Record what’s open and the next step, then update the file at the end of each workday. This file alone solves half the continuity problem.
  4. Put a header on every file. Include the date, type, client and, when relevant, the file it replaces. The header works like the file’s meta tag.
  5. Write your first skill for the work you do most often. Include the steps, the rules and the mistakes you don’t want repeated. Then revise the skill after every run.
  6. Measure. Ask the agent the same ten questions about your company before and after, then count the steps and correct answers. Without a measurement, you can’t tell whether the architecture helps or just looks tidy.

If AI also reads your company’s website, the rules are similar. I describe them in our guide to generative engine optimization, which explains how companies get cited by ChatGPT, Gemini or Perplexity.

Frequently asked questions

What is a context engineer?

A context engineer designs what an AI model sees while it works, including the rules, files and memory, and the order the model loads them in.

Is context engineering replacing prompt engineering?

It absorbs it. A prompt is one instruction, and context includes everything around that instruction, such as rules, files, history and tool results. An agent’s context changes at every step, so the prompt becomes one small part of a larger design.

How many files does an AI agent need to be useful?

A well-organized agent needs only a few files to get started. A rules file, a router, a state file and one skill are enough. The number of files grows over time, and the architecture keeps them usable. Our Brain has close to 15,000 text files, but at startup the agent reads 0.02% of them.

Which UNRIVALS programme includes an AI Brain built for your company?

VANGUARD™ includes your own AI Brain with structured memory, agents and a control panel built around your business. The programme also includes positioning, the offer, the commercial system and monthly measurement. STARTER™ and SOVEREIGN™ also include the AI Brain.

What should you ask before your next AI agent?

Before you buy or build another agent, ask where it will work. Does it have written rules? Can it find yesterday’s decisions on its own? Does it know what you want to achieve, beyond what the internet says? If not, the next agent will repeat the first one’s mistakes, only faster.

If you want an outside view of how the market sees your company and how much of the value you create reaches your client, ask for a diagnostic. We use your company’s public data to show where the signal gets lost.

What VANGUARD™ solves

VANGUARD™ builds the infrastructure before the campaigns, including the place your company’s AI works. The same team builds your positioning, offer and commercial system, measures results monthly, and creates your AI Brain with structured memory and agents trained on how your company works.

The programme costs €7,497 per month, plus a one-time €3,700 payment at the start. It begins with a six-month pilot. On the first day of month seven, the company decides whether to continue. The Brain, procedures and data built along the way stay with the company.