Skip to content

Bug: Unquoted $CLAUDE_PLUGIN_ROOT in aws-serverless hook breaks on paths with spaces #146

@PSalant726

Description

@PSalant726

Problem

The aws-serverless plugin's PostToolUse hook command references ${CLAUDE_PLUGIN_ROOT} without quoting and without an explicit shell interpreter. When CLAUDE_CONFIG_DIR (and therefore CLAUDE_PLUGIN_ROOT) contains a space — e.g. /Users/me/Work/Company Name/.claude — the shell word-splits the path and the hook fails on every Edit/Write with:

PostToolUse:Edit hook error
Failed with non-blocking status code: /bin/sh: /Users/me/Work/Company: is a directory

Affected file

plugins/aws-serverless/hooks/hooks.json

"command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate-template.sh",

The path is passed directly to /bin/sh -c with no quotes and no bash prefix. When the expanded path contains a space, /bin/sh interprets the first word as the command name.

Fix

Add bash and wrap the path in escaped double quotes:

"command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/validate-template.sh\"",

This matches the pattern used by other plugins (e.g. superpowers in anthropics/claude-plugins-official).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions