What the agent sees: its context
List what is actually in the agent's context at a given step: your prompt, instruction files, the files it chose to open and the tool outputs it received. Explain that anything outside that context is invisible to it except through general training knowledge.
It ignored the helper you pointed at
Some Go code in your project calls a web service. It fails when the server answers `503` ("temporarily unavailable, try again"). You tell the agent: "fix it, use our usual retry helper".
Your project already has that helper: `httpx.Retry` in `internal/httpx/retry.go`. It re-sends a failed request a few times. You even had that file open in your editor.
The agent writes a brand-new retry loop instead and reports: "No existing retry helper found, so I added one." Why didn't it find yours?
It works only from its context
At each step the agent sees only its **context**, the text actually fed to the model at that step:
- your messages
- the instruction files its tool loads (project rule files read in automatically)
- the files, or parts of files, it opened
- the outputs of commands it ran
The rest is invisible: other files in your repo, your editor tabs (unless the tool attaches them), CI pages, team decisions. It fills gaps from general training knowledge of what such code *usually* looks like. **Later cost:** parallel helpers and ignored conventions that you then have to maintain.
Listing what it saw at a step
Read the transcript (the session log of messages, commands and their results) up to that step and collect:
1. **Your messages** so far.
2. **Instruction files** the tool loaded. Check which ones.
3. **Files it opened**, and only the lines it actually read.
4. **Tool outputs** it received: searches, test runs, errors, exactly as returned (possibly cut short).
Rule: if you can't point to where X entered its context, assume it never saw X.
The agent's actual steps
This is everything the agent ran before writing code. The first search printed nothing, and that empty output is all it learned from it. A repo-wide `grep -rn "Retry" .` would have printed a match in `internal/httpx/retry.go`. The test output told it about the `503`, not about your helper. **Tell:** its summary says "no existing retry helper found", but it only searched `./client`, far less than that claim covers. **Later cost:** two retry implementations whose limits and backoff drift apart, so a fix to one misses the other.
// Go
$ grep -rn "Retry" ./client
$ go test ./client/...
--- FAIL: TestFetch (0.31s)
fetch_test.go:22: status 503
FAIL
FAIL example.com/app/client 0.42s
$ cat client/client.go
package client
import "net/http"
...
Walking the retry case through
Checklist:
- Your message said "our usual retry helper" but gave no name or path.
- The instruction file doesn't mention `httpx`.
- The only files it opened are in `client/`. Your open editor tab never shows up in the transcript, so it wasn't attached.
- The tool outputs show a 503 and an empty search.
So "usual helper" pointed at nothing, and it wrote the retry loop most Go code has. **Better:** "Use `httpx.Retry` from `internal/httpx/retry.go`", or ask it to search the whole repo first.
Remember
The agent knows your project only through its context: your messages, loaded instruction files, the files and lines it opened, and the tool outputs it got. Everything else it fills in from general knowledge. If something matters, make sure it lands in that context.
On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.