Skip to content

Architecture

Understanding Dojo’s architecture helps you reason about how things work and why certain design choices were made.

Dojo is a remote-first version control system. The server is always the source of truth:

  • Push to persist — your local commits exist locally until you push
  • Pull to sync — get the latest changes from the server
  • No central clone needed for agents — agents work through remote workspaces via the API

This means you never have “I forgot to push” problems — the server always has the latest state.

Each repository is fully isolated with its own storage:

  • Commits, trees, and blobs are stored per-repo
  • Workspaces exist within a single repo
  • Search indexes are scoped to a single repo
  • Operations (undo/redo) are per-repo

This means one repository can never affect another’s performance or data.

Like Git, Dojo stores data as content-addressed objects:

ObjectDescription
CommitA snapshot pointing to a tree, with parent(s), author, message
TreeA directory listing: entries with names, kinds (blob/tree), and hashes
BlobRaw file content, identified by SHA-256 hash

Named pointers to commits:

  • Bookmarks — like Git branches. main, feature/auth, etc.
  • Refs are updated atomically with optimistic concurrency control

Remote sandboxes for agents:

  • Based on a specific commit
  • Maintain an overlay of changed files (adds, modifies, deletes)
  • Support multiple commits within a session
  • Can be submitted as stacks for review

For performance, Dojo maintains derived data:

  • File manifest — a flat index of all files at each ref tip, enabling instant directory listing
  • FTS5 search index — full-text search across file contents, built and maintained incrementally

These are rebuilt automatically if lost — they’re derived from the underlying objects.

The CLI communicates with the server using a three-phase sync:

  1. Negotiate — client and server exchange heads to determine what’s missing
  2. Push — client sends new objects (commits, trees, blobs) and ref updates
  3. Pull — client requests objects it doesn’t have

Ref updates use optimistic concurrency: if a ref has moved since your last sync, the push is rejected and you need to pull first.

When things happen in a repository, Dojo emits events:

  • Activity feed — visible in the web UI
  • Webhooks — HTTP callbacks to your endpoints, signed with HMAC-SHA256

Events include pushes, stack submissions, reviews, workspace activity, and more.

OperationSpeedNotes
Directory listingInstantMaterialized file manifest
Full-text searchFastFTS5 index, ranked results
PushProportional to changesOnly new objects are sent
Workspace writeInstantOverlay-based, no full tree rebuild
Workspace commitFastMerges overlay into tree