addyosmani / addyosmani/agent-skills

SessionStart hook fails when plugin path contains a space (unquoted ${CLAUDE_PLUGIN_ROOT})

Offen
#214 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
93.8k
Forks
10k
Ø Merge
3 T. 15 Std.
Gemergte PRs (30 T.)
23

Beschreibung

@
### Description

The `SessionStart` hook fails on startup when the plugin is installed under a path containing a space (e.g. a Windows home folder like `C:\Users\Win 10\`).

### Error

```
SessionStart:startup hook error
Failed with non-blocking status code: /c/Users/Win: /c/Users/Win: Is a directory
```

### Root cause

In `hooks/hooks.json` the command is not quoted:

```json
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"
```

When `${CLAUDE_PLUGIN_ROOT}` expands to a path containing a space (e.g. `/c/Users/Win 10/.claude/plugins/...`), the shell word-splits it and `bash` receives `/c/Users/Win` as the script argument, producing the `Is a directory` error.

### Fix

Quote the path:

```json
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\""
```

The internal `session-start.sh` already quotes its paths correctly (`SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"`), so only `hooks.json` needs the fix.

### Environment

- OS: Windows 10 (Git Bash)
- Home folder with space: `C:\Users\Win 10\`
- Claude Code v2.1.159
@

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.