fix: use $HOME instead of ~ for gsd-tools.cjs paths to prevent subagent MODULE_NOT_FOUND (#786)

Claude Code subagents sometimes rewrite ~/. paths to relative paths,
causing MODULE_NOT_FOUND when CWD is the project directory. $HOME is a
shell variable resolved at runtime, immune to model path rewriting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-02-27 13:11:19 -06:00
parent aaea14efd6
commit 69b28eeca4
44 changed files with 166 additions and 166 deletions

View File

@@ -37,7 +37,7 @@ This ensures project-specific patterns, conventions, and best practices are appl
Load execution context:
```bash
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init execute-phase "${PHASE}")
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init execute-phase "${PHASE}")
```
Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `plans`, `incomplete_plans`.
@@ -200,7 +200,7 @@ Do NOT continue reading. Analysis without action is a stuck signal.
Check if auto mode is active at executor start:
```bash
AUTO_CFG=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs config-get workflow.auto_advance 2>/dev/null || echo "false")
AUTO_CFG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
```
Store the result for checkpoint handling below.
@@ -389,34 +389,34 @@ After SUMMARY.md, update STATE.md using gsd-tools:
```bash
# Advance plan counter (handles edge cases automatically)
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state advance-plan
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state advance-plan
# Recalculate progress bar from disk state
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state update-progress
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state update-progress
# Record execution metrics
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state record-metric \
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state record-metric \
--phase "${PHASE}" --plan "${PLAN}" --duration "${DURATION}" \
--tasks "${TASK_COUNT}" --files "${FILE_COUNT}"
# Add decisions (extract from SUMMARY.md key-decisions)
for decision in "${DECISIONS[@]}"; do
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state add-decision \
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state add-decision \
--phase "${PHASE}" --summary "${decision}"
done
# Update session info
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state record-session \
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state record-session \
--stopped-at "Completed ${PHASE}-${PLAN}-PLAN.md"
```
```bash
# Update ROADMAP.md progress for this phase (plan counts, status)
node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap update-plan-progress "${PHASE_NUMBER}"
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap update-plan-progress "${PHASE_NUMBER}"
# Mark completed requirements from PLAN.md frontmatter
# Extract the `requirements` array from the plan's frontmatter, then mark each complete
node ~/.claude/get-shit-done/bin/gsd-tools.cjs requirements mark-complete ${REQ_IDS}
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" requirements mark-complete ${REQ_IDS}
```
**Requirement IDs:** Extract from the PLAN.md frontmatter `requirements:` field (e.g., `requirements: [AUTH-01, AUTH-02]`). Pass all IDs to `requirements mark-complete`. If the plan has no requirements field, skip this step.
@@ -434,13 +434,13 @@ node ~/.claude/get-shit-done/bin/gsd-tools.cjs requirements mark-complete ${REQ_
**For blockers found during execution:**
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state add-blocker "Blocker description"
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state add-blocker "Blocker description"
```
</state_updates>
<final_commit>
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md .planning/REQUIREMENTS.md
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md .planning/REQUIREMENTS.md
```
Separate from per-task commits — captures execution results only.