All notable changes to Klaat Code are documented here. Format follows Keep a Changelog; versions follow SemVer.
- Prompt-cache savings in the sidebar — the Context panel now shows
Cached N (X% of input)when the server's prompt cache is hitting, so you can see the cost saving in real time. - Honest context meter — the Context panel shows the active model's real window (not a misleading sum of all tiers), a
Compact at %indicator, and cumulativeProcessedtokens since the last compaction.
- Cleaner tool-call display — reads, edits, and commands now render as a single tidy line (Claude-style), colour-coded by status (green ok / red fail), and expand on demand. No more three-line content dumps cluttering the transcript.
- Window-aware compaction — context compaction now triggers at ~78% of the active model's window instead of a fixed 60K threshold, so it works correctly on every tier — including small ones where it previously never fired.
- Tier context windows aligned with the server — removes a double-trim that could shrink your working context more than intended.
- Context no longer pins at 100% / stalls — compaction reliably frees space as context fills, on every tier (the old threshold was larger than the small-tier window, so it never ran).
- "Continue" no longer loops — after an exploration-budget pause, continuing no longer re-reads the same files and hits the identical wall; the agent gets more room plus a directive to act on what it already has.
- No false "agent may be stuck" pauses on analysis — deep read/analysis tasks (e.g. comparing large datasets) are no longer stopped mid-way. The pause now fires only on a genuine repetition loop, and producing a real answer counts as progress.
- MCP file writes now tracked — files written via MCP filesystem tools appear in Modified Files and support
/undo(previously showed "Modified Files 0" despite successful writes).
- Several routing improvements ship server-side and roll out automatically (no CLI update needed): heavy / multi-file conversations auto-escalate to a larger-window model so builds don't stall; mechanical build steps (writing files, running commands) use the faster code tier instead of the slower reasoning tier; large prompts prefer cache-capable models to cut cost.
- Windows browser auto-open — Now tries 3 methods in sequence:
explorer.exe(most reliable, no shell interpretation),powershell.exe Start-Process, andrundll32 url.dllas final fallback. Covers machines where PowerShell is blocked or not in PATH. - URL not copyable in TUI — When browser fails to open, the auth URL is now auto-copied to clipboard (
clipon Windows,pbcopyon macOS,xclipon Linux). User sees "URL copied to clipboard — paste in browser" instead of trying to select text from the TUI alt-screen.
- Version display — Splash screen now shows "KlaatCode v2.2.8" instead of hardcoded "CLI v0.1.0".
- Fallback URL overflow — When browser fails to auto-open, the auth URL no longer bleeds into other UI components. Long URLs are now wrapped to fit the terminal width.
- Fallback URL visibility — Auth URL displayed in blue underlined text, auto-detected as clickable by modern terminals (Windows Terminal, iTerm2, VS Code terminal).
- Windows login STILL broken —
cmd.exetruncates URL at&even viaspawn. The v2.2.5 fix usedspawn("cmd.exe", ["/c", "start", "", url])but cmd.exe processes&as a command separator regardless of how it's invoked. Switched topowershell.exe Start-Processwhich correctly handles URLs containing&,=, and other special characters without interpretation. Windows users will now see the full auth page with all parameters intact.
- Windows (and all new installs) pointed at localhost instead of production API. The default
baseUrlinDEFAULT_CONFIGwashttp://127.0.0.1:8765(the local dev server). Fresh installs with no~/.klaatai/config.jsonwould open the browser tohttp://localhost:4410/klaatu/cli-auth— which doesn't exist on user machines. Default is nowhttps://api.klaatai.com, so login correctly openshttps://klaatai.com/klaatu/cli-auth. Existing installs with a config file are unaffected.
- Claude Code skills compatibility —
.claude/skillsdirectory is now auto-discovered alongside.klaatai/skills. Thanks @syf2211! (#43) /exportslash command — export the current session to a Markdown file. Thanks @Ayush7614! (#45)- Swift, PHP, Kotlin, Shell post-edit diagnostics — the feedback loop now runs
swiftc,php -l,kotlinc, andshellcheckwhen available. Thanks @Ayush7614! (#44)
- Windows login broken — browser auth now works on Windows. Three issues combined to break the OAuth redirect on Windows: (1)
cmd.exe'sstartcommand misinterpreted&in the login URL as a command separator, truncating query params — fixed by usingspawnwith an explicit arg array that bypasses shell interpretation; (2) the local callback server bound only to127.0.0.1which some Windows firewall configs block — now binds to0.0.0.0on Windows; (3) the redirect URI used127.0.0.1which some browsers resolve to IPv6[::1]— now useslocalhoston Windows for correct resolution. (#47)
- Shell completions (bash / zsh / fish).
klaatcode completions bash|zsh|fishprints a static completion script — works in the compiled binary without reading from disk. Covers bothklaatcodeandklaataibinary names. Thanks @Ayush7614! (#46)
pull-from-public.shnow recommendspatch -p1instead ofgit apply(which silently skips patches in monorepo layouts).- Fallback URL display — if the browser doesn't open on any platform, the full login URL is printed to the terminal after 2 seconds so users can copy-paste manually.
Six features no other CLI coding agent ships built-in — token efficiency and runaway-protection, all on by default, all with an off switch. Plus the first two community contributions.
- Tokyo Night theme (
/theme tokyo-night) — deep navy with cool blue & green accents. Thanks @floze-the-genius! (#40) - Ruby diagnostics — post-edit feedback loop now runs
rubocopon.rbfiles when it's on PATH. Thanks @siddhanttiwari19! (#41)
-
Tool-output noise filter (
outputFilter). 60–75% of command-output tokens are noise you pay for on every later request. Progress bars now collapse to their final frame, long runs of passing tests collapse to a count ([✓ 40 passing tests — collapsed]), repeated lines dedupe, ANSI codes and carriage-return spinner frames are cleaned up. Failures, exit codes, and summary lines are always kept in full, and the filter fails open — any doubt, you get raw output. -
plan_explorationtool — a query optimizer for code. Before reading anything, the agent can ask for the optimal file-read order for a task: files you named (full read), files defining matched symbols (targeted section at the right line), and their callers (outline only). Derived from the local code graph; the system prompt tells the agent to use it first on any multi-file task. No other CLI plans its reads. -
Attention-ordered context (
attentionOrder). Models attend most strongly to the start and end of their context window ("lost in the middle"). Older history is now arranged so the highest-relevance turns sit at the context edges and exploration noise is buried in the middle. Tool-call/result pairs never split; recent turns and the system prompt never move. -
Budget guards. Real-time burn-rate tracking with a warning when spend runs 3× your session average; per-task cost attribution and a phase breakdown in
/cost; an optional hard session cap (maxSessionCost) that pauses agent rounds instead of burning on;klaatcode run --max-cost <usd>for CI and cron (exit code 3). No other CLI monitors spend rate. -
Per-phase token budgets (
phaseBudgets). The classic stuck-agent failure — the whole budget burned exploring before a single line is written — is now caught directly: tokens are attributed to explore/implement/verify phases, and exploration that exhausts its budget without producing an edit pauses and asks instead of continuing. -
Context-collapse detection. Compaction is lossy and normally silent. Klaat Code now snapshots the critical state (your task in your own words + the files being modified) to the session ledger before compacting, mechanically verifies the summary still covers it after, and — when something was lost — injects a recovery note telling the model exactly what it forgot and where to re-read it. First CLI that can tell you it forgot something.
-
/contextcommand. See what's actually in the model's window (message counts, token estimate, degraded tool results) vs. what's been compacted away, plus the ledger path where compacted details stay recoverable. -
Server doom-loop reaction. Klaatu detects when the agent repeats the same tool call with identical arguments and identical results; the CLI now refuses that round, injects recovery guidance ("change approach — don't repeat the call"), and stops entirely after three refusals. Works in the TUI and headless runs. Pairs with the existing no-tool-call-limit design: unlimited productive loops, zero tolerance for stuck ones.
-
Server retry contract honored.
X-KlaatAI-Retry: no(the server's failover cascade already exhausted every fallback) is never blindly retried;after-<s>schedules exactly one retry; waits over 60 s surface as errors instead of hanging your terminal. -
Benchmark refresh — 33-task suite, model-variant lanes (2026-07-20). Suite grown to 33 tasks (5 long-context). New adapters: Claude Code on Sonnet 5, opencode on Nemotron 3 Ultra (promo-free tokens priced at published paid rates), and Cursor via both Composer 2.5 variants (
cursor-agent, plus acursor-ide-bench.tsIDE-chat lane with an objective check-script referee for when the headless CLI is unusable). Results: Klaat Code 33/33 at $0.027/solve and 23s median/task — 5.4× cheaper than Claude Code, 1.7× cheaper than the nearest rival, and no rival is both cheap and fast (Composer 2.5 standard: within 1.7× on cost but ~113s/task). Interactive cost curves + per-task comparison: klaatai.com/benchmarks.
- Installer channels served the retired 1.x line.
klaatai.com/api/latestand the curl installer's npm fallback pointed at the oldklaatcode-aipackage — when the GitHub API was unreachable they reported/installed1.15.xinstead of the current CLI. Both now resolve theklaatcodepackage. The Windows installer also stopped requesting the discontinuedwindows-arm64asset (Windows-on-ARM uses the x64 binary via built-in emulation).
- All new behaviors are on by default. Opt out per feature in
~/.klaatai/config.json:outputFilter,attentionOrder,phaseBudgets("off"),maxSessionCost(unset). - New docs: Configuration, Commands, CLI reference.
Pre-changelog era: smart per-request tier routing, code knowledge graph (impact_check, semantic search), 28-tool agentic loop, tier-aware toolset dialects, fuzzy 9-pass edit engine, apply_patch, real plan mode, background sub-agents, MCP (stdio + HTTP + OAuth), hooks v2, skills v2, plugins, retention-aware compaction + session ledger, sessions/resume, write sandbox, post-edit diagnostics, published 4-way benchmark (equal accuracy at 18% of Claude Code's cost). See the README and git history.