Luxe

Context and compaction

What reaches the model, and what happens when it fills.

Output compression

Noisy command output is deterministically compressed before it reaches the model, so build/test/lint logs don’t burn the context window:

  • Deterministic + local — no LLM, offline-safe, golden-file testable (ANSI/progress/duplicate lines stripped, long logs truncated).
  • Signal preserved — errors, warnings, failing tests, file:line locations, exit codes, and auth prompts are always kept, wherever they sit in the log (not a blind head/tail cut).
  • Recoverable — when output is reduced, the full untouched output is saved under .luxe/artifacts/ and its path is included; a [compressed 2693→549 tok, -80%] footer reports the savings. Set LUXE_COMPRESS=0 to disable.

The search/listing tools (grep, glob, git diff/log) and unbounded reads are separately line-capped before they reach the model — the first N matches/files/lines plus a … N more note that points you at a narrower query — so a broad search can’t flood the context window either.

This is separate from and complementary to conversation compaction (below): output compression shrinks what enters context at capture-time; compaction summarizes old turns when context fills.

Compaction

Long conversations are automatically compacted to stay within the model’s context window:

  • Auto-trigger: When context tokens exceed (context_window - reserve_tokens) (default reserve: 16k)
  • Manual: Run /compact [focus] in the TUI
  • Structured summary: Generates a structured summary with Goal, Progress, Key Decisions, Next Steps, etc.
  • Same-session or handoff: Default keeps the session; opt-in handoff creates a new session seeded with the summary