T-TDES-investigate-bash-multiline-arg-glue
Status: closed/no-repro · Impact: low · Complexity: small
Auto-generated from a /sdlc:task-work post-mortem. Review and
promote to open/ready before picking up.
During T-G834-move-plugin-runtime-state-to-sdlc-dir the
implementer observed 2-3 instances where a multi-line Bash
tool invocation, with quoted arguments on the first line, had a
subsequent line’s git subcommand argv glued into the previous
command. Example: git -C <path> add ... was interpreted as
git add -C .... The failure was intermittent, never
deterministically reproduced, and always cleared by re-running
each command in its own single-line Bash call. This task
captures the symptom in a reproducible fixture (or documents that
it isn’t reproducible in isolation) and either fixes the parsing
edge or codifies the work-around in the relevant SKILL.md
prose.
Verbatim post-mortem evidence:
Recurring shell-parsing oddity in this session: multi-line Bash invocations where the first command had quoted arguments occasionally got the next line’s
gitsubcommand glued into the previous command’s argv (e.g.git -C <path> add ...interpreted asgit add -C ...). Could not consistently reproduce, but it occurred 2-3 times and was always resolved by re-running each command in its own single-line Bash call. Worth investigating whether this is afish-vs-bashshell-init quirk, a Bash tool parsing edge case, or some interaction with backslash line continuations.
The user’s environment is fish shell as login shell with Claude
Code’s Bash tool dispatching to bash. The plugin’s
Bash tool invocations regularly include multi-line commands
with quoted heredocs and && chains.
Proposed
Section titled “Proposed”A reproducer (test script or Bash invocation pattern) that
deterministically triggers the argv-glue, OR a documented
verdict that the issue could not be reproduced and an entry in
apps/sdlc/conventions/ codifying “prefer single-line Bash
invocations for sequential commands until reproducer lands.”
If a reproducer is found, the root cause likely sits in either:
- Claude Code Bash tool’s shell-init or argv-splitting layer.
- An interaction between
fishuser shell and the Bash tool’s sub-shell invocation. - A particular pattern of backslash-line-continuation or trailing whitespace.
Approach
Section titled “Approach”- Survey the originating session’s transcript for the exact
Bashinvocations that triggered the glue (if recoverable). Note the surrounding pattern: heredocs, backslash continuations, trailing-whitespace, quote nesting. - Construct candidate reproducer scripts and run each ~50 times under the Bash tool to look for non-determinism. If any reliably reproduces, escalate.
- If no reproducer emerges within a small effort budget
(~2 hours), close with a “non-reproducible” verdict and add a
one-line note to
apps/sdlc/conventions/recommending single-line Bash invocations for sequentialgitcommands. - If a reproducer emerges and the root cause is in the Claude Code harness (not the plugin), file an upstream issue and link from this task; the plugin-side fix is a docs/convention note.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
apps/sdlc/conventions/ | modify | convention note (new file or appended to an existing one) |
apps/sdlc/scripts/ | create | optional reproducer fixture, only if one lands |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: Either a deterministic reproducer exists (committed as a fixture) OR the task closes with a written “non-reproducible in isolation” verdict.
- AC-2: If non-reproducible,
apps/sdlc/conventions/carries a one-line note recommending single-line Bash invocations for sequentialgitcommands as a defensive workaround.
Out of scope
Section titled “Out of scope”- Refactoring any existing plugin SKILL.md to use single-line Bash invocations everywhere — the current multi-line patterns work the vast majority of the time, and the friction was small enough that wholesale refactoring isn’t justified pre-cause.
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”Spawned by /sdlc:task-work post-mortem of T-G834-move-plugin-runtime-state-to-sdlc-dir on 2026-05-22.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: Recurring shell-parsing oddity in this session: multi-line Bash invocations where the first
command had quoted arguments occasionally got the next line’s git subcommand glued into the previous
command argv (e.g. ‘git -C
- 6 / open/ready / 2026-05-21-task-define-flags-spec-shell-drift — task-define flags task-spec shell invocations that drift from cited SKILL.md
- 3 / closed/done / 2026-05-20-pr-check-mock-state-flag — Add —mock-state flag to /sdlc:pr-check for harness coverage
- 3 / planning/backlog / 2026-05-21-check-skill-docs-require-mmdc-flag — Add —require-mmdc to check_skill_docs.py so CI hosts cannot silently skip
- 3 / closed/done / 2026-05-21-skill-md-runtime-drift-audit — Audit /sdlc:task-work SKILL.md against per-project runtime conventions
- 2 / closed/done / 2026-05-20-investigate-sandbox-multiline-commit-denial — Document Claude Code sandbox fallback for the heredoc commit-message pattern Decision: LINKED-EXISTING 2026-05-21-task-define-flags-spec-shell-drift
Rationale: Override to SPAWNED. The dedup script’s top candidate
(task-define-flags-spec-shell-drift, score 6) is about flagging shell-invocation drift between
task spec citations and the live SKILL.md prose — a completely different concern from the Bash
tool’s argv-parsing edge case observed here. Score is also below the typical confidence threshold;
the LINKED-EXISTING decision is a false positive from incidental keyword overlap on the word
“shell”.