By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
An engineer spent three days in one debugging session. By the end it held seventy turns. It carried a root-cause theory that was already disproved. It also held tool output from a branch reverted on Tuesday, and a plan written before anyone read the router code.
The model kept proposing fixes that had already failed, and the engineer kept pasting more logs. When a second engineer took over, she could not tell which facts in the transcript were still true.
The context window was not too small. The working set was stale. Nothing in it marked a claim as dead.
A session holds claims, plans, tool output and dead ends in one flat history. As turns accumulate, an old claim keeps the same authority as fresh evidence, because nothing ranks them.
Three events mean the working set has changed. A fact was disproved. The plan was replaced. The task changed hands. Each one is a checkpoint, not a reason to keep going.
Session hygiene is also a data decision. A transcript is a dataset you did not plan to create, and it lives wherever the surface keeps it.
Write down the retention rule for each surface you use, and check it before you paste. On a shared machine, a long-lived session is also a file that other people may read.
A plugin bundles commands, agents, hooks and often MCP servers. Installing one changes what the agent can do and what it can reach. That is the risk profile of a dependency that can run code.
Treat it the way you treat a package. Read the manifest before you install. Pin a version. Grant the narrowest scope that works. Remove it when the task ends, and note in the repository why it was there.
| Check | Why it matters | What good looks like |
|---|---|---|
| Source | A plugin can ship hooks that run commands | A reviewed repository, not a link from a chat reply |
| Scope | Most plugins ask for more access than the task needs | Read-only tools unless a write is the point |
| Version | An update can add a tool or a hook | A pinned version in the project, reviewed on change |
| Removal | Access outlives the task that needed it | Uninstalled at the end, with the reason recorded |
SESSION = {
"goal": "Why does ticket 8821 route to the wrong queue?",
"turns": 64,
"facts": [
{"claim": "router reads the subject only", "source": "router.py:41",
"status": "confirmed"},
{"claim": "the cache serves a stale queue", "source": "cache.py:12",
"status": "disproved"},
],
"open_questions": ["does the retry path re-read the queue?"],
}
LIMITS = {"turns_before_checkpoint": 40}
def health(session):
problems = []
if session["turns"] > LIMITS["turns_before_checkpoint"]:
problems.append("past checkpoint: write a handover")
for fact in session["facts"]:
if fact["status"] == "disproved":
problems.append("still carried: " + fact["claim"])
if not session["open_questions"]:
problems.append("no next question: the task may be drifting")
return problems
def handover(session):
live = [f for f in session["facts"] if f["status"] == "confirmed"]
return {
"goal": session["goal"],
"facts": [f"{f['claim']} ({f['source']})" for f in live],
"next": session["open_questions"][0],
}
for note in health(SESSION):
print(note)
print(handover(SESSION))Use a session you have open right now.
Key takeaways
A long session is a stale working set, not a richer memory.
Checkpoint when a fact is disproved, the plan changes, or the task changes hands.
A handover carries confirmed facts with sources, ruled-out causes and the next test.
Secrets, customer data and production dumps do not belong in a session.
A plugin is a dependency: review the source, pin the version, limit the scope, remove it when done.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.