From a3ac3817240f2c9a696fe0f6b902aa3a16917c80 Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Sat, 6 Jun 2026 13:48:59 +0000 Subject: [PATCH] memory: correct pi --mode json gotcha (blocks on stdin, fix is --- .claude/memory/bash-tool-shell-gotchas.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.claude/memory/bash-tool-shell-gotchas.md b/.claude/memory/bash-tool-shell-gotchas.md index 13d1fd4..cbe12a0 100644 --- a/.claude/memory/bash-tool-shell-gotchas.md +++ b/.claude/memory/bash-tool-shell-gotchas.md @@ -1,6 +1,6 @@ --- name: bash-tool-shell-gotchas -description: Bash-tool zsh has noclobber ON and pi --mode json gives 0 bytes (non-tty); workarounds +description: Bash-tool zsh has noclobber ON; pi --mode json hangs on stdin (fix: ` and writes 0 bytes. Two recurring consequences and fixes: -1. **`pi --mode json` writes to the tty, not stdout.** In this non-tty shell, - `pi ... | extractor` or `pi ... > file` yields 0 bytes (silently). Fix: skip pi, - hit OpenRouter HTTP directly — see `~/.claude/skills/external-review/panel_direct.py` - (stdlib-only, reads key from /root/.env). This is the robust path for the - external-review comprehension panel and external-panel Q&A. +1. **`pi --mode json` HANGS waiting on stdin in the Bash tool** (exit 124 on timeout, + 0 bytes, even on a fast valid model; text mode works fine). The earlier "writes to + tty" diagnosis was wrong. Real fix: redirect ` --no-tools --no-skills -nc --system-prompt "$SYS" -p "$P" --mode json ` onto existing files.** Use `>|` to force-overwrite, or `rm -f` first, or have the program write the file itself (Python `Path.write_text`,