You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Re-center the README around the actual product: repo-native decision
context for coding agents.
## Changes
- move the agent workflow and trust model to the top of the document
- clarify why code and tests alone are insufficient for agents
- reorder demos and quick start around the primary agent workflow
## Testing
- README update only
Copy file name to clipboardExpand all lines: README.md
+74-61Lines changed: 74 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# codecontext
2
2
3
-
Decision context attached to code, with freshness checks when code changes.
3
+
Repo-native decision context for coding agents, with freshness checks when code changes.
4
4
5
5
---
6
6
7
7
## The One-Character Bug That Cost $12,000
8
8
9
-
Someone changed `>` to `>=`. Tests were green. Review was green. Deploy was green.
9
+
An agent or engineer saw `>` and "cleaned it up" to `>=`. Tests were green. Review was green. Deploy was green.
10
10
11
11
Three days later, 0.3% of transactions started processing twice. The payment gateway sometimes emits timestamps exactly on the cutoff boundary during clock-skew windows. The original author knew that. `>` was not an accident. But the reason was trapped in an 8-month-old commit message buried under 47 more commits.
12
12
@@ -27,17 +27,68 @@ Now the constraint is visible before anyone edits the code, human or agent. If s
27
27
28
28
A test would help, and you should still want one. But tests and context do different jobs. A test proves that `>=` breaks behavior only if someone already wrote the exact boundary-case test. `@context` explains why the odd-looking `>` is intentional before an editor, reviewer, or agent "cleans it up." Tests protect behavior. `@context` protects intent.
29
29
30
-
### Why Not Just Tests?
30
+
Agents can read code and tests, but they still miss intent when the rationale is trapped in history instead of attached to the line they are editing.
31
+
32
+
### Why Code And Tests Are Not Enough For Agents
31
33
32
34
Because tests and decision context solve different problems.
33
35
34
36
- Tests tell you whether behavior is correct.
35
37
-`@context` tells you why surprising-looking behavior is intentional.
36
38
- Tests usually fail after someone changed the code.
37
39
-`@context` shows up while they are editing the line, reading the diff, or reviewing the change.
40
+
- Agents can read both code and tests, but they do not reliably reconstruct historical rationale from them.
38
41
39
42
Good teams want both: tests to protect behavior, and attached context to protect intent.
40
43
44
+
## Agent Workflow
45
+
46
+
This is the core loop:
47
+
48
+
```
49
+
1. Brief the agent before edits
50
+
2. Let it change code
51
+
3. Check whether it invalidated attached decisions
52
+
4. Force re-verification before the change lands
53
+
```
54
+
55
+
In practice:
56
+
57
+
```bash
58
+
$ npx codecontext --scope src/payments/gateway.ts
59
+
$ <agent reads file and edits>
60
+
$ npx codecontext --diff HEAD src/payments/gateway.ts
61
+
```
62
+
63
+
The `--json` flag produces structured output that agents and tools can consume directly:
The trust model is simple: the context is repo-native, versioned, reviewable in PRs, visible in diffs, and enforceable in hooks and lint. That makes it far more durable for agents than rationale hidden in commit archaeology, external docs, or memory files.
91
+
41
92
## Why Everything Else Falls Short
42
93
43
94
You already have places to store decisions. They mostly fail at one job: **showing up at the exact moment someone is about to break the code.**
@@ -151,62 +202,21 @@ Examples live in [`examples/`](examples/) and include both TypeScript and Go sou
151
202
152
203
## Terminal Demos
153
204
154
-
If you want to see the workflow before reading the rest, these three short demos show the briefing, registry, and freshness gate.
205
+
If you want to see the workflow before reading the rest, these three short demos show the briefing, freshness gate, and registry.
155
206
156
207
These demos are generated from source-controlled VHS tapes in [`docs/demos/tapes/`](docs/demos/tapes/) and can be re-rendered with `pnpm demo:render`.
Coding agents are powerful but context-poor. They read code, but not the decision chain that made the code look this way. They see `>` and have no native way to know it is load-bearing.
173
-
174
-
codecontext gives them a simple briefing loop:
175
-
176
-
```
177
-
Agent workflow:
178
-
1. npx codecontext --scope <file> ← "what should I know?"
179
-
2. Read the file ← "now I'll read the code"
180
-
3. Make changes ← "informed by context"
181
-
4. npx codecontext --diff HEAD <file> ← "did I break any decisions?"
182
-
```
183
-
184
-
The `--json` flag produces structured output that agents and tools can consume directly:
A Claude skill is included in `skills/codecontext/` to automate this workflow: read context before edits, check invalidation after edits, and maintain annotations as code evolves.
0 commit comments