Claude Code cannot find my test command

The prompt is minor. What it leads to is not: a step that could not run gets read as a step that passed.

Last updated: 2026-09-20

Why the prompt is the small part

A missing test command looks like a minor annoyance. The damage is what comes next: a step that could not run is easy to report as a step that did not fail. You get a green summary describing a test run that never happened.

A failing test is information. A test that never ran, reported as a pass, is worse than no test at all — because now you believe something.

The fix, both halves

1. Tell it the command. In CLAUDE.md at the project root:

## Commands
- Test: `pnpm vitest run --silent`
- Lint: `pnpm eslint .`

Verbatim. Including the flags. It is copied, not interpreted.

2. Let it run without asking. In .claude/settings.json:

{ "permissions": { "allow": ["Bash(pnpm vitest:*)", "Bash(pnpm eslint:*)"] } }

Without the second half you have traded a "cannot find it" prompt for an "may I run it" prompt.

How to tell whether tests actually ran

Ask forGood answerBad answer
The commandThe exact string, matching your repoA paraphrase, or nothing
The outputA count: "42 passed, 0 failed""Tests pass"
The exit code0, and it is statedNot mentioned

Make it a habit to ask. It costs one line and it is the difference between a verified change and a claimed one.

Watch for the flags that fake a pass

Some test runners will report success when they ran nothing at all. --passWithNoTests does exactly what it says. So does appending || true to a command. If either appears in a command that is supposed to be proving your change works, the proof is gone.

Worth writing into your CLAUDE.md never-list, where it applies to every session automatically.

Related

Claude Code forgets my project every session is the same file solving the bigger version of this problem. Claude Code keeps asking permission is the second half of the fix above.

What does it cost to have someone set this up?

Flat prices, written scope, stop at any rung. No call to book, no retainer.

RungWhat you getClock
Free — starter repoA real setup you copy yourselfnow
$29 — Setup LiteOne project: CLAUDE.md, allowlist, one skill, as a pull request you review24 hours
$99 — Setup Sprint3–5 skills, hooks, up to 3 MCP servers, plus a runbook48 hours
$79 — Surface AuditAlready set up and still fighting it: contradictions and an exact fix list48 hours
Setup Lite $29 Or start free

Clocks run from a complete intake, not from the Stripe receipt.