Single-provider lock-in
Claude Code is hard-wired to Anthropic.
ax auto-detects keys for Anthropic, OpenAI, Gemini, Ollama, and vLLM. Switch with --provider.
Multi-provider. Local-first. Cost-aware. Secure by default.
ax is a clean-architecture rewrite of what a terminal coding agent
should be — inspired by studying Claude Code, freed from its weaknesses.
$ ax --quality thorough "refactor the auth module to use JWT" [ax] routing thorough → claude-sonnet-4-6 · context budget 1M [ax] loaded knowledge graph (42 nodes, 17 edges) · last decay 2h ago [ax] security scan: 0 secrets, 0 injection patterns ▸ grep pattern="session|cookie|jwt" 12 hits in 4 files ▸ read src/auth/session.ts 211 lines ▸ edit src/auth/session.ts 1 replacement ▸ write src/auth/jwt.ts created ▸ bash bun test src/auth 28 pass · 0 fail [cost] $0.0184 · 12,431 in / 2,118 out · under budget [memory] +3 facts · supersedes jwt-policy@v1 ✓ refactor complete. 2 files changed, 84 insertions(+), 39 deletions(-) $
Bring your own provider
Direct, structural fixes — not lipstick. Each one is enforced in the codebase, not in a style guide.
Claude Code is hard-wired to Anthropic.
ax auto-detects keys for Anthropic, OpenAI, Gemini, Ollama, and vLLM. Switch with --provider.
Empty catch blocks hide real failures.
Result<T,E> monad — every failure is a value you must handle.
Shared singletons make debugging guesswork.
Typed EventBus with ~30 discriminated union events across session, turn, stream, tool, permission, cost, memory, agent.
Single files become un-reviewable monoliths.
Hard 300-line file cap, cognitive complexity ≤ 15, no any, no default exports — all enforced by Biome.
Releases ship on vibes.
253 tests across 35 suites with an 80% coverage threshold for lines, functions, branches, and statements.
Surprise bills, no per-task accounting.
Per-model cost tracker with fast / balanced / thorough tiers that route to the cheapest capable model.
The agent forgets you between sessions.
Knowledge graph at .ax/memory/graph.json — facts, preferences, relations, decay, and contradiction detection.
Secrets and injection patterns slip through.
Built-in scanners: 10 secret patterns (AWS, GitHub, Stripe, JWTs, …) + 7 injection patterns (SQLi, XSS, eval, traversal, …).
Spawning grep for every lookup, dumping raw lines into context.
Trigram-indexed CodeSearch — sub-millisecond lookups, 100–1000× faster than grep, ~106× fewer tokens. Plus DeepSearch, an isolated subagent for repo-wide questions.
any typesEvery subsystem is one directory. Every directory follows the same rules. No globals, no inheritance trees, no frameworks pretending to be your friend.
Result monad, EventBus, config, logger, disposables.
Immutable conversation, query loop, context optimizer.
Anthropic, OpenAI, Gemini, Ollama, vLLM+TurboQuant.
30+ tools, ~50 lines each — file, shell, search, agents, MCP, GitHub, browser.
5 in-memory indexes + trigram CodeSearch (~0.1 ms, 100–1000× faster than grep).
Pure-function rule precedence: CLI > session > project > user.
Per-model tracking with quality-tier routing.
JSON-RPC over stdio bridges any MCP server's tools natively.
Lifecycle-managed extensions with a typed PluginAPI surface.
Knowledge graph with persistence, decay, and contradiction edges.
Secret + injection scanners on every tool output.
Multi-agent orchestrator with an accountability ledger.
React + Ink terminal interface. No Electron. No webview.
Set the keys you have. ax registers what it can reach. Use short aliases — opus,
sonnet, gpt, gemini-pro, gemma-4,
codex.
Opus 4.6, Sonnet 4.6 (1M ctx), Haiku 4.5
ANTHROPIC_API_KEY
GPT-5.4 / mini / nano / pro · GPT-5.3 Codex
OPENAI_API_KEY
3.1 Pro, 3 Flash, 3.1 Flash Lite, 2.5 family
GEMINI_API_KEY
Any local model — Gemma 4, Llama, Qwen, …
localhost:11434
Run 70B+ models on a single GPU with 128K+ context
VLLM_BASE_URL
ax integrates with TurboQuant — ICLR 2026, arXiv:2504.19874 — to compress the KV cache with polar-coordinate transforms and Lloyd-Max quantization. Combine that with ax's client-side context optimizer and you can put 70B+ models behind a single coding agent on commodity hardware.
Inputs validated with Zod; execution partitioned into concurrent-safe and sequential lanes. Tool definitions are ~50 lines each — compare to ~700 lines per tool in comparable systems.
Trigram-accelerated full-text search across the indexed codebase. Returns scored matches with file:line — not raw grep dumps.
~0.1ms · 100–1000× fasterO(1) lookup of any function, class, type, or interface definition by name.
indexedImports, exports, and symbols of a file with line ranges — far cheaper than reading the whole file.
token-efficientForward + reverse dependency graph for any file. Know the impact of a change before you make it.
Indexed file tree with symbol counts. Replaces find/ls sweeps.
Isolated subagent answering repo-wide questions in 15–45s. Returns a cited summary instead of polluting your context.
subagent · context-isolatedFast pattern matching across the workspace.
Ripgrep-powered regex search — there when the indexes can't help.
fallbackLine-numbered output, range-aware, image + PDF support.
Auto-creates parent directories. Atomic.
Exact string replacement with ambiguity detection.
512KB output cap, 2-minute timeout, full env passthrough.
Spin up isolated git worktrees for parallel agent work.
Long-running commands as detached jobs you can poll.
Knowledge-graph reads/writes with relevance decay and contradiction edges.
graph-backedSearch past architectural decisions across sessions.
Cross-model voting for high-stakes calls.
Structured human-in-the-loop prompts mid-task.
Automated code review pass with severity-tagged findings.
Invoke a packaged Skill from inside the loop.
Bridge any MCP server's tools natively over stdio.
Issues, PRs, reviews, releases — directly callable.
Headless browser tools for live page reads and screenshots.
Create, list, get, and update structured task items.
Spawn, list, and converse with subagents in the orchestrator.
Execute against remote sandboxes with the same tool surface.
Bun in, ax out.
curl -fsSL https://bun.sh/install | bash
git clone https://github.com/abduljaleel/ax.git
cd ax/ax && bun install
bun run dev -- doctor
Checks runtime, API keys, and provider reachability.
bun run dev -- --quality balanced "explain this codebase"
any typesax is alpha — and already shipping more guardrails than the agents you pay for.