fix(commands): replace legacy inline shell interpolation with $PWD for Claude Code v2.1.113+#370
Conversation
…r Claude Code v2.1.113+ - Fixes permission check failure on Claude Code native binary runtime - Updates source templates and golden snapshots accordingly - Closes Gentleman-Programming#365
|
Hi team! 🔹 This PR is ready for review. Could a maintainer please:
Once approved, the CI checks will run automatically. All tests pass locally and golden snapshots are aligned. Thanks! 🙌 |
|
Hey @baltasarblanco — thanks for picking this up, the diagnosis and the One thing to flag before merge: the same broken
If those don't ship in this PR, Would it be easy to extend this PR to cover them too (plus their matching golden files under |
|
Thanks for catching that! Good point — it makes sense to ship the fix atomically for all Claude Code commands. I'll extend this PR to include those 4 additional files ( Updating now... 🛠️ |
- Replaces legacy backtick interpolation with native \$PWD environment variable - Covers original 5 commands + sdd-onboard, sdd-verify, sdd-archive, sdd-apply - Updates all matching golden snapshots - Full asset audit confirms zero legacy patterns remain - Closes Gentleman-Programming#365
|
Hi @GerardoFC8, thanks for the catch! 🙌 I've extended this PR to include those 4 additional files ( Extra Mile: This PR now provides a complete fix for the |
- Covers sdd-onboard, sdd-verify, sdd-archive, and sdd-apply - Updates matching golden snapshots - Full audit confirms zero legacy patterns remain - Closes Gentleman-Programming#365
🔗 Linked IssueCloses #365 🏷️ PR TypeWhat kind of change does this PR introduce?
📝 SummaryAfter Claude Code This PR replaces the problematic backtick interpolation with the native 📂 Changes
🧪 Test PlanUnit Tests go test ./internal/components/sdd/...
✅ Contributor Checklist
💬 Notes for ReviewersThis is a purely cosmetic/template fix. The change swaps deprecated shell backtick execution for native environment variable resolution ( Ready for review! 🔹 |
🔗 Linked Issue
Closes #365
🏷️ PR Type
What kind of change does this PR introduce?
type:bug— Bug fix (non-breaking change that fixes an issue)type:feature— New feature (non-breaking change that adds functionality)type:docs— Documentation onlytype:refactor— Code refactoring (no functional changes)type:chore— Build, CI, or tooling changestype:breaking-change— Breaking change (fix or feature that changes existing behavior)📝 Summary
After Claude Code
v2.1.113+migrated its runtime to a native binary, the command parser introduced stricter permission checks during initialization. This update rejects legacy inline shell interpolation syntax (!`echo -n "$(pwd)"`and!`echo -n "$(basename $(pwd))"`), causing all 5 SDD slash commands (/sdd-new,/sdd-init,/sdd-ff,/sdd-explore,/sdd-continue) to fail immediately with:Error: Shell command permission check failed for pattern "!...": Unhandled node type: stringThis PR replaces the problematic backtick interpolation with the native
$PWDenvironment variable across all affected command templates. The fix was validated by the issue reporter and aligns with Claude Code's current variable resolution behavior. No Go logic, injection flows, or adapter interfaces were modified — only static command assets and their corresponding golden snapshots were updated.📂 Changes
internal/assets/claude/commands/sdd-{new,init,ff,explore,continue}.md!`echo...`interpolation with$PWDin theCONTEXT:blocktestdata/golden/sdd-claude-cmd-sdd-{new,init,ff,explore,continue}.golden🧪 Test Plan
Unit Tests
go test ./internal/components/sdd/...E2E Tests (Docker required)
go test ./...)cd e2e && ./docker-test.sh)🤖 Automated Checks
The following checks run automatically on this PR:
Closes/Fixes/Resolves #Nstatus:approvedtype:*Labeltype:*label must be appliedgo test ./...must passcd e2e && ./docker-test.shmust pass✅ Contributor Checklist
status:approvedtype:*label to this PRgo test ./...)cd e2e && ./docker-test.sh)Co-Authored-Bytrailers💬 Notes for Reviewers
This is a purely cosmetic/template fix. The change swaps deprecated shell backtick execution for native environment variable resolution (
$PWD), which is fully supported by Claude Code's current runtime. The fix is backward-compatible, requires zero changes to Go code or injection logic, and restores immediate functionality for SDD slash commands onv2.1.113+. Golden snapshots were updated accordingly. Ready for review!