team-harness

Context Management

Long runs generate a lot of conversation. team-harness tracks the coordinator's context occupancy and compacts history before it overflows the model's window.

Context tracking

  • The status bar shows current context occupancy from the latest exact API usage, not cumulative spend.
  • When local changes exist after the last exact usage update, the displayed total may be estimated and prefixed with ~.
  • OpenAI-compatible providers may expose provider-prefixed model ids such as openai/gpt-5.6-sol; model-limit resolution accepts both bare and prefixed forms.

Auto-compaction

  • Auto-compaction runs proactively before a new coordinator turn, once the model-specific threshold is reached. It uses the same tracked total and falls back to a local estimate when provider usage is unavailable.
  • It only runs when the last message role is user, so it never compacts in the middle of a tool exchange.
  • Auto-compaction is always on in v1 and has no public config knob.

Compaction rewrites earlier conversation history into a compact summary via a separate LLM call, preserving the thread of the work while freeing context.

Manual compaction

/compact [focus] runs between turns and rewrites earlier history into a summary for the next turn. Like auto-compaction, it never runs in the middle of a tool exchange.

/compact
/compact keep the API contract and the failing test details

/compact <focus> biases what the summary emphasizes without changing the command-transcript shape the coordinator sees afterward.

Clearing history

/clear (alias /reset) is the manual escape hatch when you want to keep the same session, run log, and agent state but start with a fresh conversation and reset context tracking.

See the CLI Reference for the full list of REPL commands.