Omniscio

OmniscioGuidesHook needs quotes around a path with a space

Claude Code: hook needs quotes around a path with a space

The notification starts with the hook's event name — Stop, PreToolUse, PostToolUse — and ends with the script in parentheses. Both parts matter when you go looking for the hook that needs the fix.

Last checked against Anthropic's documentation on November 26, 2026. By the Omniscio team. Updated .

What is the exact message?

Stop hook needs quotes around a path with a space (check.py)

Anthropic writes Stop and check.py as examples. Yours carries the event your hook is registered for and the file name of its script.

What does it mean?

The script did not run. Anthropic's entry says the notification means exactly that: the hook's path has a space and is not quoted. Underneath, an unquoted path is broken at its spaces before the interpreter sees it, so the file it is told to run does not exist.

It is an asyncRewake hook in shell form. Shell form means the command line is handed to a shell to run, so the shell decides where one argument ends and the next begins; exec form, below, skips the shell. In the command here, an interpreter such as python3 is followed by an unquoted placeholder, a token such as ${CLAUDE_PLUGIN_ROOT}/hooks/check.py that Claude Code fills in with a real path, and that path contains a space — which is why this appears on machines with a user name, a plugin directory or a project folder that has one.

An asyncRewake hook runs in the background and wakes Claude when it exits with code 2. A skipped run means the wake never happened, which is why the hook can be missing for a while without anyone noticing.

How do I fix it?

  1. Find the hook. Search your settings, the project's .claude/settings.json and any plugin for the script name in the parentheses, registered on the event the notification named.
  2. Quote the path in shell form. Anthropic's example, in a JSON settings file: "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/check.py\"". The quotes go around the path placeholder, not around the whole command. Keep the placeholder as it is: Claude Code replaces it with the plugin's real path at run time.
  3. Or use exec form, which needs no quotes. Set args alongside command: Claude Code then resolves the command as an executable, spawns it directly with no shell, and passes each args element as one argument exactly as written. Anthropic recommends args whenever a hook references a path placeholder.
{
  "type": "command",
  "command": "python3",
  "args": ["${CLAUDE_PLUGIN_ROOT}/hooks/check.py"]
}

The exec form above is the same hook with nothing left for a shell to split. On Windows, Anthropic notes that exec form needs a real executable such as an .exe, so a .cmd or .bat shim has to stay in shell form — where quoting is the fix.

The hook reference covers the two forms in full: exec form and shell form.

How do I know it is fixed?

  • The notification stops appearing when the event fires.
  • The hook's effect is visible again: for an asyncRewake hook, the exit that should wake Claude does.
  • Run claude --debug (Anthropic's CLI reference lists the flag) and watch the hook run without a path error.

A hook that starts but never finishes is a different problem: Anthropic records that a hook using asyncRewake still has its timeout enforced.

What does not reliably help

  • Renaming the script to avoid the space. It can work, but the path usually comes from a plugin or user directory you do not control, and an update can put the space back.
  • Quoting the whole command instead of the path. That makes the interpreter and its arguments one word, which fails differently.
  • Adding a timeout. The run never started; a timeout cannot rescue a command the shell could not resolve.

Where these answers come from

  • Anthropic's error reference, read November 26, 2026: the notification, the asyncRewake shell-form cause, and the quoting fix.
  • Anthropic's hooks page, read November 26, 2026: exec form and shell form, the args recommendation for path placeholders, the Windows note, the asyncRewake row and the timeout behaviour.

Common questions

Did my hook run at all?

No. Anthropic's entry says the notification means the hook's script didn't run, because its path has a space and isn't quoted. The notification names the event and the script so you can find the hook.

Why only asyncRewake hooks?

Anthropic names the affected hook as an asyncRewake hook in shell form: in its command an interpreter such as python3 is followed by an unquoted path placeholder, and the resolved path contains a space. That shape is what produces the notification.

Is there a way to avoid quoting altogether?

Yes. Anthropic documents exec form: when the hook sets args, Claude Code resolves the command as an executable and spawns it directly with no shell, and each args element is one argument exactly as written. The docs recommend args whenever the hook references a path placeholder.

Does the quoted form work on Windows too?

The quoting fix applies to shell form on every platform. On Windows, Anthropic notes exec form needs a real executable such as .exe, so a .cmd or .bat shim has to run in shell form, where quoting matters.