Syntax

Agent Handoff

When the context window fills up, Syntax writes a structured handoff and starts fresh — instead of in-place compaction that loses the thread.

Long sessions inevitably fill the context window. Most agents handle this with compaction: throwing away the older parts of the conversation, sometimes summarizing them, sometimes just truncating. The result is that the agent loses track of the original goal, forgets decisions you discussed early on, and starts to drift.

Syntax takes a different approach. When the context window approaches its limit (around 80–90% utilization), Syntax does an Agent Handoff:

  1. The current agent writes a structured, schema-conformant snapshot of the work so far — the goal, the decisions, the files touched, the open questions, the next steps.
  2. The snapshot is saved to durable storage in your home directory.
  3. A fresh agent starts with an empty context primed only by a "resume" instruction that points at the snapshot.

The new agent reads the snapshot, picks up where the previous one left off, and keeps going. The user-visible effect is "the conversation feels like it just keeps going indefinitely". The technical effect is "every turn always has a clean context window".

Why this is better than compaction

Compaction is lossy by construction. Either you summarize (and the summary is wrong in subtle ways) or you truncate (and the agent forgets what mattered). Handoff is an explicit checkpoint: the schema captures exactly what's needed to resume, and the new agent doesn't carry any of the old turn-by-turn churn.

What's in a handoff

The schema is intentionally lean. Roughly:

  • The original goal and any clarifying answers.
  • A summary of what's been done so far, organized by step.
  • The list of files that have been changed, with intent (e.g., "edited but not yet tested").
  • Open questions that need answers before the next step.
  • The next step.

What happens to the old conversation

It stays in your session history. If you want to scroll back, search it, or fork from a particular point, it's there. The handoff doesn't delete anything — it's a resume primitive, not an archive primitive.

Compaction is still the fallback

The classic in-place compaction (/compact in supported harnesses) is still available if you want it for a specific session. Handoff is the default at the long-context threshold, but you can always force the older behavior.

  • Plan Mode — the front-end version of the same idea: separate planning context from execution context.
  • Runtime Modes — how individual tool calls are gated within a turn, regardless of context length.