From c045dff1c6b0a3a07eb738b0895951ad3baf6e15 Mon Sep 17 00:00:00 2001 From: gyy0592 Date: Sat, 4 Apr 2026 01:25:36 +0000 Subject: [PATCH 1/2] fix: normalize path slashes in PostToolUse hook to prevent session_id write failure When CLAUDE_PLUGIN_ROOT has a trailing slash, the command template produces double slashes (e.g. "humania//scripts/setup-rlcr-loop.sh"). The setup script normalizes its own path via cd+pwd (single slash), but tool_input.command preserves the original double-slash string. This causes the boundary-aware string match in loop-post-bash-hook.sh to always fail, so the .pending-session-id signal is never consumed and session_id is never written to state.md. With an empty session_id, find_active_loop() backward-compat logic matches any session, causing cross-instance stop hook hijacking when multiple Claude Code sessions run concurrently. Fix: normalize consecutive slashes with tr -s '/' before comparison. Fixes: https://github.com/humania-org/humanize/issues/67 Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude-plugin/marketplace.json | 2 +- .claude-plugin/plugin.json | 2 +- README.md | 2 +- hooks/loop-post-bash-hook.sh | 10 ++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 5895b6ed..781c5e4c 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -8,7 +8,7 @@ "name": "humanize", "source": "./", "description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.", - "version": "1.15.1" + "version": "1.15.2" } ] } diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 671561ce..93e1b789 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "humanize", "description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.", - "version": "1.15.1", + "version": "1.15.2", "author": { "name": "humania-org" }, diff --git a/README.md b/README.md index bf969241..7e46527b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Humanize -**Current Version: 1.15.1** +**Current Version: 1.15.2** > Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project. diff --git a/hooks/loop-post-bash-hook.sh b/hooks/loop-post-bash-hook.sh index eeed7bde..4dee0e7f 100755 --- a/hooks/loop-post-bash-hook.sh +++ b/hooks/loop-post-bash-hook.sh @@ -67,6 +67,16 @@ if [[ -n "$COMMAND_SIGNATURE" ]]; then exit 0 fi + # Normalize consecutive slashes (e.g. "humania//scripts" -> "humania/scripts"). + # CLAUDE_PLUGIN_ROOT may have a trailing slash, producing double slashes when + # concatenated with "/scripts/..." in the command template. The setup script + # normalizes its own path via cd+pwd (removing double slashes), but the + # tool_input.command preserves the original string. Without normalization, + # the string comparison below always fails and session_id is never written. + # See: https://github.com/humania-org/humanize/issues/67 + HOOK_COMMAND=$(printf '%s' "$HOOK_COMMAND" | tr -s '/') + COMMAND_SIGNATURE=$(printf '%s' "$COMMAND_SIGNATURE" | tr -s '/') + # Boundary-aware match: command must be a valid setup invocation form. # Requires the script path to be followed by end-of-string or any POSIX # whitespace ([[:space:]]), preventing concatenated forms. From 707097c52da364381addd9b34d47ca3b183a7f63 Mon Sep 17 00:00:00 2001 From: gyy0592 Date: Sat, 4 Apr 2026 18:35:28 +0000 Subject: [PATCH 2/2] revert: remove version bump, keep only hook fix Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude-plugin/marketplace.json | 2 +- .claude-plugin/plugin.json | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 781c5e4c..5895b6ed 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -8,7 +8,7 @@ "name": "humanize", "source": "./", "description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.", - "version": "1.15.2" + "version": "1.15.1" } ] } diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 93e1b789..671561ce 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "humanize", "description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.", - "version": "1.15.2", + "version": "1.15.1", "author": { "name": "humania-org" }, diff --git a/README.md b/README.md index 7e46527b..bf969241 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Humanize -**Current Version: 1.15.2** +**Current Version: 1.15.1** > Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.