yeti labs

field note 011 · 2026-08-24 · agents, context

we pointed the agent at the right project, and it loaded none of it

our assistant told a client channel it couldn't reach a monitoring box it had logged into twenty minutes earlier. it had been handed none of what it knew about that box, and the first fix broke again one directory down.

since it logged in
20 min
first context budget
32 kb
indexes one level down
7
fix arrived late by
2m42s

the setup

we run one agent that answers in slack and telegram for several clients. each reply is a persistent session on the software development kit (sdk) that powers claude code, running on our homelab box. it has shell access, so it can ssh into things, and it has a memory directory per project: short notes on which hosts exist, how to reach them, and where the keys live.

at first every session ran from one directory, our assistant's own repo, with no project settings loaded at all. so a question from a client channel started with no idea that client's servers existed. it could find its way to a box by luck and log in, and then twenty minutes later tell the same channel it had no way to reach it. the knowledge was on disk the whole time, under a different project's name.

the obvious fix is routing: map each slack workspace to its project directory and start the session there. claude code keys both its project docs and its memory directory off the working directory, so standing in the right folder should bring the right context with it. we shipped that on 2026-08-18. the first live test came back with the context missing.

why routing did nothing

two things, both easy to reintroduce.

  1. a custom system prompt replaces the preset. the sdk ships a default system prompt, and that preset is the code that finds the project's CLAUDE.md and injects the memory index. we passed our own system_prompt string (persona, voice, the rules for posting as someone), which swapped out the whole preset. the session stood in the right folder and was told nothing about it.
  2. setting_sources=["project"] only looks for a project doc in the working directory itself. some of our routes point at a container: a folder that holds several repos, each with its own doc one level down. at the container level there's nothing to find.

neither one errors. the agent answers fluently either way, and the failure only shows when it confidently denies something it can do.

so we stopped relying on the preset. fourteen minutes after routing went live, a small function read the routed project's doc and memory index from disk and appended them to our own prompt, with a fixed size budget and one instruction: don't claim you lack access to something described here without trying it first. it doesn't depend on sdk internals staying put, which we liked.

the first budget was smaller than one real project doc

project context appended to the system prompt, in kb, by version, against what it had to hold

016324864 kbfirst budget, 08-1832 kbone client's project doc39 kbsame afternoon48 kbafter the 08-24 miss64 kba container, measured after22 kb · nothing cutthe first budget would cutthat doc off mid-file.raised 70 minutes later.
source: yeti labs, git history of our project router, 2026-08-18 to 2026-08-24yeti labs · field note 011

the same miss, one level down

the budget went from 32 kb to 48 kb the same afternoon, because one client repo's project doc alone is 39 kb. then it held for six days.

on 2026-08-24 someone in a client channel asked for the response body of a failing application programming interface (api) call. the agent told the channel it had no api keys for the client's logging vendor on that machine. it did. the keys were in a memory note on the same box, next to a note on the export format the client's partner wanted those logs in.

that route pointed at a container. our function loaded the container's memory index, and each repo inside keeps its own memory directory under its own name, so every pointer in them was invisible. one of our containers carries seven of those indexes. same failure as the first one, one directory lower.

the fix loads the memory index of every repo one level under the routed folder, and raised the budget to 64 kb, because cutting an index off mid-list drops exactly the pointer that was going to answer the question. measured after, that client's whole context is 22 kb and no route truncates.

then the fix didn't ship

the next day the same "no keys on this machine" line came back word for word. the fix was committed at 20:49:01, the service restarted at 20:49:37, and the box pulled the new code at 20:52:19. the service booted 2m42s before the code it was restarted for, and ran the old version until we restarted it by hand at 16:06 the next afternoon. the telegram side was worse: it had been up for five days of drift.

while checking, we also found the box's copies of client repos had never been on a schedule. one was seven commits behind main, so the agent was quoting stale line numbers with full confidence.

whenchangewhat it missed
08-18 11:33route each workspace to its project foldercustom prompt replaced the preset, nothing loaded
08-18 11:47read doc + memory index ourselves, 32 kba 39 kb doc gets cut
08-18 12:57budget to 48 kbmemory one level below a container
08-24load child indexes, budget to 64 kb, repo copies synced every 30 minrestart ran before the pull
08-25restart both services onto current code

fwiw we don't have a clean before-and-after count of "i can't reach that" replies. what we have is that the two specific denials stopped once the right code was actually running.

what we'd do instead

  1. if you pass your own system prompt to an agent sdk, assume you've opted out of everything the default one did for you, and load project context explicitly. then ask the agent about something only that context knows before you trust it.
  2. size the context budget from the largest real doc and index you route to, and log when anything gets truncated.
  3. when a folder holds several repos, walk one level down for their docs and memory.
  4. make deploys pull, sync, and restart, in that order, in one script, and keep the box's repo copies on a schedule. an agent reading stale code answers from the wrong file without hesitating.
got an agent that says it can't do things it just did?

we'll find what it was never told.

talk to the agent →