# hax

> A minimalist, terminal-native coding agent written in C that supports local and cloud LLMs with a tiny memory footprint.

hax is a minimalist, terminal-native coding agent written in C by Oleksandr Chekhovskyi, released under the MIT License. It runs as a single native binary with a small dependency set, starts instantly, and uses only a few megabytes of RAM — leaving more headroom for local LLMs. The project is fully open source on GitHub and available for Linux, macOS, and Windows (via WSL).

## What It Is

hax is a command-line coding agent designed for developers who live in the terminal and want a lightweight, auditable AI assistant without the overhead of plugin runtimes, IDE panels, or MCP marketplaces. It operates as an interactive REPL or a one-shot prompt runner (`-p` flag), and it can resume past sessions by directory. The agent sends prompts to a connected LLM provider, streams the response with Markdown rendering, and executes tool calls — all within the native terminal without hijacking scrollback or the display.

## Provider and Model Support

hax supports a broad range of LLM providers out of the box:

- **OpenAI** (and compatible endpoints) via `OPENAI_API_KEY`
- **Anthropic** (and compatible endpoints) via `ANTHROPIC_API_KEY`
- **Codex** via the official `codex` CLI and a ChatGPT subscription
- **OpenRouter** via `OPENROUTER_API_KEY`
- **llama.cpp** — run `llama-server` locally, then `hax --provider llama.cpp`
- **Ollama** — run `ollama serve`
- Custom or compatible endpoints via `docs/providers.md`

Local models are treated as first-class: hax auto-discovers the model and runtime capabilities from a running `llama-server`, requiring no custom provider config block for the default setup.

## Design Philosophy and Target Audience

The project's `docs/philosophy.md` explicitly documents each feature omission and the Unix-composition pattern that covers the need instead. hax deliberately avoids MCP marketplaces, plugin runtimes, IDE panels, and per-command permission prompts. Its target audience, as stated in the README, includes developers who live in the terminal, run local models, audit what their tools do, package software for distros, or run agents where resources are scarce.

Key design choices include:
- **XDG paths** and plain-text config and session files
- **Clean stdout** in `-p` one-shot mode with resume hints on stderr
- **Composition via subprocesses** instead of a plugin system
- **Transcript view** (Ctrl+T) showing exactly what was sent to the model and what it replied
- **Optional wire protocol trace** for deep debugging

## Setup Path

hax installs via Homebrew on macOS or Linux (`brew install oleksandrchekhovskyi/hax/hax`), from the AUR on Arch Linux, or as a prebuilt static binary (x86_64 or aarch64) from the GitHub releases page. Building from source requires a C compiler, libcurl, jansson, meson, ninja, and pkg-config; a helper script (`scripts/install_deps.sh`) handles dependency installation on Debian/Ubuntu, Fedora, Arch, openSUSE, Alpine, and macOS.

## Update: hax v0.3.0

The latest release is **v0.3.0**, published on 2026-08-12. The repository was created in April 2026 and has seen active development, with the last push on 2026-08-13. The project has accumulated 217 stars and 10 forks on GitHub, signaling early community traction for a tool that positions itself as a resource-efficient alternative to heavier coding agents.

## Features
- Single native C binary with minimal dependencies
- Interactive REPL and one-shot prompt mode (-p flag)
- Session resume by directory (--resume)
- Streaming Markdown rendering in terminal
- Live tool output without hijacking scrollback
- Transcript view showing full model conversation (Ctrl+T)
- Optional wire protocol trace for debugging
- Auto-discovery of llama.cpp model and runtime capabilities
- Supports OpenAI, Anthropic, Codex, OpenRouter, llama.cpp, Ollama
- XDG paths and plain-text config/session files
- Clean stdout in one-shot mode with resume hints on stderr
- Composition via subprocesses instead of plugins
- @file completion via fzf
- Prebuilt static binaries for x86_64 and aarch64
- Homebrew and AUR package support

## Integrations
OpenAI API, Anthropic API, OpenRouter, llama.cpp, Ollama, Codex CLI, Homebrew, AUR (Arch Linux), fzf

## Platforms
WINDOWS, MACOS, LINUX, API, CLI

## Pricing
Open Source

## Version
v0.3.0

## Links
- Website: https://usehax.dev
- Documentation: https://github.com/OleksandrChekhovskyi/hax#readme
- Repository: https://github.com/OleksandrChekhovskyi/hax
- EveryDev.ai: https://www.everydev.ai/tools/hax
