fix(session-inbox-monitor): hook source .claude-inbox → .agents/inbox

This commit is contained in:
2026-08-12 13:34:47 +03:00
parent 8682cd7e09
commit 8e280f48a5

View File

@@ -8,9 +8,9 @@
# string (CLAUDE_INBOX_MONITOR) baked into the poll command PLUS
# this project's inbox path - so we never touch unrelated processes.
# (b) INJECT - additionalContext telling the agent to raise a persistent
# Monitor (Monitor TOOL, not background Bash) on <project>/.claude-inbox.
# Monitor (Monitor TOOL, not background Bash) on <project>/.agents/inbox.
#
# Opt-in per project: fires only when the project has a `.claude-inbox/` dir OR a
# Opt-in per project: fires only when the project has a `.agents/inbox/` dir OR a
# CLAUDE.md line `inbox monitor: raise on start`.
#
# Headless (`claude -p`): there is NO reliable hook-level signal to detect it
@@ -38,7 +38,7 @@ if (-not $ProjectDir) { exit 0 }
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.Encoding]::UTF8
$inbox = Join-Path $ProjectDir '.claude-inbox'
$inbox = Join-Path $ProjectDir '.agents/inbox'
$claudeMd = Join-Path $ProjectDir 'CLAUDE.md'
# --- opt-in gate -----------------------------------------------------------
@@ -73,7 +73,7 @@ try {
# process command line without polluting the event stream. De-dups by filename
# so a sitting message pages once, not every 15s (a noisy monitor is auto-stopped).
$cmd = @'
: CLAUDE_INBOX_MONITOR; d='__INBOX__'; s=' '; while true; do for f in "$d"/*.md; do [ -e "$f" ] || continue; n=$(basename "$f"); case "$s" in *" $n "*) continue;; esac; s="$s$n "; echo "New inter-session message in inbox: $n - read .claude-inbox/ and handle it now"; done; sleep 15; done
: CLAUDE_INBOX_MONITOR; d='__INBOX__'; s=' '; while true; do for f in "$d"/*.md; do [ -e "$f" ] || continue; n=$(basename "$f"); case "$s" in *" $n "*) continue;; esac; s="$s$n "; echo "New inter-session message in inbox: $n - read .agents/inbox/ and handle it now"; done; sleep 15; done
'@
$cmd = $cmd.Trim().Replace('__INBOX__', $inboxFwd)