CLAUDE_PLUGIN_ROOT not injected into PostToolUse hook subprocess on Windows (local agent mode)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 29, 2026

Description

In local agent mode on Windows, the environment variable CLAUDE_PLUGIN_ROOT is not being injected into hook subprocess environments. This causes plugins that register PostToolUse hooks to fire noisy errors on every Write/Edit tool call.

Error observed

python3 '${CLAUDE_PLUGIN_ROOT}/hooks/validate_antipatterns.py': no such file

The variable is not being resolved — the path is treated as a literal string rather than expanded. This fires on every Write and Edit tool call, producing persistent noise across the session.

Affected plugin

  • Plugin ID: plugin_01HuktqZUKz58qgxUm1mfuh6 (Pixeltable)
  • Hook type: PostToolUse
  • Hook command pattern: python3 '${CLAUDE_PLUGIN_ROOT}/hooks/validate_antipatterns.py'

Workaround

Plugin had to be disabled entirely to eliminate the noise. No in-session workaround available.

Environment

  • Platform: Windows (local agent mode)
  • Traced by: Ezra Locke (DDL-3008) on 2026-07-28 during a multi-session org reboot

Expected behavior

CLAUDE_PLUGIN_ROOT should be injected into the subprocess environment before hook commands are executed, so that the plugin root path resolves correctly on Windows.

Additional context

This appears to be a Windows-specific issue with how environment variables are passed (or not passed) to hook subprocess environments in local agent mode. The same plugin may work correctly on other platforms if env injection is handled differently there.

View original on GitHub ↗