diff --git a/.claude/memory/MEMORY.md b/.claude/memory/MEMORY.md index 1a3bf89..5fc2e07 100644 --- a/.claude/memory/MEMORY.md +++ b/.claude/memory/MEMORY.md @@ -2,3 +2,4 @@ - [No nohup with pueue](feedback_no_nohup_with_pueue.md) — run `pueue follow|wait` directly as the bg task; nohup& orphans it from the harness. - [Burn down task list](feedback_burn_down_task_list.md) — when many asks are queued, do them all; don't stop to ask which first. - [Workshop paper goal](project_workshop_paper_goal.md) — current phase is ablations+seeds for a workshop paper; artifact tracker A1-A7 lives in docs/spec/20260602_writeup_spec.md. +- [Bash-tool shell gotchas](bash-tool-shell-gotchas.md) — noclobber ON + pi --mode json gives 0 bytes; use panel_direct.py / `>|` (generic box/env note, not repo-specific). diff --git a/.claude/memory/bash-tool-shell-gotchas.md b/.claude/memory/bash-tool-shell-gotchas.md new file mode 100644 index 0000000..13d1fd4 --- /dev/null +++ b/.claude/memory/bash-tool-shell-gotchas.md @@ -0,0 +1,33 @@ +--- +name: bash-tool-shell-gotchas +description: Bash-tool zsh has noclobber ON and pi --mode json gives 0 bytes (non-tty); workarounds +metadata: + node_type: memory + type: feedback + originSessionId: ba4a4349-3947-4bfe-87fc-2d6e99001352 +--- + +The Bash tool runs a zsh where `noclobber` is ON, and it is NOT set in any user rc +file (`~/.zshrc`, `~/.zshenv`, etc. — grep finds nothing). So the harness/wrapper +sets it; editing `~/.zshrc` does NOT turn it off. Symptom: `cmd > existing_file` +fails with `file exists: ` 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. + +2. **noclobber refuses `>` onto existing files.** Use `>|` to force-overwrite, or + `rm -f` first, or have the program write the file itself (Python `Path.write_text`, + `tee` both work; `>` redirect does not). + +**Why:** wasted ~an hour chasing 0-byte panel output that looked like an auth/model +problem but was noclobber + pi-tty. **How to apply:** when a `>` redirect or a piped +CLI returns 0 bytes, suspect these two before debugging the tool itself. + +Also: batching many Bash calls in one message causes cascade-cancellation — if the +first errors (e.g. the noclobber test exits 2), the rest are all cancelled. Run +diagnostics sequentially. See [[projected-grpo-rebuild-from-pseudocode]].