spec
workspace.json vs AGENTS.md: Prescriptive vs Descriptive Context
A direct comparison of the two leading AI codebase context formats and why the distinction matters for agent reliability.
OPEN SPECIFICATION · v0.4 · Apache 2.0
workspace.json is an open standard for repository-scoped behavioral intelligence: a committed, evidence-tiered record of which files break and which change together, readable by any agent and enforceable before an edit lands.
One spec, multiple consumers: Codex and Buildomator (formerly gsd-plugin) both read workspace.json to give agent platforms codebase context.
01 · The Problem
Every codebase has files that everyone is afraid of. The authentication flow that broke twice last year. The webhook handler nobody fully understands. The component that was AI-generated, then patched fourteen times. This information lives in the heads of senior engineers and in Slack threads from six months ago. It does not live anywhere a coding agent can find it.
When an agent picks up a task, it sees a flat repository. It cannot tell that one file has been the source of half your production incidents this quarter, or that changing one type definition cascades into seven others. So it works confidently — and it breaks things confidently.
AGENTS.md helps. It gives agents a place to read instructions. But instructions are prose, written by humans, and they age. A codebase changes; the file describing it in words cannot keep up. There is no mechanism to tell an agent what is true about the repository right now — only what a developer wrote about it at some point in the past.
02 · The Solution
workspace.json is placed at .agents/workspace.json and
committed to version control. Tooling generates it — from git history,
IDE telemetry, CI signals, and behavioral observation. Agents read it
before they act. Developers commit it alongside the code it describes.
| File | Role | Author | Updates |
|---|---|---|---|
AGENTS.md | Prescriptive — what agents should do | Human | By hand |
workspace.json | Descriptive — what is currently true | Tooling | Automated |
The two files are designed to compose. A repo can have both, either, or neither. Tools that consume AGENTS.md continue to work unchanged. Tools that also consume workspace.json get richer, current context.
03 · Signal Families
{ "manual": {}, "generated": { "specVersion": "0.3", "generatedAt": "2026-07-30T12:47:49.867Z", "by": { "name": "agents-audit", "version": "0.4.4" }, "frameworkManifest": [], "fileIndex": {}, "topology": { "packageCount": 0, "type": "single-package", "ciProvider": "github-actions", "agentFiles": { "agentsMd": "AGENTS.md", "workspaceJson": ".agents/workspace.json" } }, "hygiene": { "score": 100, "grade": "A", "failCount": 0, "warnCount": 0, "scannedAt": "2026-07-30T12:47:49.867Z" } }, "agents": {}, "health": { "intelligenceState": "INSUFFICIENT_DATA", "observationCount": 0, "confidence": 0 }}
This is the real, current output of npx agents-audit@0.4.4,
run against this repository — reproduce it yourself rather than trust this page.
The artifact records the generator, its version, and generation time. It does not infer evidence that the producer did not emit.
The producer describes the repository topology and canonical
.agents/workspace.json location used by consumers.
agents-audit's original function — an AGENTS.md audit score — ships alongside the newer behavioral fields, not replaced by them.
specVersion reads 0.3 here. The v0.4 schema
defines coChange, fragility, and conventions,
but the reference generator does not emit them yet — that gap is the spec's, not
this page's, and it's stated here rather than hidden behind a nicer example.
04 · How It Works
Run npx agents-audit scan . in any repository. The reference CLI
emits a conformant workspace.json under .agents/. For richer
signals — fragility derived from incident history, behavioral
co-change — pair with a daemon that observes sessions over time.
Add .agents/workspace.json to version control. Every
contributor, every CI run, and every agent session now shares the same
view of the repository's current state.
Any AI coding agent that reads workspace.json gets structured,
current context before it acts. No configuration required beyond knowing
where to look.
05 · For Implementers
The spec is at workspacejson.dev/spec. The JSON Schema is served at
workspacejson.dev/schema/v1.json and can validate any generated file
in CI. The npm packages @workspacejson/spec and @workspacejson/rules
expose the schema and validation rules for TypeScript integrations.
If you're building a generator or consumer, open an issue in the workspacejson/cli tracker. Canonical source and compatibility material are maintained in public.
Showcase
DataHub knows lineage and schema. Git knows which files change together. The join sounds trivial: a dbt model is a file. But when a dbt project lives in a subdirectory, every lookup misses and the join returns zero rows, silently, with no error. Tally is a Change Impact Cockpit that resolves the mismatch, joins catalog context with repository evidence, and attaches a bounded receipt to every claim.
Read the Tally showcase for the five-act narrative: the silent failure, the mechanism, the evidence that changed the plan, the verifiable receipt, and the honest evidence boundary.
spec
A direct comparison of the two leading AI codebase context formats and why the distinction matters for agent reliability.
ai
Five behavioral signals in AI-assisted development that cloud code analysis cannot observe: session telemetry, intra-session reverts, and review-time risk.
v0.4 is a draft. The signal families are defined; the computation methods are intentionally open. What confidence scores should look like, how multiple generators should merge overlapping outputs, what negative space means for files the generator inspected and had nothing to say about — these are open questions with no settled answers yet.
Comment. Argue. Implement a draft.
The spec exists to be torn apart in public.