From 7c3af56802ec82cda3752e1a8e428cd92bd5471b Mon Sep 17 00:00:00 2001 From: William Thorsen Date: Tue, 14 Jul 2026 17:58:03 -0700 Subject: [PATCH 1/2] root|fix: Remove visualization hooks that logged an error each prompt Sessions no longer log a spurious "No such file or directory" error on every prompt submitted from a repository subdirectory. The Claude Code hooks responsible only fed a visualization that has been dormant for months and never ran outside this repository, so they and their scripts are removed. --- .claude/hooks/on-input-received.sh | 12 ------------ .claude/hooks/on-waiting-for-input.sh | 20 -------------------- .claude/settings.json | 23 ----------------------- 3 files changed, 55 deletions(-) delete mode 100755 .claude/hooks/on-input-received.sh delete mode 100755 .claude/hooks/on-waiting-for-input.sh 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" - } - ] - } - ] } } From 719b424147533366082b2e5c7fab5abfc2e15649 Mon Sep 17 00:00:00 2001 From: William Thorsen Date: Tue, 14 Jul 2026 18:01:28 -0700 Subject: [PATCH 2/2] agents|docs: Re-anchor breadcrumb rationale to frontmatter resolution The `orchestrate` skill's breadcrumb-write step now states its real purpose, enabling artifact frontmatter to resolve the active run, instead of citing the removed hooks. --- packages/agents/content/skills/orchestrate/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.