diff --git a/.claude/hooks/on-input-received.sh b/.claude/hooks/on-input-received.sh deleted file mode 100755 index add13664..00000000 --- a/.claude/hooks/on-input-received.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -BREADCRUMB=".claude/tmp/active-run-dir" -[ -f "$BREADCRUMB" ] || exit 0 - -RUN_DIR=$(cat "$BREADCRUMB") -LOG_FILE="$RUN_DIR/run-log.jsonl" -[ -f "$LOG_FILE" ] || exit 0 - -TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ") -echo "{\"t\":\"$TIMESTAMP\",\"event\":\"input_received\"}" >>"$LOG_FILE" diff --git a/.claude/hooks/on-waiting-for-input.sh b/.claude/hooks/on-waiting-for-input.sh deleted file mode 100755 index 9c97a7e5..00000000 --- a/.claude/hooks/on-waiting-for-input.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -BREADCRUMB=".claude/tmp/active-run-dir" -[ -f "$BREADCRUMB" ] || exit 0 - -RUN_DIR=$(cat "$BREADCRUMB") -LOG_FILE="$RUN_DIR/run-log.jsonl" -[ -f "$LOG_FILE" ] || exit 0 - -INPUT=$(cat) -REASON=$(echo "$INPUT" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('notification_type',''))" 2>/dev/null || echo "") - -case "$REASON" in -permission_prompt | elicitation_dialog | idle_prompt) ;; -*) exit 0 ;; -esac - -TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ") -echo "{\"t\":\"$TIMESTAMP\",\"event\":\"waiting_for_input\",\"reason\":\"$REASON\"}" >>"$LOG_FILE" diff --git a/.claude/settings.json b/.claude/settings.json index c3bfbabf..ee09428b 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -7,28 +7,5 @@ "command": "node", "args": ["packages/mcp/dist/esm/cli.js"] } - }, - "hooks": { - "Notification": [ - { - "matcher": "idle_prompt|permission_prompt|elicitation_dialog", - "hooks": [ - { - "type": "command", - "command": ".claude/hooks/on-waiting-for-input.sh" - } - ] - } - ], - "UserPromptSubmit": [ - { - "hooks": [ - { - "type": "command", - "command": ".claude/hooks/on-input-received.sh" - } - ] - } - ] } } diff --git a/packages/agents/content/skills/orchestrate/SKILL.md b/packages/agents/content/skills/orchestrate/SKILL.md index ff09308c..992de7b9 100644 --- a/packages/agents/content/skills/orchestrate/SKILL.md +++ b/packages/agents/content/skills/orchestrate/SKILL.md @@ -229,13 +229,13 @@ Prefix the status line with a colored emoji for visual distinction: The `init_run` tool creates the run directory, writes a v3 `run-index.json` header, creates an empty `run-log.jsonl`, and emits a `run_started` event automatically. Do not write `run-index.json` manually. - **Write breadcrumb** (MCP success path only): After a successful `init_run`, write the active run directory to a breadcrumb file so that Claude Code hooks can discover it: + **Write breadcrumb** (MCP success path only): After a successful `init_run`, write the active run directory to a breadcrumb file so that `resolve-frontmatter.sh` can resolve the active run's `run_id` when stamping artifact frontmatter: ``` mkdir -p .claude/tmp && echo "{run-dir}" > .claude/tmp/active-run-dir ``` - Only write the breadcrumb after a successful `init_run` (MCP available). Do not write it on the MCP-unavailable fallback path. When MCP is unavailable, no `run-log.jsonl` is created, so the hooks have nothing to append to. + Only write the breadcrumb after a successful `init_run` (MCP available). Do not write it on the MCP-unavailable fallback path, where no run directory is created and there is no `run_id` to resolve. **Failure — MCP unavailable** (tool not found / server not connected): Resolve `mcp_policy` (see "Resolving MCP policy" above) and apply the policy: - `required`: Abort with a clear message explaining that MCP is unavailable and the policy requires it.