Find the bugs in your distributed system before production does.
The etcd/raft harness with a bug switched on: go test fails a seed, the timeline page
shows the crash, and the replay command fails the same way. Without the bug switch, 40,000 seeds
passed.
faultline is deterministic simulation testing (DST) for Go. It lets an AI coding agent test a
distributed Go system inside go test. It finds the bugs that make distributed tests flaky. They
appear only when messages are delayed or dropped, the network partitions, nodes crash or an fsync
fails. The system runs in virtual time on a simulated network and disk, where faultline injects
those faults. Every random choice comes from one seed, so a failing seed is a reproducible bug
report. The code under test can be ordinary Go code that starts goroutines, serves net/http or gRPC
and writes files, in goroutine mode. Built through the
faultline-toolexec wrapper, such code replays the identical run from a failing seed. Code written
as callbacks on faultline's node API, such as the included
etcd/raft harness, replays exactly without it.
An agent that changes distributed code gets:
retries, timeouts and crash recovery tested under faults, with message delays of 1 to 5 ms by
default that can reorder messages on a link;
a check of the fix: the seed that failed passes after the change, and fails again if the change
is reverted;
a regression test: the failing seed, pinned in a test of its own;
invariants as code: Go functions that faultline runs after every event.
From a failing seed to a pinned regression test, every step except the fix itself is a command to
run or a file to read. People follow the same steps by hand. To start, give your agent Use
faultline with an AI coding agent. It walks through the loop and ends with a
block for the agent's AGENTS.md or CLAUDE.md. To learn faultline by hand, build the following
example step by step in Get started.
⭐ If faultline is useful to you, a star on GitHub helps other Go developers find it.
Claude Code plugin
The faultline plugin for Claude Code turns the agent guide into a skill, an agent and two commands.
Add its marketplace and install it from a Claude Code session:
The skill loads when a distributed Go test is flaky or a faultline test fails, the agent summarizes
a failing seed's artifact directory, and /faultline:replay and /faultline:pin replay a seed and pin it in a test. Use
faultline with an AI coding agent describes each part and how
to update the plugin.
Who it is for
faultline is for Go teams, and their agents, that build a distributed system: a consensus or
replication library, a database, a queue, a controller. A service written as ordinary Go code runs
as a process in goroutine mode, once it takes its listener, dialer and filesystem as values. Code on
the node API consists of boot functions, message handlers and timers, and the etcd/raft harness
ports one real system to that API. faultline is the wrong tool when: