fix: run() misuse across 9 remaining tools - #229
Open
TerminalGravity wants to merge 2 commits into
Open
Conversation
…tools Fixes the remaining tools listed in #215 where run() was being called with shell syntax (pipes, redirects, non-git commands). run() uses execFileSync('git', args) — no shell, always prepends 'git'. Changes: - Add shell() helper to src/lib/git.ts (execSync with shell support) - verify-completion: use shell() for tsc/build, readFileSync for package.json, array args for git diff - clarify-intent: use shell() for tsc and find commands - session-handoff: use shell() for command -v and gh pr list - audit-workspace: use run() with array args for git diff, shell() for find - sharpen-followup: use run() with array args for git diff/status - enrich-agent-task: use shell() for piped git ls-files, readFileSync for head - sequence-tasks: use shell() for piped git ls-files - checkpoint: use run() with array args for git add/reset, shell() for compound command - scope-work: use run() with array args for git status/diff, shell() for piped ls-files Closes #215
TerminalGravity
commented
Mar 12, 2026
TerminalGravity
left a comment
Collaborator
Author
There was a problem hiding this comment.
Reviewed — this is the cleanest version of the #215 fix. The shell() helper is well-scoped and the readFileSync replacements are more portable.
Minor notes:
- Double-check
shellEscapehandles single quotes in area names - Silent error swallowing in
shell()→""is fine for now, but might want an opt-in throw path later
This supersedes #220 and #225 — recommend merging this and closing those two.
Shows real input/output examples for preflight_check, prompt_score, scope_work, estimate_cost, log_correction, and search_history. Includes workflow tip for automatic preflight via CLAUDE.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes all remaining tools from #215 where
run()was misused with shell syntax.The bug:
run()usesexecFileSync('git', args)— no shell, always prependsgit. Calls likerun('cat package.json')becomegit cat package.json,run('find tests ...')becomesgit find tests ..., and pipes/redirects silently fail.The fix:
shell()helper tosrc/lib/git.ts(usesexecSyncwith shell support) for commands that genuinely need pipes/redirects/non-git binariesrun()with proper array args (nogitprefix, no redirects)run('cat ...')/run('head ...')with NodefsAPIsFiles fixed: audit-workspace, checkpoint, clarify-intent, enrich-agent-task, scope-work, sequence-tasks, session-handoff, sharpen-followup, verify-completion
Builds clean (
tsc --noEmitpasses).Closes #215