Cairn is a self-hosted workspace for open-source developers. It keeps every task with its context, shows the plan as a graph, runs coding agents on several tasks in parallel under your control, and keeps GitHub items and local instances one click away.
Status: early development (Phase 2 of 11, foundations). The full specification is in
PROJECT_BRIEF.mdand progress indocs/PROGRESS.md.
- Single-owner account: first-run setup, sign-in, two-factor sign-in (TOTP, codes cannot be replayed), password change that signs out other sessions.
- Secrets vault: values encrypted with AES-256-GCM; the master key lives in the OS keyring, in an environment variable or in an owner-only key file, never in the database.
- Security by default: bound to
127.0.0.1, deny-by-default access rules, CSRF protection, rate-limited sign-in, strict Content Security Policy (no inline script or style, no eval), activity log of every sensitive action. - Four colour themes built on design tokens (Stone, Basalt, Moss, Ember, plus Auto).
Requires Python 3.12+ and uv. Works on Linux (Ubuntu is the reference), macOS and Windows.
git clone https://github.com/ecrou-exact/cairn.git
cd cairn
uv sync
uv run python manage.py setup # creates .env, the master key and the database
uv run python manage.py start # http://127.0.0.1:7010
uv run python manage.py worker # background jobs, in a second terminalOpen the URL, create the owner account, then turn on two-factor sign-in under Security.
| Command | What it does |
|---|---|
python manage.py setup |
First run: .env with a secret key, master key, database |
python manage.py start |
Development server with auto-reload |
python manage.py serve |
Production server (gunicorn on Linux/macOS, waitress on Windows) |
python manage.py open |
Open Cairn in the browser once it answers |
python manage.py autostart on |
Start the server and the worker with your session, and put Cairn in the applications menu: a click opens the page (Linux; off, status) |
python manage.py claude-connect on |
Cairn's tools in every Claude Code of the machine, to start a project from any folder (show first, off, status) |
python manage.py worker |
Background job worker (one per SQLite database) |
python manage.py roadmap [file] |
Import a plan; without a file, Cairn's own roadmap (docs/roadmap.json) |
python manage.py upgrade |
Apply database migrations |
python manage.py migrate "message" |
Create a migration after a model change |
python manage.py test |
Run the test suite |
python manage.py check |
Lint, security scan and tests |
python manage.py claude-connect on gives every Claude Code of the machine Cairn's tools and a /cairn command (show lists what it adds first, off takes it all out). In any folder:
| Command | What it does |
|---|---|
/cairn or /cairn -status |
The project of this folder (its own folder, a worktree or another clone), its address and next tasks |
/cairn -init [name] |
Start the project of this folder, once you agree; then offers what it can bring in |
/cairn -next |
The next task to take, and why |
/cairn -update |
Comment the task in progress (what was done, the branch, what was checked) and move its status |
/cairn -bring |
To-do lists, GitHub issues and boards, skills and commands not in Cairn yet; you choose on the page |
/cairn -copies |
Every copy of the project with its branch, pull request and what runs in it |
/cairn -link [task] |
Link the current branch and this conversation to a task (or the project): every later Claude on it reads them |
/cairn -note <text> |
Leave a note on the project |
Writing in Cairn follows your permission mode: asked in the default mode, not in auto (being asked at every step teaches to accept everything, a push to main included). Settings → Claude → Claude writes in Cairn without asking lets it through in every mode. Cairn must be running.
Projects → Find my projects looks for every git repository in your folders (Settings → Day summary), puts clones, worktrees and forks of one project together, and starts the ones you choose. It runs as a job: its progress shows on the page.
On a project's page, Export gives one .cairn file. On the other machine, Projects → Import shows what it changes, then brings it in. Do it each way: what is newer wins, row by row; folders stay each machine's own. Secrets are never in the file. With an exchange folder both machines see (Settings → Projects: Nextcloud, Dropbox, Syncthing, a USB key), To the exchange folder saves it there and Import lists it: no download, no upload.
Environment variables (or .env):
| Variable | Default | Purpose |
|---|---|---|
CAIRN_SECRET_KEY |
generated by setup |
session signing key |
CAIRN_ENV |
development |
development, production or testing |
CAIRN_HOST / CAIRN_PORT |
127.0.0.1 / 7010 |
listen address |
CAIRN_KIMAI_URL / CAIRN_KIMAI_TOKEN |
none | your Kimai address (https) and API token, to send the time entries of the day summary |
CAIRN_DATABASE_URL |
SQLite in the data directory | e.g. postgresql+psycopg://… (install with uv sync --extra postgres) |
CAIRN_DATA_DIR |
OS data directory (~/.local/share/cairn on Linux) |
database, key file, uploads, worktrees |
CAIRN_MASTER_KEY |
OS keyring or key file | vault master key (urlsafe base64, 32 bytes) |
CAIRN_HTTPS |
0 |
set to 1 behind HTTPS to mark cookies Secure and send HSTS |
Cairn controls credentials and runs commands on your machine, so security comes first. Read docs/SECURITY.md for the threat model. Do not expose Cairn to a network without HTTPS and two-factor sign-in.
docs/ARCHITECTURE.md— processes, data model, flowsdocs/DECISIONS.md— technical decisions and whydocs/OWNER_CONVENTIONS.md— code, commit and PR conventionsCLAUDE.md— rules for coding agents working on this repository