Skip to content

Codebase map

Overview

The current docs branch lives inside a single repository. The important boundary is not repo count. It is which part of the codebase owns which layer of the system.

Top-level layout

PathRole
src/hub/Hub server modules and REST handlers
src/client/CLI, MCP runtime, adapter engine, TUI
src/protocol/shared API and protocol types
src/seed/seed and data pump tooling
assets/adapters/runtime assets installed into agent hosts
docs/VitePress documentation site

src/hub

This directory is the authority layer. It contains the modules that back the server-side model:

ModuleResponsibility
auth.zigidentity, tokens, roles, workspace access
library.ziglibrary manifest, prompt metadata, bundles
workspace.zigworkspace CRUD and manifest state
context.zigworkspace context files and context collaboration endpoints
collab.zigPR and review flows
attestation.zigtrace ingestion and stats
server.zigroute wiring and HTTP server setup

src/client

This directory holds several client surfaces that share local storage and protocol logic.

AreaResponsibility
commands/CLI subcommands such as login, init, sync, adapt
mcp/the MCP runtime exposed to coding agents
adapter/adapter engine and host package definitions
tui/terminal dashboard views and client-side data flow
prompt.zigmanifest, cache, draft, and prompt/context lookup logic

src/protocol

This directory defines shared types and API contracts. It is the seam between client and server. If you want to understand manifest shape, stats payloads, auth responses, or workspace API types, start here.

assets/adapters

These are the host-facing runtime assets that clumsies adapt installs. They matter because adapter behavior is not abstract. Real shells, hooks, config templates, and host-specific glue live here.

Two subtrees matter most today:

  • assets/adapters/codex/
  • assets/adapters/claude-code/

How to read the repository

  1. Read src/protocol/ to understand the shared object model.
  2. Read src/hub/ to see the authority layer.
  3. Read src/client/commands/, src/client/mcp/, and src/client/adapter/ to see how local runtime surfaces consume that model.
  4. Read src/client/tui/ last, after the data model is already clear.