braid

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0

README

Braid logo

Braid

Braid is a self-hosted daemon and server that syncs Claude Code transcripts from your machines into one place, so sessions, subagents, costs and failures can be browsed and replayed.

What it does

  • Syncs Claude Code transcripts from every device to your own server, resuming after offline periods.
  • Shows sessions, costs and tokens on a board, per project, model and device.
  • Replays a session as a canvas of the main session and its subagents.
  • Lists failures: what went wrong, how often and how much time it cost.
  • Supports several users on one server, each seeing only their own data; login through your OpenID Connect provider.

Install

Daemon (macOS and Linux), with the install script that checks a SHA-256 sum before installing (read it first at https://usebraid.dev/install.sh):

curl -fsSL https://get.usebraid.dev | sh

Windows: download the zip from the release page and follow the manual steps.

Server: Docker Compose, see Quick start. More in the docs: external Postgres, OIDC providers, reverse proxy, operations.

Quick start

braid login <server-url>
braid install

Verify releases

Releases are signed with cosign (keyless). Verify the checksums file, then the archives with sha256sum -c checksums.txt:

cosign verify-blob --bundle checksums.txt.sigstore.json --certificate-identity https://github.com/usebraid/braid/.github/workflows/release.yml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.com checksums.txt

The server image:

cosign verify --certificate-identity https://github.com/usebraid/braid/.github/workflows/release.yml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.com ghcr.io/usebraid/braid-server:<version>

Status

Pre-1.0 (0.x): interfaces may change.

Contributing and security

See CONTRIBUTING.md. Report vulnerabilities as described in SECURITY.md.

AGPL section 13 notice

Braid is licensed under AGPL-3.0-or-later. If you run a modified version as a network service, you must offer its users the corresponding source. The web app footer links to the source of the running version.

Special thanks

  • ponytail by Dietrich Gebert: board look and feel and SVG charts, cost/metric logic and price table, the band mod as a template, and the website as a model for usebraid.dev.
  • agents-observe by Joe Johnston: reference for transcript parsing, the event model, hierarchy and replay UI ideas, and the original idea of syncing sessions.

Notable dependencies

  • React Flow (@xyflow/react, MIT) and dagre (@dagrejs/dagre, MIT) draw the session canvas.
  • github.com/jackc/pgx/v5 (MIT): the Postgres driver.
  • github.com/coreos/go-oidc/v3 (Apache-2.0): OpenID Connect login.
  • modernc.org/sqlite (BSD-3-Clause): the daemon's local state, pure Go.
  • github.com/fsnotify/fsnotify (BSD-3-Clause): watching transcript files.
  • github.com/zalando/go-keyring (MIT): token storage in the OS keychain.
  • marked (MIT): renders the docs of this site at build time.

See CREDITS.md and THIRD_PARTY_NOTICES.md.

License

AGPL-3.0-or-later, see LICENSE.

Directories

Path Synopsis
cmd
braid command
Command braid is the Braid sync daemon and CLI.
Command braid is the Braid sync daemon and CLI.
braid-server command
Command braid-server is the Braid server.
Command braid-server is the Braid server.
internal
buildinfo
Package buildinfo holds the version stamped in at build time.
Package buildinfo holds the version stamped in at build time.
daemon/auth
Package auth implements the device-flow client and token storage.
Package auth implements the device-flow client and token storage.
daemon/cli
Package cli holds the daemon's command implementations.
Package cli holds the daemon's command implementations.
daemon/client
Package client is the daemon's HTTP client for the Braid server.
Package client is the daemon's HTTP client for the Braid server.
daemon/paths
Package paths resolves the OS-specific directories used by the daemon.
Package paths resolves the OS-specific directories used by the daemon.
daemon/reader
Package reader reads transcript files that Claude Code appends to concurrently.
Package reader reads transcript files that Claude Code appends to concurrently.
daemon/scan
Package scan finds transcript files to sync below the Claude projects root.
Package scan finds transcript files to sync below the Claude projects root.
daemon/service
Package service registers the daemon as a user service (launchd, systemd --user, Windows scheduled task).
Package service registers the daemon as a user service (launchd, systemd --user, Windows scheduled task).
daemon/spool
Package spool keeps not-yet-acked transcript data alive after Claude Code deletes the original.
Package spool keeps not-yet-acked transcript data alive after Claude Code deletes the original.
daemon/state
Package state is the daemon's SQLite state store (spec §4.3).
Package state is the daemon's SQLite state store (spec §4.3).
daemon/syncer
Package syncer is the daemon's sync engine: scan, spool, read, batch, upload; state advances only on ACK.
Package syncer is the daemon's sync engine: scan, spool, read, batch, upload; state advances only on ACK.
daemon/watch
Package watch turns filesystem events and periodic rescans into coalesced triggers.
Package watch turns filesystem events and periodic rescans into coalesced triggers.
protocol
Package protocol holds the wire types and pure helpers shared by daemon and server.
Package protocol holds the wire types and pure helpers shared by daemon and server.
server
Package server wires the HTTP handlers of braid-server.
Package server wires the HTTP handlers of braid-server.
server/api
Package api serves the /api/v1 endpoints used by the web app.
Package api serves the /api/v1 endpoints used by the web app.
server/config
Package config parses the server's BRAID_* environment.
Package config parses the server's BRAID_* environment.
server/db
Package db wraps the Postgres pool, per-request user scoping and migrations.
Package db wraps the Postgres pool, per-request user scoping and migrations.
server/derive
Package derive turns raw transcript rows into the derived tables, exactly once per row.
Package derive turns raw transcript rows into the derived tables, exactly once per row.
server/derive/derivetest
Package derivetest is test support for the derive engine: it stores raw data as ingest would and inspects the derived tables.
Package derivetest is test support for the derive engine: it stores raw data as ingest would and inspects the derived tables.
server/derive/parse
Package parse turns raw transcript lines and snapshots into typed events, leniently and without I/O.
Package parse turns raw transcript lines and snapshots into typed events, leniently and without I/O.
server/device
Package device implements the RFC 8628 device authorization flow and its /device pages.
Package device implements the RFC 8628 device authorization flow and its /device pages.
server/httpx
Package httpx holds shared HTTP building blocks for the server.
Package httpx holds shared HTTP building blocks for the server.
server/ingest
Package ingest serves the device-authenticated data path: POST /v1/ingest and GET /v1/files.
Package ingest serves the device-authenticated data path: POST /v1/ingest and GET /v1/files.
server/live
Package live fans per-user events from Postgres NOTIFY out to WebSocket clients.
Package live fans per-user events from Postgres NOTIFY out to WebSocket clients.
server/page
Package page renders the server-side HTML pages (device login, login errors) in the dashboard's look.
Package page renders the server-side HTML pages (device login, login errors) in the dashboard's look.
server/servertest
Package servertest starts a complete braid-server against a fresh test database and a mock OIDC provider.
Package servertest starts a complete braid-server against a fresh test database and a mock OIDC provider.
server/spa
Package spa serves the embedded single-page web app.
Package spa serves the embedded single-page web app.
server/stats
Package stats serves the /api/v1/stats endpoints: aggregates over the derived tables of the signed-in user.
Package stats serves the /api/v1/stats endpoints: aggregates over the derived tables of the signed-in user.
server/webauth
Package webauth implements OIDC web login (authorization code + PKCE) and DB-backed sessions.
Package webauth implements OIDC web login (authorization code + PKCE) and DB-backed sessions.
server/webauth/oidctest
Package oidctest is a minimal in-process OIDC provider for tests.
Package oidctest is a minimal in-process OIDC provider for tests.
testdb
Package testdb gives each test its own freshly migrated Postgres database.
Package testdb gives each test its own freshly migrated Postgres database.
Package web embeds the built web app (web/dist).
Package web embeds the built web app (web/dist).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL