Coding-Agent State Protocol

The model holds the context. CASP proves the state is true — against git.

The new models run your whole roadmap for hours, even days, without losing the thread. That's exactly why state drift matters more, not less: the more an agent does between your checkpoints, the more its recorded state can quietly stop matching git. casp check is the deterministic gate that blocks the push the moment it does — with Claude Code today, and every model that ships next.

A pre-flight check and black box for AI coding sessions. MIT, local-only, zero telemetry.

3
Files, One Thread
5
CLI Verbs
2
Live Products
0
Telemetry
casp check — drift validator
$ casp check

✗ next_prompt → phases/14-camera.md (shipped v13.4)
✗ last_commit a1f3c9 not in git history
✗ migrations: state has 0007, git ends 0006
✗ uncommitted changes in state.json

DRIFT DETECTED — push blocked

$ casp check (after reconcile)

✓ next_prompt resolves to an unstarted phase
✓ last_commit present in history
✓ migrations match git
✓ state.json clean

STATE IN SYNC — clear for push

The Problem

  • -A stale state file makes your agent confidently wrong — it restarts work that already shipped
  • -Come back after a week, or juggle five projects, and reconstructing context is manual
  • -Boards, cards, and spreadsheets live in the cloud and your agent can't reliably read them
  • -Git, PRs, and CI are a perfect record of the past — and silent about what ships next
  • -Memory layers store what happened, but almost none verify it still matches git reality

The CASP Solution

  • +One machine-readable thread per project that survives across sessions and can't drift silently
  • +Everyone stores context — CASP validates it against git, before every push
  • +The agent writes its own next-session prompt, logs the session, and bumps the state
  • +A hard, deterministic pass/fail gate — no fuzzy similarity scores
  • +Git-native, local-only, zero telemetry — nothing to vet, nothing to exfiltrate

Three Files. One Thread.

No database. No service. No vector store. Three plain files an agent can read on the first line of any session.

state.json

Source of truth

Machine-readable, per project: current phase, next phase, the exact next-prompt to execute, phases shipped, migrations applied, last commit, last session id.

now.md

For humans

The one-screen "where am I right now." Open it, get the thread back in five seconds — no archaeology.

roadmap.md

What ships next

The Next-3 to ship plus a phase scoreboard. The agent always knows the order of work — and never re-ships a shipped phase.

Templates are gates, not guidance. Canonical session-prompt, session-log, and audit-brief templates mean every session — human or agent — produces the same-shaped artifacts. Structure is enforced, not suggested.

State, Not Memory

Memory tools remember who you are. CASP tracks where your project stands — and proves it. Different artifact, different operation, different failure it prevents.

CASP
Memory layers (Mem0 / Letta)
What it holds
Project execution state
User facts & preferences
Core operation
Validates against git
Stores & recalls
On conflict
Deterministic check vs ground-truth
Fuzzy similarity guess
When it runs
Synchronous gate — blocks the push
Async / eventual recall
Leaves your machine
Never · zero telemetry
Varies / cloud

Five Verbs. Trivially Typed.

One syllable, no homographs, the same in English, French, or Spanish.

casp initScaffold the continuity layer into any repo.
casp statusOne-screen snapshot: phase, next, what's shipped.
casp checkThe drift validator. Mandatory before every push.
casp nextAuto-start the next session from state.next_prompt.
casp new promptGenerate a gated session-prompt from the canonical template.
casp new logOpen a session-log in the shape every session shares.

Native slash-commands too: /casp and /next — works with Claude Code, Cursor, Aider, Continue.

Not a Demo. Two Live Products Run on CASP Today.

Every number below is read straight from each project's state.json — the same file the agent reads, validated against git on the last push. No marketing math.

LIVE

A client-facing fleet-management ERP for a transport company in Côte d'Ivoire — web + mobile, multi-module, multi-role: drivers, vehicles, compliance, cash, garage, litigation, accounting.

13
Phases shipped
12
Migrations tracked
6
Sessions in a day

Every module is a validated phase. The agent reads the cockpit, runs the next phase, and has never re-shipped a shipped module — even on a six-session day.

LIVE

The internal ops & launch-orchestration platform for ZeroSuite — a multi-month roadmap worked by a real team, with launch-mode gating and a tracked post-launch backlog.

41
Phases shipped
17
Migrations
3
Operators

One validated thread across 40+ phases and three people — plus 58 items explicitly deferred past launch, none of them lost. The "big multi-user project" case CASP was built for.

When Agents Run Unattended, Drift Becomes a Fleet Problem.

One agent doing the wrong thing costs an afternoon. A hundred agents doing it across a hundred repos costs a quarter. CASP is the deterministic guardrail you drop into the automation loop.

Required CI check

casp check sits in the same slot as lint and tests. A state that lies can't merge.

Guardrail for fleets

Every agent gets the same validated thread to read and the same hard gate before it pushes.

Audit trail, free

Every state transition is a git commit. git log is your compliance trail.

Passes infosec

Local-only, zero telemetry, no cloud, no account. The security review is one line: it never leaves the machine.

Give Every Project a Thread Your Agent Can't Lose.

Install, init, and your agent reads the truth on its first line. Ship in two minutes.