KlaatAI/klaatcode
Open-source AI coding agent for the terminal. Claude Code-grade accuracy with smart model routing — uses the right AI model for each task, cutting costs 10x. Supports Claude, GPT, Gemini, DeepSeek & more.
What it solves
Klaat Code is a terminal-native AI coding agent designed to provide high-accuracy coding assistance while drastically reducing the cost and token usage associated with large language models. It addresses the common issues of "lost in the middle" context loss, runaway agent costs (doom-loops), and the inefficiency of reading entire files when only specific symbols are needed.
How it works
Klaat Code acts as a thin client to the Klaatu routing service. Instead of using a single model, it uses a smart router (Klaatu-o1) that classifies every request and dispatches it to one of six cost tiers (from nano to titan) based on the task's complexity. It utilizes a server-side code knowledge graph to perform semantic search and impact analysis, allowing the agent to query symbols and callers rather than reading full files. To maintain efficiency, it employs mechanical compaction and noise-filtering of tool outputs to keep the context window clean and affordable.
Who it’s for
It is built for developers who want a terminal-first AI coding agent that can read, edit, and verify its own work with strict cost controls and high reproducibility.
Highlights
- Smart Model Routing: Automatically switches between model tiers per-request to balance cost and performance.
- Code Knowledge Graph: Uses a call graph for semantic search and planning, reducing token usage by 5–15×.
- Cost Guards: Includes a real-time burn-rate monitor, per-task cost attribution, and a "doom-loop" breaker to prevent runaway billing.
- Context Management: Features automatic summarization with a self-check mechanism to verify that critical state wasn't lost during compaction.
- Agentic Toolset: Includes tools for file editing, shell command execution, web search, and multi-agent delegation for scoped work.
- Coded Diagnostics: Automatically runs linters and typecheckers after edits to fix mistakes before returning control to the user.
- MCP Support: Full Model Context Protocol client supporting both stdio and streamable HTTP transports.
Related
- Project
- Project
- Project
- Project
- Project