Tau (GitHub Repo)
Tau is a lightweight, terminal-based coding agent designed as an accessible teaching project for understanding agent architecture.
Deep dive
- Tau separates the model interface from the core agent harness.
- It uses a provider-neutral event stream for all agent-environment interactions.
- History is stored as durable, append-only JSONL files.
- It supports multiple providers including OpenAI, Anthropic, and local models.
- The architecture allows for custom frontends beyond the built-in TUI.
- It is designed specifically to be read and understood by developers as a reference implementation.
Decoder
- TUI: Terminal User Interface, a text-based interface for interacting with software in the command line.
- Harness: A testing or agent control structure that manages the lifecycle of an application or task.
- Provider-neutral: Designed to be agnostic to the underlying LLM vendor, allowing users to switch models without changing code.
Original article
A small, readable terminal coding agent — and a working example of how coding agents are built.
What is Tau?
Tau is a coding agent that lives in your terminal. You type requests like "explain this repo", "add tests", or "fix this stack trace"; Tau can read files, edit code, run commands, and keep a durable session history while streaming what it is doing.
Tau is also meant to be read. It is a teaching project for understanding the shape of a coding-agent system without starting from a giant production codebase.
tau_coding → tau_agent → tau_ai
tau_aitranslates model providers into Tau's provider-neutral stream.tau_agentowns the portable brain: messages, tools, events, loop, harness, and session primitives.tau_codingwraps the brain as a real coding app: CLI, TUI, file/shell tools, provider config, project instructions, skills, and on-disk sessions.
The important boundary is:
AgentHarness = reusable brain
CodingSession = coding-agent environment
TUI = one possible frontend
The core does not know about Textual, Rich, local config paths, slash commands, or rendering. Frontends consume events.
Install
Tau is published on PyPI as tau-ai and installs a tau command. It requires Python 3.12 or newer. The recommended installers use uv and install it first when necessary.
macOS and Linux:
curl -LsSf https://twotimespi.dev/install.sh | sh
Windows PowerShell:
irm https://twotimespi.dev/install.ps1 | iex
The installers do not use sudo. They announce before installing uv, install Tau in an isolated tool environment, verify tau --version, and report if a shell restart is needed.
Already have a package manager? Install Tau directly:
uv tool install tau-ai
# or
pipx install tau-ai
# or
python -m pip install tau-ai
Then check it worked:
tau --version
Tau is also available on conda-forge, and can be installed using pixi:
pixi global install tau-ai
Upgrade a normal installation with:
tau update
For local development:
git clone https://github.com/huggingface/tau.git
cd tau
uv sync --dev
uv run tau --version
Quickstart
Run Tau from the project you want it to work on:
cd my-project
tau
Then type a request and press Enter:
explain what this project does
One-shot print mode is useful for scripts and quick prompts:
tau -p "summarize the architecture"
tau --cwd /path/to/project -p "find the CLI entry point"
Tau needs a model provider. Start Tau and connect one with /login:
tau
/login
/login openai
/model
Tau ships with support for OpenAI, Anthropic, OpenAI Codex subscription auth, OpenRouter, Hugging Face, and custom OpenAI-compatible endpoints, including local models.
What Tau can do
- Interactive Textual TUI and non-interactive print mode.
- Built-in coding tools:
read,write,edit, andbash. - Durable JSONL sessions under
~/.tau/sessions/with resume and branching. - Slash commands for login, model selection, sessions, compaction, export, theme, and more.
- Project instructions from
AGENTS.md,.tau/, and.agents/resources. - User skills, prompt templates, and custom TUI themes.
- Context accounting, manual compaction, and optional automatic compaction.
- Provider-neutral event rendering for Rich, plain text, JSON, transcripts, and custom frontends.
Philosophy
- Small layers beat magic. Each package has one job and can be read alone.
- Events are the contract. Providers, renderers, the TUI, and custom frontends meet at a typed event stream.
- The core stays portable. The reusable harness does not depend on the CLI, Textual, Rich, or Tau's file layout.
- Tools are ordinary typed functions. A tool is a schema plus an async executor returning a structured result.
- Sessions are durable and inspectable. History is append-only JSONL; active context can be compacted without rewriting the record.
- Documentation follows implementation. The public docs explain the result;
dev-notes/preserves the phase-by-phase build journal.
Use Tau as a library
from tau_agent import AgentHarness, AgentHarnessConfig
harness = AgentHarness(
AgentHarnessConfig(
provider=provider,
model="my-model",
system="You are a helpful coding agent.",
tools=tools,
)
)
async for event in harness.prompt("Explain this package"):
print(event)
Development
uv sync --dev
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run mypy
License
Tau is released under the MIT License.
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi