v0.1.0-alpha · provider-agnostic · open source

The AI coding agent built without the trade-offs.

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.

  • 5providers
  • 30+built-in tools
  • 253tests · 35 suites
  • ~0.1mscode search
  • 100–1000×faster than grep
  • 6.4×KV compression
~/projects/auth-service — ax
$ ax --quality thorough "refactor the auth module to use JWT"

[ax] routing thoroughclaude-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

  • Anthropic
  • OpenAI
  • Google Gemini
  • Ollama
  • vLLM + TurboQuant
  • MCP servers

Nine problems with today's coding agents.
ax fixes all of them.

Direct, structural fixes — not lipstick. Each one is enforced in the codebase, not in a style guide.

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.

Errors silently swallowed

Empty catch blocks hide real failures.

Result<T,E> monad — every failure is a value you must handle.

Global mutable state

Shared singletons make debugging guesswork.

Typed EventBus with ~30 discriminated union events across session, turn, stream, tool, permission, cost, memory, agent.

God files (10,000+ lines)

Single files become un-reviewable monoliths.

Hard 300-line file cap, cognitive complexity ≤ 15, no any, no default exports — all enforced by Biome.

No real test suite

Releases ship on vibes.

253 tests across 35 suites with an 80% coverage threshold for lines, functions, branches, and statements.

Zero cost visibility

Surprise bills, no per-task accounting.

Per-model cost tracker with fast / balanced / thorough tiers that route to the cheapest capable model.

No persistent memory

The agent forgets you between sessions.

Knowledge graph at .ax/memory/graph.json — facts, preferences, relations, decay, and contradiction detection.

No security scanning

Secrets and injection patterns slip through.

Built-in scanners: 10 secret patterns (AWS, GitHub, Stripe, JWTs, …) + 7 injection patterns (SQLi, XSS, eval, traversal, …).

Slow, naive code search

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.

ax, by the numbers.

5LLM providersAnthropic · OpenAI · Gemini · Ollama · vLLM+TQ
30+built-in toolsread, edit, bash, glob, grep, codesearch, …
5in-memory indexescontent · outline · word · trigram · deps
~0.1mstrigram querystructured matches, not raw grep dumps
100–1000×faster than grepon indexed repos · CodeSearch tool
106×token savingsvs dumping raw grep output to the LLM
17security patterns10 secret + 7 injection scanners
~30typed eventsdiscriminated-union EventBus
253tests · 35 suites80% coverage threshold enforced
≤300lines per filecomplexity ≤ 15, 0 any types
6.4×KV compressionTurboQuant · 8× attention speedup
1Mcontext windowSonnet 4.6 · Opus 4.6

A kernel small enough to hold in your head.

Every subsystem is one directory. Every directory follows the same rules. No globals, no inheritance trees, no frameworks pretending to be your friend.

core

Result monad, EventBus, config, logger, disposables.

engine

Immutable conversation, query loop, context optimizer.

providers

Anthropic, OpenAI, Gemini, Ollama, vLLM+TurboQuant.

tools

30+ tools, ~50 lines each — file, shell, search, agents, MCP, GitHub, browser.

intelligence

5 in-memory indexes + trigram CodeSearch (~0.1 ms, 100–1000× faster than grep).

permissions

Pure-function rule precedence: CLI > session > project > user.

cost

Per-model tracking with quality-tier routing.

mcp

JSON-RPC over stdio bridges any MCP server's tools natively.

plugins

Lifecycle-managed extensions with a typed PluginAPI surface.

memory

Knowledge graph with persistence, decay, and contradiction edges.

security

Secret + injection scanners on every tool output.

agents

Multi-agent orchestrator with an accountability ledger.

ui

React + Ink terminal interface. No Electron. No webview.

Five providers. One CLI. Zero config to switch.

Set the keys you have. ax registers what it can reach. Use short aliases — opus, sonnet, gpt, gemini-pro, gemma-4, codex.

Anthropic

Opus 4.6, Sonnet 4.6 (1M ctx), Haiku 4.5

ANTHROPIC_API_KEY

OpenAI

GPT-5.4 / mini / nano / pro · GPT-5.3 Codex

OPENAI_API_KEY

Gemini

3.1 Pro, 3 Flash, 3.1 Flash Lite, 2.5 family

GEMINI_API_KEY

Ollama

Any local model — Gemma 4, Llama, Qwen, …

localhost:11434
native local inference

Run frontier-class local models. With ax.

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.

  • 6.4× memory compression — fit longer contexts on the same GPU.
  • 8× attention speedup on H100 at 4-bit precision.
  • 3-bit zero-loss — quality-neutral at 3.5 bits.
  • Native Gemma 4 support via MLX and vLLM.
  • Client-side optimizations: prompt compression, adaptive windowing, tool-output truncation, token estimation.

30+ built-in tools. Sub-millisecond search.

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.

Searchfaster than grep

CodeSearch

Trigram-accelerated full-text search across the indexed codebase. Returns scored matches with file:line — not raw grep dumps.

~0.1ms · 100–1000× faster

CodeSymbol

O(1) lookup of any function, class, type, or interface definition by name.

indexed

CodeOutline

Imports, exports, and symbols of a file with line ranges — far cheaper than reading the whole file.

token-efficient

CodeDeps

Forward + reverse dependency graph for any file. Know the impact of a change before you make it.

CodeTree

Indexed file tree with symbol counts. Replaces find/ls sweeps.

DeepSearch

Isolated subagent answering repo-wide questions in 15–45s. Returns a cited summary instead of polluting your context.

subagent · context-isolated

Glob

Fast pattern matching across the workspace.

Grep

Ripgrep-powered regex search — there when the indexes can't help.

fallback

File & shell

Read

Line-numbered output, range-aware, image + PDF support.

Write

Auto-creates parent directories. Atomic.

Edit

Exact string replacement with ambiguity detection.

Bash

512KB output cap, 2-minute timeout, full env passthrough.

Worktree

Spin up isolated git worktrees for parallel agent work.

Background

Long-running commands as detached jobs you can poll.

Agents, memory, & integrations novel

Memory

Knowledge-graph reads/writes with relevance decay and contradiction edges.

graph-backed

RecallDecisions

Search past architectural decisions across sessions.

Consensus

Cross-model voting for high-stakes calls.

AskUser

Structured human-in-the-loop prompts mid-task.

Review

Automated code review pass with severity-tagged findings.

Skill

Invoke a packaged Skill from inside the loop.

MCP

Bridge any MCP server's tools natively over stdio.

GitHub

Issues, PRs, reviews, releases — directly callable.

Browser

Headless browser tools for live page reads and screenshots.

Tasks

Create, list, get, and update structured task items.

Agents

Spawn, list, and converse with subagents in the orchestrator.

Remote

Execute against remote sandboxes with the same tool surface.

Sixty seconds to your first run.

Bun in, ax out.

  1. 1. Install Bun

    curl -fsSL https://bun.sh/install | bash
  2. 2. Clone & install

    git clone https://github.com/abduljaleel/ax.git
    cd ax/ax && bun install
  3. 3. Verify your environment

    bun run dev -- doctor

    Checks runtime, API keys, and provider reachability.

  4. 4. Run your first task

    bun run dev -- --quality balanced "explain this codebase"

Engineering rules ax refuses to break.

≤ 300lines per file
≤ 15cognitive complexity
0any types
0empty catch blocks
0default exports
0global mutable state
80%coverage threshold
253tests · 35 suites
strictTypeScript everywhere
~50lines per tool
17security patterns
~0.1mscode search

Stop renting your coding agent. Own it.

ax is alpha — and already shipping more guardrails than the agents you pay for.