agent-memory@inline PostToolUse hook fails on Windows usernames with a space (unquoted hook path)

Status Open
Reported on v2.1.295
Maintainer reply None cached
Activity 0 comments · opened Oct 11, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

On Windows accounts whose user-profile path contains a space (e.g. C:\Users\Sven Cramer), the built-in agent-memory@inline plugin's PostToolUse hook fails on EVERY tool call.

The app invokes the hook's Python script WITHOUT quoting its path:

python C:\Users\Sven Cramer\AppData\Roaming\Claude\local-agent-mode-sessions\<sid>\<sub>\rpm\plugin_<id>\hooks\post_tool_use.py

Because the path contains a space, the argument is split and Python receives C:\Users\Sven as the file to run, so it errors with "can't open file 'C:\Users\Sven'".

Impact: non-fatal (the triggering tool call still succeeds), but the agent-memory plugin's post-tool processing never runs, and the error prints after every single tool call. Likely affects any built-in inline plugin's Python hook (and third-party Python hooks materialized under rpm/.../hooks/) for every Windows user whose profile path contains a space.

What Should Happen?

The app should quote the hook script path (or pass argv as an array / use the 8.3 short path) when invoking Python hooks, e.g.:

python "C:\Users\Sven Cramer\...\hooks\post_tool_use.py"

so plugin hooks run correctly for usernames that contain spaces.

Error Messages/Logs

PostToolUse hook blocking error from command:
"python C:\Users\Sven Cramer\AppData\Roaming\Claude\local-agent-mode-sessions\<sid>\<sub>\rpm\plugin_<id>\hooks\post_tool_use.py":
C:\Python314\python.exe: can't open file 'C:\Users\Sven': [Errno 2] No such file or directory
This hook comes from the agent-memory@inline plugin.

Steps to Reproduce

  1. Use a Windows account whose profile path contains a space (e.g. C:\Users\First Last).
  2. Open the Claude desktop app, Claude Code (local agent mode), with the built-in agent-memory@inline plugin active.
  3. Run any tool (Bash / Read / Edit / ...).
  4. After every tool call an error appears: python: can't open file 'C:\Users\First' with the note "This hook comes from the agent-memory@inline plugin."

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.295

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗