Problem
run() in src/lib/git.ts uses execFileSync (no shell), but many tool files still pass shell syntax that silently breaks:
Shell operators: ||, &&, |
Redirects: 2>/dev/null, 2>&1
Prefixing git in strings (becomes a literal arg since execFileSync('git', ['git', ...]))
Shell quoting/escaping
Affected files
PR #109 fixes 3 files. These still need fixing:
verify-completion.ts — cat, tsc --noEmit 2>&1 | tail, npm run build 2>&1 | tail
token-audit.ts — wc -l, wc -c, tail -c, 2>/dev/null
clarify-intent.ts — tsc --noEmit 2>&1 | grep, find ... | head
session-handoff.ts — command -v, gh pr list ... || echo
audit-workspace.ts — find ... | wc -l, 2>/dev/null
enrich-agent-task.ts — git ls-files | grep, head -30
scope-work.ts — git ls-files | head | grep
sequence-tasks.ts — git ls-files | head
Options
Fix each caller to use array args + JS logic (like PR fix: shell syntax bugs in what-changed, checkpoint, session-health #109 )
Add a shell() helper that uses execSync for commands that genuinely need shell features
Both — array args where simple, shell() for complex piping
Option 3 is probably best. Some commands (find | grep | head) are genuinely easier with shell.
Problem
run()insrc/lib/git.tsusesexecFileSync(no shell), but many tool files still pass shell syntax that silently breaks:||,&&,|2>/dev/null,2>&1gitin strings (becomes a literal arg sinceexecFileSync('git', ['git', ...]))Affected files
PR #109 fixes 3 files. These still need fixing:
verify-completion.ts—cat,tsc --noEmit 2>&1 | tail,npm run build 2>&1 | tailtoken-audit.ts—wc -l,wc -c,tail -c,2>/dev/nullclarify-intent.ts—tsc --noEmit 2>&1 | grep,find ... | headsession-handoff.ts—command -v,gh pr list ... || echoaudit-workspace.ts—find ... | wc -l,2>/dev/nullenrich-agent-task.ts—git ls-files | grep,head -30scope-work.ts—git ls-files | head | grepsequence-tasks.ts—git ls-files | headOptions
shell()helper that usesexecSyncfor commands that genuinely need shell featuresshell()for complex pipingOption 3 is probably best. Some commands (
find | grep | head) are genuinely easier with shell.