v0.180.0 October 2026 MIT single binary · its own runtime

The terminal-native coding agent that stays honest.

FlowCodex is an AI coding assistant that lives in your shell. A Director runs a fleet of subagents — each isolated in its own git worktree, budget and context — while append-only sessions, add-only memory and a permission policy that asks only for what it cannot undo keep the whole thing accountable.

❯ curl -fsSL https://github.com/Msvnc0/flowcodex/releases/latest/download/install.sh | sh
PS> irm https://github.com/Msvnc0/flowcodex/releases/latest/download/install.ps1 | iex

One file, its own runtime — no Node, no Bun. Installs to ~/.local/bin, linked as fcx; SHA-verified on install. Build from source ↗

13
packages
317k
lines of TS
658
test files
32
plugins
6
agent roles
28
ADRs

The OpenTUI transcript: one row per tool call, a swarm strip for live subagents, and one summary line per turn — duration, files, tests, cost.

Why FlowCodex

Built on four commitments, enforced by tests

These are not slogans on a wall. Each one is a structural property of the codebase, with a contract test or a lint rule holding it in place.

01

It stays honest

Every release is in the changelog. ADRs record where the build diverged from the plan — and keep the record. Docs are checked against the source, not against each other.

02

Asks only for the irreversible

Permission is about what cannot be undone or leaves the machine — not what looks scary. Measured on real journals: about five prompts a month in the default trusted mode.

03

Nothing rewrites history

Sessions are an append-only JSONL event log. Memory consolidation is add-only by construction — supersede and contradict edges are queued for your approval, never applied silently.

04

One engine, every surface

REPL, TUI, HTTP/WS server and ACP drive the same engine through one Surface contract, rendering one event stream. Nothing in the runtime knows what a terminal is.

What it does

A full coding assistant, not a demo

Fourteen subsystems, each with its own package, its own docs page and its own tests.

⏵

Agent loop

Streaming responses with interleaved reasoning, explicit [continue]/[done] turn markers instead of language heuristics, loop guards, and a graduated compaction pipeline that keeps months-long sessions inside the context window.

⇄

Providers without lock-in

Fully custom wire adapters for Anthropic, OpenAI, Google and any OpenAI-compatible endpoint — plus OAuth for Claude, Codex and GitHub Copilot. Multi-key auth in an encrypted auth.json, per-provider health with cooldowns, and a cross-provider fallback chain. No model list is hardcoded; models.dev is the sole catalog.

✎

Tools with a transaction pipeline

read write edit bash grep glob todo webfetch patch test and more. Mutating tools run through a transactional mutation pipeline; external content is fenced so tool output cannot impersonate instructions.

◎

Director fleet

delegate, spawn_subagent, fleet_status, merge_worktree. Subagents run in isolated git worktrees under their own budget and context, with a Brain risk governor and mid-run steering — /steer, /btw side questions, a mailbox, Esc-to-steer.

◍

Memory that reports its own drift

Three SQLite scopes (user, project, session) with FTS5/BM25 search, a self-populating memory graph, and anchors that record why they stopped matching when the code under them changes. Add-only by construction.

⌗

Codebase index

Per-project symbol index with cross-references and an on-demand CodeMap graph. Rebuilt in a candidate file and atomically swapped — a failed rebuild never leaves you with half an index.

⎘

Event-sourced sessions

Append-only JSONL with resume, fork, rewind, pins, export and import. A diagnostic manifest (/session diagnose) reports tool metrics, cost breakdown, compaction timeline and permission decisions after the fact.

⊕

Plugin packages

A plugin ships skills, commands, agents, hooks, MCP servers and tools as one package (ADR-028) — installed from a marketplace, a repository or a directory with /plugin install, reviewed before anything runs, kept in a content-addressed store, and rolled back on demand. Claude Code and Codex packages are read as published.

✧

Skills & MCP

Skills as on-demand prompt extensions, discovered across project, user and bundled layers. An MCP client and server with an LSP plugin — 32 built-in plugins load behind a capability-checked, trust-tiered host with atomic generations.

⇋

ACP, both directions

An Agent Client Protocol server over stdio or loopback socket, a client that spawns trusted local agents, parallel ensembles, crash-resumable benchmark journals, and a threshold-signed registry with trust-root rotation.

↻

Autonomy with a judge

One /goal runs the agent unattended until an independent evaluator — or a --check command you write — says the objective is met. Esc pauses it, a budget caps the whole fleet, and it lives in the session log like everything else (ADR-027).

▤

A real TUI, on Bun

A bare flowcodex opens the OpenTUI alternate-screen renderer: pure-TypeScript markdown with highlighted diffs, semantic tool cards, mouse capture with click-to-caret, an in-app scrollable transcript, and a swarm grid of live-agent tiles. The same binary links as fcx; --repl keeps the classic REPL.

⛶

Headless & scriptable

flowcodex serve exposes HTTP/WS with OpenAPI and auth middleware; @flowcodex/sdk is the zero-dependency client. flowcodex attach connects a TUI to a running server. Structured output against any JSON Schema.

⚿

Security as a default

Risk-classified shell verdicts, snapshot-before-undo, an optional kernel sandbox, secret and prompt-injection pre-commit scanning, dependency audit — and subagents that hand risky commands to you instead of running them.

Quick start

Three steps from download to a working fleet

Everything below runs from the single binary — no Node, no Bun, no global packages.

1

Install

curl -fsSL https://github.com/Msvnc0/flowcodex/releases/latest/download/install.sh | sh

The installer verifies the SHA-256 sums, links the binary as both flowcodex and fcx, and writes the PATH entry in your shell's own dialect. Windows uses install.ps1 the same way.

2

Run

flowcodex

Opens the TUI; type a task and the Director routes it. --repl starts the classic REPL, flowcodex "<prompt>" starts with an initial prompt, and flowcodex serve is the headless HTTP/WS server you can attach a TUI to.

3

Connect a provider

/connect

A catalog-driven picker walks through Anthropic, OpenAI, Google, Copilot or any OpenAI-compatible endpoint — including local models. Keys live in an encrypted auth.json, multi-key, with automatic failover between providers.

Architecture

One runtime, several front ends, strict boundaries

@flowcodex/core depends on nothing. The CLI is the only composition root. Package boundaries and core layering are enforced by pnpm lint:arch — a violation fails the build, not a review comment.

SURFACES ENGINE RUNTIME REPL TUI server ACP attach Surface contract agent engine packages/cli agent loop core/agent tool executor core/execution providers wire adapters models.dev catalog permission policy tools read · edit · bash · grep … plugins · skills MCP · LSP Director fleet coordination → subagents memory · index core session store JSONL event log

Faithful rendering of the diagram in docs/architecture.md — surfaces subscribe to one event flow; the CLI is the composition root.

CheckWhat it catches
pnpm lint:archPackage boundary violations (static and dynamic imports), core layer violations, bidirectional coupling, import cycles, direct tool registration outside the allowlist, unowned child processes
pnpm check:contractsWorkspace version and export contracts, in source and in the packed tarballs
scripts/*-truth.test.tsSettings rows, persistence writers, dead contracts and version reporting — asserted against the source rather than a doc
pnpm typecheckstrict, noUncheckedIndexedAccess, exactOptionalPropertyTypes across every package
The fleet

A Director, six roles, no unbounded agents

Every subagent is cut on what its work may touch, runs in its own git worktree, and carries its own budget and context window. The Brain governor escalates on budget or failure, asks a human when it must, and enforces a hard cost cap.

/goal evaluator decides done · Esc pauses Leader · Director plans · routes · merges worktrees Brain risk governor · budgets · hard cost cap build git worktree · isolated own budget · own context mutates: yes · shell: no verify runs the tests · mutates: no own budget · own context risky calls → handed to leader debug reads + runs · mutates: yes own budget · own context mid-run steering via /steer · /mail

Solid lines: spawn and await. Dashed: the Brain's oversight and the mailbox that lets a running agent be steered without aborting it.

RoleMutatesRunsReadsUse when
explore——✓find or read anything, including the web
review———a verdict on a diff, no test run
verify———tests and typecheck actually run
build✓——code has to change
debug✓✓—something must run to know what to change
general✓✓✓nothing above fits — deliberately last

general has every tool — which is exactly why the router treats it as the most expensive answer. Agent files may narrow a role, never widen it (ADR-024).

Compaction pipeline runs before anything lossy touches your context

stale-read dedup→ content-aware scoring→ evidence floor→ user-message re-injection→ lossy summary — only if still needed

And one /goal: an autonomous loop where done is decided by an independent evaluator (or a --check command), never by the agent itself. Esc pauses it; a budget caps the whole fleet.

Memory & context

Remembers what mattered — and admits when it stopped

Most agent memory is a diary. FlowCodex memory is a graph with anchors in your code: when the code under an anchor changes, the drift is recorded with its reason — content changed, file gone, symbol gone — and it survives a restart.

SCOPES

Three SQLite databases

User (~/.flowcodex/memory.db), per-project, and per-session — routed by one MemoryService, searched with FTS5/BM25, retrieved identifier-aware and scoped by audience. Subagents read through their own ledger.

INVARIANTS

Add-only, always

The consolidator and the tools never delete or rewrite. Supersede, contradict and near-duplicate edges go to a pending queue for /memory approve. Hard deletes need an explicit command from you.

PROMPT CACHE

Byte-identical epochs

The system prompt is built once per cache epoch and never edited — later changes arrive once as a [STATE] note. Four cache_control breakpoints, placed so the next request reads the previous one's cache instead of re-billing your history.

Security

The accident brake, tuned by measurement

One month of the maintainer's journals — 1,120 leader shell calls — held no destructive command at all. The policy that came out of that data asks for roughly five prompts a month, and it can tell you exactly why.

Every shell call gets one verdict

A classifier classes each command before it runs:

read run undoable risk catastrophic

What a snapshot can bring back — git reset --hard, an in-project rm -r — is undoable: it runs behind a snapshot taken right before it. Pushes, publishes and credential reads are risk: they ask.

Three modes, trusted by default

workspace asks per runtrusted asks for riskfull asks at the ceiling

--read-only is a lock, not a mode. Subagents never ask — they hand risk to the leader, which asks you once. A repository's own permission grants apply only after you approve them, bound to their content.

Boundaries, fences and judges

An optional kernel sandbox runs shell with project-only writes, no network and credential paths unreadable in every mode. External content is fenced by an authority model so a web page cannot impersonate your instructions. And features.approver: 'model' hands the questions to a judge model — whose allow is never a human confirmation.

Roadmap

Kept honest, like everything else

FlowCodex releases frequently and documents every one of them. The plan below comes from the changelog and the decision records — including the parts that are deliberately still closed.

SHIPPED · 0.180

Compaction that survives the trip across sessions

Every compaction pass records the preserved-tail boundary in the session event — message count plus a role/sha fingerprint of the first kept message — and resume restores the tail from it. Pass digests persist into /session report, and compaction advice now appears in the REPL the moment it fires.

SHIPPED · 0.175

Plugin packages & marketplaces (ADR-028)

A plugin ships skills, commands, agents, hooks, MCP servers and FlowCodex tools as one directory, installed by digest with /plugin install, its executable set approved as a unit and rolled back on demand. Claude Code, Codex and Agent Plugins packages are read as published — one dialect per package, never merged.

SHIPPED · 0.176–0.178

The TUI becomes the default, the installer grows up

A bare flowcodex opens the TUI; the same binary links as fcx. The installer now writes PATH entries in the invoking shell's own dialect — fish drop-ins, marked rc blocks — and installs to ~/.local/bin, leaving program and user data as two separate removals.

SHIPPED · 0.174

Prompt-cache visibility & conversation caching

Every LLM response now carries a fingerprint of its cache prefix; /session report shows hit rate, re-billed tokens and breaks by cause. On Anthropic, two of four cache_control slots moved onto the conversation so each turn reads the previous one's cache; OpenAI-compatible providers get prompt_cache_key.

SHIPPED · 0.169+

One /goal, a model judge, hard spend caps

Three near-duplicate autonomy commands collapsed into one loop with an independent evaluator (ADR-027). A judge model can answer permission questions from what you typed — never past the ceiling, never for protected paths. Budgets cap the fleet, not just the leader.

SHIPPED · 0.167

One-file distribution

Each release ships a single binary that carries its own runtime — Linux, macOS (x64/ARM64) and Windows. The installer checks it against the release's SHA256SUMS; flowcodex update replaces it the same way.

IN PROGRESS

npm publication

The packages are built and tested; npm install -g flowcodex goes live once the repository's PUBLISH_NPM variable is set to true. The release workflow publishes them automatically from then on.

IN PROGRESS

ACP registry bootstrap

The threshold-signed registry with 2-of-3 trust-root rotation is built; what remains is its first publication — an irreversible key ceremony, written up as a runbook rather than a document. It is the only ACP work still open.

NEXT

Build provenance attestations

Once the repository is public, every binary carries a verifiable attestation: gh attestation verify flowcodex-linux-x64 --repo Msvnc0/flowcodex.

LATER

The platform era

The deliberately deferred list, kept from the decision records: cloud sync and memory portability, session sharing, a GitHub App, and a VS Code extension. All of them are unblocked by the headless server; none of them will ship before the core gates stay green.

CONTINUOUS

Weekly catalog refresh, docs as contracts, 1.0

A GitHub Action opens a models.dev catalog refresh PR every Monday. The truth tests keep docs and settings honest against the source. Version 1.0 is not a feature date — it arrives when the architecture, contract and coverage gates hold steady.

Documentation

Start here