Open source Apache-2.0 · local-first CLI for coding agents

Clone the developer.

Your agents read the code. devtwin hands them the rest of you: the decisions, constraints, commands and handoffs behind it, as a short, cited brief at the start of every session, and your team's lessons the moment an agent opens the code they are about. Reviewed by you, kept on your disk, scoped to every org you work for.

git clone https://github.com/sundharesan11/devtwin
Works withClaude CodeCodex
How context flows through devtwinSix kinds of record (decision, fact, constraint, command, unknown and handoff) stream into a bounded brief beside the developer. The brief fans out to Claude Code and Codex. Below, two organisation lanes, acme and globex, each light up their own GitHub and Slack identity when that org's project is active.RECORDSYOUAGENTSACCOUNTSdecisioncursor paginationfactjobs run on SQSconstraintno billing writescommandnpm testunknownv1 webhook callers?handoffbackoff ½ doneyou~/work/acme/atlas~/work/globex/ledgerbrief ·acme.atlasglobex.ledger14 records · reviewedClaude Code›/devtwin-resume✓brief loaded · 14 recordspicking up retry backoff…Codex›devtwin-resume✓same brief · 14 recordsconstraint noted: no billing…acmescope · acme.*GitHub@sam-acmeGitHub@sam-acme ✓Slackacme · Sam R.Slackacme · Sam R. ✓globexscope · globex.*GitHub@sam-gxGitHub@sam-gx ✓Slackglobex · SamSlackglobex · Sam ✓Records stream into a brief, the brief reaches Claude Code and Codex, and each org lights up its own GitHub and Slack identity.RECORDSdecisionfactconstraintcommandunknownhandoffyoubrief ·acme.atlasglobex.ledger14 records · reviewedClaude Code✓brief loaded/devtwin-resumeCodex✓same briefdevtwin-resumeACCOUNTSacmeGH @sam-acmeGH @sam-acmeSlack · acmeSlack · acme ✓globexGH @sam-gxGH @sam-gxSlack · globexSlack · globex ✓
CaptureRecords with sources record add
BriefBounded, reviewed context brief
Any agentSame context agents install
Right orgScope from the repo context resolve
What devtwin is

A second you, in every session.

Agents read your code. They don't know why the queue moved to SQS, which test command actually works, what must never change, or where you stopped yesterday. You do. devtwin writes that down once, with sources, and hands it to every session that follows.

01 Project context

Context that carries over, with receipts.

Decisions, facts, constraints, commands, unknowns and handoffs live as records outside the repo. Every record points at where it came from, gets reviewed before an agent sees it, and is superseded, never silently overwritten.

  • Source-linked. A file, a commit, an issue or a URL. Files are hashed, so drift shows.
  • Reviewed first. Agents record propose; you record publish.
  • History kept. record supersede links old to new.
How records work
Review · acme.atlas3 proposed

Proposed

Cursor pagination for /tasksdecision · by agentIntegration tests need Dockerconstraint · by agentWho owns the v1 webhook?unknown · by you
decisionproposedacme.atlas

Use cursor pagination for /tasks

Offset paging skipped rows under concurrent inserts. Cursor on (created_at, id); page size capped at 100.

filesrc/api/tasks.tssha 3e1f…
commit9f2c1ab · switch list to cursormain
issueATLAS-148 · duplicate tasks on page 2open
supersedes rec_7a2f… · “offset paging is fine for v1”
$ devtwin record publish --applyyou approve
02 Every agent

Claude Code today. Codex tomorrow. Same brief.

At session start the agent loads a bounded brief: the things that matter for this project, ordered by kind and cited to their sources. Switch tools mid-week and nothing is lost: Claude Code and Codex read the same reviewed context.

  • devtwin-resume loads the brief into the session.
  • devtwin-record captures a decision as you make it.
  • devtwin-onboard scans a repo into reviewed context.
  • handoff export writes a clean Markdown packet for a person.
Set up your coding agents
› /devtwin-resumebrief loaded
acme.atlas · brief · 2026-10-2414 records · 3.1 KB

Decisions

Cursor pagination for /tasksATLAS-148 · 9f2c1ab
Jobs go through SQS, not Redis streamsADR-0007

Constraints

Workers never write to billing tablesATLAS-212

Commands

npm test -- --runInBandpackage.json

Unknowns

Is the v1 webhook still called by mobile?open

Last handoff

Retry backoff half done · src/jobs/retry.tsyesterday
03 Team lessons

The lesson arrives when the agent opens the file.

A lesson is one "do" or "don't" with a reason, tied to paths, packages or topics. When an agent reads or edits matching code, the devtwin hook adds a short index line to the session. Join your org's hub and your colleagues' lessons arrive the same way.

  • Just in time. At most four short lines per session. The full lesson loads only when the agent asks.
  • Agents draft, you approve. Agents lesson propose; only you lesson accept, after a dialog that shows the exact text.
  • See overlap early. "Working on" notes tell a colleague's agent that you are changing the same area.
How lessons reach your agents
Claude Code · acme.atlashook live
› Edit src/billing/client/retry.tspre-tool
devtwin lessons · data from teammates2 of 4 lines

Matched by path

Don't retry 4xx from the billing APIhandle:priya
Keep retry jitter on; the queue spikes without ityou

Working on

priya on fix/billing-timeouts touching src/billinguntil Thu

Session end

1 lesson proposed · waiting for your reviewlesson proposals
04 Accounts

The right account, in every org.

Work for two companies? Each one is its own scope, with its own projects and its own records. Identity routing binds each scope to its own GitHub and Slack account, so the project, not whatever you happen to be logged into, decides who the agent acts as.

  • Scoped by repo. context resolve maps the working tree to its scope and project.
  • Verified, or refused. The live identity must match the binding. A mismatch is refused.
  • Kept apart. Credentials never live in records or briefs.
Route identities per org
devtwin · identityresolved

cwd ~/work/acme/atlas → scope acme

@sam-acmeGitHub · acme-corpactive
Sam R.Slack · acme.slack.comactive
✕ refused push to acme-corp/atlas as @sam-gx
scope acme is bound to @sam-acme
05 Your harness

Make it yours. Then make more.

devtwin is also a template for your own harness. Set up a small private profile and turn generic skill templates into private skills of your own. The kit ships the patterns; your profile supplies the taste.

  • Stack watch. Vendor announcements that touch what you build: a new Claude model, an auth-provider release.
  • Slack updates. Drafts in your voice, saved for you to send.
  • Writing style. Your rules, applied by every agent.
Build your personal harness
devtwin skill template-seedprofile: sam
$ devtwin stack digest --scope acme
● New Claude model release · project acme.atlas
● Auth provider SDK major release · your stack
previously reported, not repeated: 31
06 Local-first

Yours. On your disk.

The public kit and your private data live in separate places. Records, profiles and exports stay on your machine in 0700 folders and 0600 files. Onboarding only ever reads your repos. Nothing leaves your machine unless you join a hub, and then only the lessons you approve and short "working on" notes.

  • Public kit, private data. Update the kit without touching your context.
  • No account, no server. Plain files you can read, back up and diff. A hub is a Git repo your org already hosts.
  • devtwin doctor checks roots, locks and bound repos for you.
Where your data lives

public the kit

devtwin/ ├─ bin/devtwin.mjs ├─ skills/ │ ├─ devtwin-resume/ │ ├─ devtwin-record/ │ ├─ devtwin-onboard/ │ ├─ devtwin-capture/ │ └─ devtwin-setup/ ├─ templates/skills/ └─ LICENSE Apache-2.0

private your data

~/.devtwin/ 0700 ├─ live.json ├─ kit/ pinned clone └─ store/ ├─ config/ scopes, profile ├─ data/scopes/ │ ├─ acme/ │ └─ globex/ ├─ data/personal/ lessons, preferences ├─ data/exports/ └─ state/
$ devtwin doctorroots privatebound repos unchanged
The CLI

A small, sharp CLI.

Every change is previewed first and written only when you pass --apply. Every command answers in one line of JSON, and agents call the same commands through the bundled devtwin-* skills.

› project onboard

Scan a repo into proposed context.

› context brief

The bounded brief for this project.

› context resolve

Which scope, project and identity apply here.

› record add

Capture a decision, fact or constraint.

› record propose

Suggest a record for review.

› record supersede

Replace a record, keep the history.

› lesson match

Lessons for the files in hand.

› lesson accept

Approve an agent's lesson, for you or your team.

› hub sync

Trade lessons and notes with your org's hub.

› handoff export

Selected records as a Markdown packet.

› agents install

Put the skills and hooks into Claude Code and Codex.

› setup

A guided setup, one step at a time.

› profile apply

Set up your private personal profile.

› skill template-seed

Turn a template into your own skill.

› stack digest

Vendor news that matters to your stack.

› doctor

Check setup, boundaries and permissions.

Get started

Clone it. Run it.

One Node CLI, zero dependencies. Clone the kit and run it with Node 22.13 or later.

git clone https://github.com/sundharesan11/devtwin
01devtwin init02devtwin project onboard03devtwin agents install04open your agent → /devtwin-resume
Open source

Built in the open. Built to be built on.

devtwin is Apache-2.0. Read every line that touches your context, fork it into your own harness, and send back what makes it better.

Read the code

A plain Node CLI with no service behind it. What it does to your files, you can see.

Write a template

Skill templates are files. Add one for your team's rituals and seed it with skill template-seed.

Bring another agent

Briefs are plain JSON, handoffs are Markdown and skills are portable. Teach a new agent to read them.

Apache-2.0 · local-first · no telemetry, no account

github.com/sundharesan11/devtwin

Your next session starts where you left off.

Give every agent your decisions, your commands and your team's lessons. Your data stays on your disk, and only the lessons you approve reach your team.

git clone https://github.com/sundharesan11/devtwin