Shift Note: Keep the Agent Context Lean
Keep the current task visible in the session
A coding agent can only make good decisions from the information it can currently use. Context hygiene means keeping the session focused on the work in progress and removing material that no longer affects the next decision. The goal is not to make the conversation short for its own sake. The goal is to make the important facts easy for the agent to find and trust.
At the start of a task, keep the requested outcome, relevant constraints, repository conventions, and the files that define the behavior. If the task is to fix an authentication bug, the useful context may include the login handler, token validation code, related tests, the error report, and the expected security behavior. A long discussion about an unrelated dashboard change adds noise even if it happened in the same session.
Drop stale plans after the implementation changes
Plans are useful until the code or requirements change. After that point, an old plan can quietly become an instruction to do the wrong thing. Remove or correct statements such as “the service uses a queue” when the implementation has moved to direct calls, or “this endpoint is internal” when it is now exposed to customers.
A practical habit is to keep one short current-state note. It should say what has been verified, what remains uncertain, and what must not change. Replace it whenever the facts change. Do not keep several competing summaries and expect the agent to reconcile them correctly.
Keep evidence, not every investigation step
Agents often inspect many files before finding the relevant one. The final session does not need every failed search, speculative theory, or repeated directory listing. Keep the evidence that supports a decision: the failing test output, the relevant stack trace, the configuration value, or the small code excerpt that explains the behavior.
Drop duplicate logs and compress repeated observations into one sentence. For example, “The worker retries three times and then records a permanent failure” is more useful than several pages of identical retry messages. Preserve exact values when they matter, especially error codes, timestamps, request identifiers, and version constraints.
Separate durable instructions from temporary observations
Some context should remain available throughout the repository, while other context belongs only to the current task. Coding style, test commands, security rules, and architectural boundaries are durable instructions. A single failing fixture, a temporary branch name, or a one-off production symptom is temporary evidence.
Put durable rules in the project’s normal instruction files or documentation when the tool supports them. Keep temporary observations in the session or issue record. This separation prevents a short-lived workaround from becoming a permanent rule that shapes future changes.
Trim context before switching models or tools
Different coding agents can work from the same repository, but they do not need the same transcript. Before moving from Claude Code to Codex, Gemini CLI, or an OpenAI SDK client, create a compact handoff containing the goal, files changed, checks already run, current failure, and the next recommended action. This is more reliable than forwarding a raw conversation full of exploratory turns.
Model choice can also affect how much context is practical. A focused task may fit comfortably with Claude Haiku 4.5, while a larger code investigation may benefit from Claude Opus 5.5 or GPT-6.1 Sol. Regardless of the model, a clean handoff improves the result because the agent receives decisions and evidence instead of conversation residue.
Use a relay desk when access needs to stay flexible
Relay365 fits teams that need pay-as-you-go access to multiple model families while keeping their coding tools pointed at one relay desk. It works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. The API base is https://api.api365relay.com; OpenAI clients add /v1. That can be useful when a task moves between models without changing the surrounding workflow.
Keep the relay configuration in environment variables or the project’s approved secret store, and keep credentials out of the context itself. Members can also earn a referral bounty when invited users pay. Create a Relay365 account when a multi-model coding workflow and pay-as-you-go billing match your operating needs.
Close the shift with a compact handoff
Before ending a session, leave five facts: the intended result, the files changed, the checks that passed, the known issue that remains, and the exact next step. Drop everything that does not help another agent or engineer continue safely. A small, current handoff is the final form of context hygiene, and it gives the next session a clean starting point.
Further desk bulletins
| Date | Bulletin title | Filed under | Language |
|---|---|---|---|
| 2026-10-26 | Shift note: PR review with an agent and a checklist | Agent shift notes | EN |
| 2026-10-26 | Shift Note: Tests Before the AI Writes the Function | Agent shift notes | EN |
| 2026-10-26 | Duty Log: Pairing With an AI Agent During an Alert | Agent shift notes | EN |
| 2026-10-26 | Desk note: Claude Desktop is not a relay client | Agent shift notes | EN |
| 2026-10-26 | Shift Note: Cline and Roo on a Fixed Monthly Budget | Agent shift notes | EN |
| 2026-10-26 | Desk Note: Cursor Custom Provider Setup | Agent shift notes | EN |
Curious how it runs on your own code? Sign up →