DEV Community

Cover image for Context is the job
Hoegun You
Hoegun You

Posted on Originally published at blog.hoegun.xyz

Context is the job

One day in October, our Slack agent posted an empty message into a thread, then another,
fourteen in all. Two people were talking to each other in that thread; nobody had asked the agent
anything.

The messages weren't really empty. Each one held a single invisible character. In a thread, the
agent got a turn on every new message. An empty reply counted as a failure and was retried, and
nothing in its instructions said how to stay quiet. So the model found its own way to say
nothing: a character a person can't see, which slipped past the filter that drops empty replies
and went out.

The model wasn't broken. Its context was missing one line, so I added a rule that says exactly
how to not answer.

That's the theme of this post. When an agent does something dumb, the first question I ask now
isn't "is the model good enough?" It's "what did it start with?"

This is part 4 of a series on what I learned putting AI agents to work in my own job.

What an agent starts with

A new colleague can be brilliant and still useless on day one, because they don't know your
rules, where anything is, what you decided last month, or what you actually want. With an agent,
I don't assume the next session has the context from this one. I give it durable records, and I
check that they are actually loaded.

What an agent starts with: the rules file, the folder, the records, the request, the data

So I think of an agent's context as five things I control, and I treat each one as part of the
job, not as setup:

  1. The rules file it should read before anything else.
  2. The folder it works in.
  3. The records of what was decided before (episode 5 is about these).
  4. The request, including what "done" means.
  5. The data, and the door it comes through.

One folder per job

Agents read folders directly, so the folder is part of the instructions. Here's the shape I use,
with a new example: reviewing a contract with an agent.

contract-review-2026-11/
├── RULES.md        ← what this folder is for, what to check, what never to do
├── originals/      ← the drafts as received; the agent reads, never edits
├── reference/      ← our standard terms checklist, past agreed versions
├── results/        ← everything the agent produces, as new files
└── log.md          ← one line per session: what was done, what's left
Enter fullscreen mode Exit fullscreen mode

RULES.md is a placeholder name. Use the instruction filename your agent recognises, or tell it
explicitly to read this file first, and then check that it was actually loaded.

The principles behind it:

Principle Why
Originals are never edited If the agent gets it wrong, you can always start again
Results are new files You can see what came from the agent, and compare versions
Names carry a date and a topic 2026-11-19-redline-summary.md beats final-v2.md, for you and the agent
One job per folder Unrelated files become "evidence" for the wrong answer
Old versions are moved out An agent will happily read last month's draft
Meaning lives in text, not colour "Status: cancelled" in a column, not a red cell

None of this is new to anyone who has organised a shared drive. What's new is the cost of not
doing it: a person skips the stale file because they remember it's stale. An agent only knows
it's stale if something it reads says so.

Where the agent starts decides what it reads

The first lesson I learned building my Slack agent was mechanical. The runtime loads one context
file from the agent's profile folder and another from the folder the session starts in. So
"where does this agent start?" decides which rules it sees. I now settle that before writing a
single rule.

The second lesson was about scope. My first idea was to put the Slack agent's rules into the rules
file that already sat at the top of the workspace, the one my coding agents read. I backed out of
it. The coding agents would have read rules about answer formats and hand-offs, and the Slack
agent would have read rules about editing code and updating docs. Keep role-specific rules
separate from repository instructions.
Both kinds of file can exist side by side; my Slack agent
and my coding agents just shouldn't inherit each other's jobs.

Rules files grow one line per mistake

My rules files didn't start complete, and I don't try to write them complete. They grow by one
line every time an agent gets something wrong in a way that will happen again.

How a rules file grows: the agent gets something wrong, I correct it, one line goes into the rules file, the next session starts with the correction

Three of the lines my Slack agent follows today, each from one real case in its first week:

  • Hand suspected bugs off fast. On its first real bug, the agent tried to investigate and reproduce it itself and held on to it too long. That's the investigator agent's job; doing it twice is waste. Now it points at the likely location, hands the case off, and tells the person what it thinks so far.
  • Answer in plain words by default. Other teams told me the answers were too technical. The default format changed to plain language first, technical evidence on request.
  • This is exactly how to say nothing. The invisible-character story above.

Two more lessons were about the rules themselves going wrong:

  • Rules rot. After we renamed some repositories, the agents' rules still pointed at the old paths. I noticed the next day while writing docs. Paths written into a prompt go stale like code does, so when the workspace changes, I search the rules files too.
  • A one-off instruction can quietly override a standing one. I added "don't change any code or data" to a check I handed the investigator. A required setup step in the local test environment changed state, so my blanket "don't change data" blocked the normal procedure. The agent obeyed me precisely, looked for another way, found none, and stopped. Before I add a constraint to a task now, I check which standing procedure it collides with.

The agent maintains some of its own notes too. In its first two days, one procedure the Slack
agent wrote for itself was revised 25 times. Context isn't a document you write once; it's the
thing you keep editing.

Write down "done" before the work starts

The most useful line in any request is the one that says what finished looks like. It lets the
agent check its own work, and it tells me what to review.

Two places this became concrete:

  • Hand-offs between agents. The investigator agent can't see the Slack conversation. So every hand-off uses the same template: the original question, what's already been checked, what still needs checking, and who will read the result. Without it, the investigator starts from zero.
  • Changing a monitoring rule. In my operations monitor from episode 2, a rule change counts as done only when the replays still pass: the quiet day still raises nothing urgent and at most three medium alerts, and both incident days still raise the urgent alert they should.

For your own work it can be as simple as three lines at the end of a request: the file that should
exist, what it should contain, and "if you're unsure, stop and ask".

Data through a safe door

The fifth thing an agent starts with is data, and it's the one that can hurt you.

Before my Slack agent could read live data, the best it could do with "how many orders were
auto-rejected this week?" was to suggest a query someone else could run. Once it could read data
through a read-only gateway that masks personal information, the answer became a number.

The door matters more than the data. The rules around it are simple:

  • Read-only, through the gateway, never a copy of an admin screen pasted into a chat.
  • Personal data stays masked, and the agent never asks for those columns in the first place.
  • Only counts and identifiers leave: an order number, never a name.
  • A small query budget per question, so a curious agent can't wander through a database.

Episode 3 has more on the rules I hold myself and my agents to.

What I'd tell someone starting

  • When an agent gets it wrong, ask what it started with before you blame the model.
  • Give every recurring job its own folder: originals untouched, results as new files, dated names.
  • Decide where each agent starts, keep role-specific rules separate from repository instructions, and check that the rules were loaded.
  • Add one line to the rules file every time a mistake could happen again. Expect to edit it often.
  • Search your rules files when you rename things.
  • Write "done" before the work starts.
  • Give data through a door that is read-only and masks personal information, or not at all.

The series

  1. From doing the work to delegating it
  2. Let code decide, let the LLM explain
  3. The rules I never break
  4. Context is the job (this post)
  5. Agents forget, so I write it down
  6. kenny: an agent that does my job
  7. Hermes: reminders that carry the check
  8. How to start in two weeks

What's the one line your agent's rules file is missing right now?

Top comments (0)