A Claude Code subagent that can only read files found both bugs I planted behind a green suite of four tests, and the fix ended at 6 of 6 passing.

GitHub logo agentshipped / notes-api

Agent Shipped demo repo (notes-api): the public playground used in the channel's videos.

notes-api

A tiny Express notes API. This is a public demo repo for the Agent Shipped YouTube channel techniques from real projects are shown here, on code anyone can clone.

npm install npm start # http://localhost:3000/notes npm test # node:test (no tests yet - that is on purpose)

Endpoints: GET /health, GET /notes, GET /notes/:id, POST /notes {title, body}, DELETE /notes/:id.

Shown in

Videos on the Agent Shipped channel that use this repo:

The setup: a small notes API, four passing tests, two one-token bugs committed as a "tidy-up", and a reviewer subagent with no edit tool and no shell. Below are the agent file, the commands, the prompt wording and the counts.

The agent file

The reviewer is one markdown file of eight lines. One command writes it, sets the test script, commits, and tags the result start. Every diff in the run is measured against that tag.

--- name: reviewer description: "Read-only code reviewer. Use after any change touching more than one file." tools: Read, Grep, Glob --- Report findings as file:line - problem - why. Do not edit files. Say 'no findings' when there are none. 

Three facts matter.

  • The description is the trigger. The main session compares its task with that one line. A vague description means the subagent never gets called.
  • The tools line is the permission set. Read opens a file, Grep searches text, Glob lists names. With no edit tool and no shell, the reviewer cannot change a file or run git or the tests. The tool is missing, so the action does not exist.
  • The reviewer has its own context. Only its final report comes back, so the main session stays small. It also knows only what it is shown.

The last body line, "say no findings when there are none", matters later.

Terminal showing the eight-line reviewer agent file, including the tools line Read, Grep, Glob.
The whole agent: description as trigger, tools line with no edit and no shell. · watch this step

The feature

The main session adds a ?limit= query to GET /notes: default 20, maximum 100, in a new module the route calls. I dictated the exact lines so the next step has something precise to break. Four tests cover the parser: the default, a small number, the number at the maximum, and text being rejected. None asks about a number just above the maximum, and none touches the delete route.

Green at four

git show --stat --format=%s HEAD | head -12 && npm test 2>&1 | grep -E '^# (tests|pass|fail) ' 

Four tests, four passing, none failing. The stat shows more than one file touched, which is the case the reviewer's description names.

Two planted bugs

I plant the defects after the builder has finished, and commit them as a tidy-up:

sed -i 's/n > MAX_LIMIT/n > MAX_LIMIT + 1/' src/limit.js sed -i '/store\.remove(/s/status(404)/status(200)/' src/index.js git commit -qam 'Tidy limit and delete handling' 

A limit of 101 is now accepted although 100 is the ceiling. An unknown id on delete now answers 200 instead of 404, so a client cannot tell a real delete from a typo.

Terminal showing the diff of the two planted changes and a count of one added status 200 line.
The two one-token changes: MAX_LIMIT + 1 and status(200) in the delete route. · watch this step

Still green

The suite does not notice: four tests, four passing, none failing. The maximum test sends exactly 100, which still passes with the plus one. Only 101 behaves differently, and no test sends it. No test calls the delete route. A passing count only extends to the code as far as the tests reach.

Terminal showing the test summary with four tests, four passing and none failing after the bugs were planted.
Same counts as before the damage: the suite does not notice. · watch this step

The review

The reviewer has no shell, so the main session runs the diff and passes the text across:

Run git diff start HEAD yourself, then use the reviewer subagent to review that change. Pass it the full diff text and the file names src/limit.js, src/store.js, src/index.js and test/limit.test.js so it can read them. Give it this spec: ... 

The spec says the limit must be an integer from 1 to 100 with a default of 20, and what delete must answer for an unknown id. Without a spec a reviewer can only comment on taste. The report held two findings, each with file and line, the problem, and the rule it breaks: 101 passes the limit check, and an unknown id gets a success status. Both were found by reading, with no test run.

Red first

A finding is a claim and a test is the proof. Each finding became a regression test in test/review.test.js, and the suite had to fail before anything was fixed: six tests, four passing, two failing. The limit test got a number where it expected null. The delete test got 200 where it expected 404. A test that has never failed has never shown it can.

The fix

The maximum check went back to the plain comparison and delete answers 404 again. The prompt said to fix the source files only, without touching any test file, so the fix had to satisfy tests it did not write. Result: six tests, six passing, none failing.

Second pass

The same reviewer got the same spec on the repaired diff. The report was one line: no findings. A reviewer that flags every diff proves nothing. This one flagged the broken diff and cleared the fixed one.

The verdict

npm test 2>&1 | grep -E '^# (tests|pass|fail) ' && git log --oneline start..HEAD 

Six tests, six passing, none failing, and three commits since start: the feature, the planted tidy-up, and the fix.

Terminal showing six tests, six passing, none failing, and three commits since the start tag.
Final counts: 6 of 6 passing, three commits since start. · watch this step

Install it

The read-only reviewer is a subagent that can read, search and list files and nothing else, and Claude Code can pick it after a change that touches more than one file.

/plugin marketplace add agentshipped/kit /plugin install readonly-reviewer@agentshipped 

It cannot edit a file or run a command, so it works only from the diff and the files you hand it; anything outside that stays unseen.

Source and README: https://github.com/agentshipped/kit/tree/main/plugins/readonly-reviewer

What to copy

  • A tools line of Read, Grep, Glob: the missing tool is the guarantee, not a rule in the prompt.
  • A description that names the trigger, such as a change touching more than one file.
  • A final line telling the reviewer to say "no findings", so a clean second pass is possible.
  • Run the diff in the main session and pass the text and a spec to the reviewer.
  • Turn each finding into a failing test before the fix, and keep the fix out of the tests.

Not just JavaScript

The same read-only reviewer works in any stack: pytest, go test or JUnit instead of node --test, and the tools line (read, search, list; no edit, no shell) is the part that carries over.

Video with the full run: https://youtu.be/PlZRT3prO0g

Techniques from my real projects, shown on a public demo repo.
Narration: AI voice. The sessions, code and errors are real. Not affiliated with Anthropic or any tool vendor.