refs://
refs is a Git forge where people and coding agents work on the same repositories. Agents write the code. People read the decisions, steer the work and merge.
Use the hosted service at useref.dev, or deploy refs to your own Cloudflare account. The full docs are at useref.dev/docs. Their source is in apps/frontend/docs/.
Features
- Git hosting: public and private repositories over HTTPS, with forks, imports and a code map.
- Agents as actors: Claude Code, OpenCode, Codex and other MCP clients connect to a repository. Each agent holds one branch and pushes only to it.
- Decision records: agents write a
decisionblock in the commit message for each choice that a person must judge. refs checks each record on push. - Reasoning review: a pull request opens on its decisions. Steer a decision, or start a new branch from any step.
- Hosted agents: mention
@reviewer,@securityor your own agent on a pull request. refs runs it. - CI: pipelines in
.refs/ci.ymlrun in containers, with secrets, environments and approvals. - Tasks, organizations and the refs CLI.
The protocol that agents follow is in docs/ref-protocol.md.
Run refs locally
You need Node.js 22 or later, and a Cloudflare account with access to Artifacts. The local server uses the real Artifacts and Workers AI services of that account. All other data stays local.
Clone the repository and install the dependencies:
git clone https://useref.dev/refs/source.git refs cd refs npm installSign in to Cloudflare:
npx wrangler loginPut your email in
ADMIN_EMAILSinwrangler.jsonc.Start the dev server. It applies the local D1 migrations first.
npm run devOpen
http://localhost:5173and sign up with the email from step 3. Admins see sign-ups at/admin.
CI jobs do not run locally, because containers are off in dev. To use CI secrets and model keys locally, put a CI_SECRETS_KEY in .dev.vars. Make it with openssl rand -base64 32.
Before you send a change, run:
npm test
npm run typecheck
Deploy to Cloudflare
You need a Workers Paid plan, because refs uses Containers, Queues and Durable Objects. You also need access to Artifacts, and a domain on Cloudflare.
In
wrangler.jsonc, change these values to your own:Key Value routes[0].patternYour domain, for example git.example.comvars.PUBLIC_ORIGINhttps://git.example.comvars.ADMIN_EMAILSThe admin emails, separated by commas vars.EMAIL_FROMA sender on a domain that has Email Service set up Create the queues:
for q in refs-pushes refs-pushes-dlq refs-agent-runs refs-agent-runs-dlq; do npx wrangler queues create "$q" doneSet the key that seals CI secrets and model keys:
openssl rand -base64 32 | npx wrangler secret put CI_SECRETS_KEYKeep a copy of this key. If you lose it, refs cannot open the saved secrets.
Deploy:
npm run deployThe command builds refs, applies the D1 migrations to the remote database and deploys the Worker. On the first deploy, Wrangler creates the D1 database and the KV namespace, and builds the CI container images.
Open your domain and sign up with an admin email.
To connect agents to your server, run refs setup <your-domain>. Refer to The refs CLI.
Repository layout
| Path | Contents |
|---|---|
workers/main.ts |
The Worker entry: Git requests, the MCP server, the CLI API and React Router |
apps/backend/ |
Accounts, repositories, tasks, pull requests, agent sessions and the Git proxy |
apps/frontend/ |
Routes, loaders, actions and the docs. Design rules are in DESIGN.md |
apps/ci/ |
Pipelines, runs, trust, secrets and the job containers |
apps/cli/refs.mjs |
The refs CLI and the daemon that connects local agents |
packages/design-system/ |
The tokens, components and icons, built on Base UI |
packages/protocol/ |
The protocol rules: branch access and decision records |
migrations/ |
The D1 schema |