Skip to Content
harness-kit

Troubleshooting

What the most common messages mean and how to clear them.

Find the message or symptom you see, then read its cause and fix. To look closer at any single call, see Debugging a configuration.

Every tool call is blocked: "harness-kit is not built, so its guards cannot judge this call, which is blocked"

Cause: the project's dependencies are not installed, or the kit's bundle was removed: a fresh clone or worktree, rm -rf node_modules, git clean -fdx. Until you install, the hook blocks every tool call except the install command and the tools no Policy judges, so the guardrails are never silently off.

Fix

Run the install command the message names, such as npm ci, typed alone from the project root: with cd … &&, a pipe or a redirection it is blocked too. The agent may run it as well, and its Read, Grep and Glob tools keep working meanwhile. Hooks for other events only print a note.

"The harness configuration … is invalid" (or missing, or cannot be loaded)

Cause: the configuration does not load. Until it does, the agent may only read, run harness-kit config check and edit the configuration's own files.

Fix

Run npx harness-kit config check. It names each problem and its fix. The usual ones:

  • an unknown option or key, or a wrong type;
  • a Policy id listed twice;
  • an option that loosens an extended configuration;
  • a configuration module that takes longer than 5 seconds to load.

settings check says "… does not match the harness configuration"

Cause: .claude/settings.json no longer holds the hook entries the configuration needs. A Policy for another hook event was added, a timeout grew, or the settings were edited by hand.

Fix

Run npx harness-kit settings sync and commit the file.

Nothing happens: the hook never refuses or comments

Cause: Claude Code runs no hook entry of the kit. The hooks were never turned on, .claude/settings.json was overwritten, or the session started before the entries were written.

Fix

Run npx harness-kit settings check. If it reports a difference, run npx harness-kit settings sync, then start a new Claude Code session. To see what a call would get without the agent, use harness-kit explain (quick start).

The agent's call is refused but should pass

Run the call through harness-kit explain to see which Policy refused it (the quick start shows how). Then find that Policy here:

Refused byCauseFix
self-protection or hook-bypassit writes the harness's own files, or runs git around its hooksa person turns an area off or declares an override
a command tablethe command is on a deny list, in production, or on no list of an allow-listadd it to allow, or let a person run it
allowed-pathsthe file is outside allowOnlywiden the list in the configuration that defines it

Claude Code asks permission for a harmless command

Cause: a Policy that reads shell commands could not resolve what the command writes, such as a path built from a variable set by read or a loop. It asks instead of guessing: ask. The question names each construct it could not resolve.

Fix

Approve it when nothing it names touches a guarded file. Writing the path literally, or assigning the variable a plain value once before the write, lets such a command through without asking.

A guardrail did not apply: policy_failed_open

Cause: the Policy failed or ran out of time, and its fail mode let the call through. The line on standard error names the Policy and the problem. Common causes:

  • git or gh missing from the hook's PATH;
  • a slow network call;
  • a timeout too short for a large repository.

Fix

Raise the entry's timeoutMillis and run harness-kit settings sync again.

The agent cannot stop: a stop check keeps blocking

Cause: a stop check blocks once for each state of what it objects to, and again only when that state changes. An agent that keeps changing things without fixing the cause (a flaky test that fails differently each time) keeps it blocking.

Fix

Fix the cause, or ask the agent to say in its hand-off why it stops. To end one session regardless, start Claude Code with the entry's override variable.

"harness-kit cannot run here: it needs macOS or Linux and Node.js 26 or newer"

Cause: the hook runs with the Node on Claude Code's PATH, which can differ from your shell's, for example when a version manager is set up only in your interactive shell.

Fix

Make Node 26 or newer the default, or start Claude Code from a shell where it is.

Every prompt is refused at the start of a session

Cause: a toolchain pin does not match the installed version.

Fix

Install the pinned version and start a new session. When the check misread your setup, start Claude Code with HARNESS_ALLOW_ENV_SKEW=1.

"Lockfiles of several managers" or "yarn is not supported"

Cause: the kit finds the project's package manager from its lockfiles, and yarn is not supported.

Fix

Remove the lockfile of the manager you do not use, or set the configuration's packageManager.

On this page