15 Cowork File Io

§2.7. In Cowork, hook side effects (file writes) don't reach the shell sandbox. Only stdout/additionalContext flows through. This probe writes a canary file from a hook (via the inline command below) then tries to read it from Bash tool.

kazukinagata Updated

File contents

15-cowork-file-io

§2.7 — Cowork で hook 内 file write が届かない。

step 1: alive-check と canary 確認

proj="${CLAUDE_PROJECT_DIR:-$PWD}"
ver="${VERIFIER_VERSION_DIR:-v-unknown}"
sid="${CLAUDE_SESSION_ID:-no-sid}"
out_dir="$proj/findings/$ver/$sid"
mkdir -p "$out_dir"
{
  printf '[15-BODY %s] tag=alive-check\n' "$(date -Iseconds)"
  printf '[15-BODY] file-io-canary files in /tmp:\n'
  ls -la /tmp/file-io-canary-*.txt 2>&1
} | tee -a "$out_dir/probe.log"
echo
echo "=== probe.log: 15-FM-hook lines (proves hook was called) ==="
grep "15-FM-hook" "$out_dir/probe.log" 2>&1

完了して exit、./scripts/assert.sh 15

kazukinagata/analyzing-claude-plugin/tree/main/verifier/skills/15-cowork-file-io commit fe4a8ac053

Frequently asked questions

npx skillmds@latest add kazukinagata/15-cowork-file-io