Every Session Starts Sharp

Context rot as a systems problem, not a prompt problem

The Enemy

Context rot is an architecture problem, not a prompt problem

As a session's context window fills, AI quality quietly degrades. Better prompts, pruning, and resets only manage that symptom — so Amplifier attacks it at the systems-architecture level instead.

First, the shipped primitive that makes architecture-level control real.

The delegate tool ships a real clean-slate primitive

Its two-parameter context system controls how much parent context a task inherits and which content. context_depth: none hands a task a fresh window — the clean slate used to isolate context.

Architecture-level control exists. So why isn't cleaning one window enough?

# delegate: two-parameter context system context_depth: none | recent | all context_scope: conversation | agents | full # none = clean slate, no parent context # tool default is "recent" (5 turns); # "none" is set by workers, reviewers, # and recipe working-session steps

In-session compaction only trims a symptom

The context-simple module compacts messages in place: at a 0.92 token threshold it keeps system messages plus the recent 30%. Useful — but the one window still fills and rots.

Managing one long window is symptom management. The deeper fix isolates context instead.

Disposable sub-agents absorb the exploration cost

A documented pattern: agents are context sinks. One sub-agent burns a ~20-file, ~20k-token exploration in its own window and returns only a distilled ~500-token summary — the parent stays clean.

Exploration cost is quarantined off the orchestrator. Next: where the memory lives.

~20k
tokens from ~20 file reads — consumed inside the sub-agent
~500
token summary returned to the parent window

State lives in files, not the window

A working session is stateless by doctrine — "zero context from previous sessions." STATE.yaml and CONTEXT-TRANSFER.md let a fresh agent re-orient cold and pick up exactly where the last left off.

Memory is off the fragile window and on disk. So the orchestrator can refuse to rot.

# safeguard/STATE.yaml (live) project: safeguard phase: 10 epoch: 4240 next_action: F-939 shadow AI honeypot # CONTEXT-TRANSFER.md: # "Read this at the start of every # session. No exceptions."

The orchestrator never lets its own window rot

By doctrine it does no heavy work — it never reads source, writes code, runs tests, or debugs; it only delegates and reads/writes state. And it watches its own token pressure, self-spawning a fresh instance rather than degrading.

Structural isolation over discipline. Does it survive real production work?

60%
soft threshold — prepare handoff, spawn self
80%
hard threshold — mandatory spawn, no exceptions

It holds at scale on a real production project

Safeguard is the flagship dev-machine target. It shipped 215 completed features across 2,324 commits — 233 authored by autonomous agents — each session re-orienting cold from a 260-line STATE.yaml. No window was ever allowed to rot.

Fresh-session-by-design survived hundreds of features. Here's the portable rule.

215
completed features tracked in STATE.yaml
2,324
total git commits
233
commits by autonomous agents (Dev Machine 168, Monitor 65)
260
lines in the live STATE.yaml re-read cold each session
The Principle

Treat the window like a CPU register, not a database

Don't discipline one long window — isolate context by architecture. Fresh sessions per unit of work, disposable sub-agents as sinks, cold reviewers, and files as memory. Then every session starts sharp by design.

Sources

Sources & Research Methodology

Data as of: April 6, 2026 (safeguard HEAD)

Feature status: Shipped — delegate context control, context-sink pattern, thin-orchestrator self-spawn, stateless sessions + recipes, file-based state, and model routing all verified in live repos.

Repos: microsoft/amplifier-foundation & microsoft/amplifier-module-context-simple (foil); ramparte origins for amplifier-bundle-self-driving, amplifier-bundle-dev-machine, amplifier-bundle-routing-matrix, amplifier-safeguard.

Commands run (every metric re-derived from live output):

Gaps / corrections: The delegate tool default is "recent" (not "none"); "none" is set explicitly by workers, reviewers, and recipes. Self-spawn thresholds are 60% / 80% (no steady-state 30-40% figure). "233 autonomous-agent commits" replaces any "thousands of sessions" claim (session ≠ commit count).

Primary contributors: Brian Krabach (delegate tool, routing-matrix); Sam Schillace (self-driving 8/8, safeguard 2,091, dev-machine 80); Marc Goodner (dev-machine 76).

More Amplifier Stories