Skip to content

fix: use $HOME instead of ~ for browse/design binary paths - #843

Closed
mvanhorn wants to merge 1 commit into
garrytan:mainfrom
mvanhorn:fix/785-use-home-instead-of-tilde
Closed

mvanhorn wants to merge 1 commit into
garrytan:mainfrom
mvanhorn:fix/785-use-home-instead-of-tilde

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes browseDir and designDir in buildHostPaths() (scripts/resolvers/types.ts:40-41) to use $HOME instead of ~. Regenerates all 16 affected SKILL.md files.

Problem

Claude Code's bash safety heuristic fires a permission prompt on every browse/design command:

Tilde in assignment value — bash may expand at assignment time

This triggers on the generated pattern B=~/.claude/skills/gstack/browse/dist/browse in every SKILL.md that uses the browser. Frequent interruptions during /browse, /qa, /design-review, and 14 other skills.

Changes

One source change in scripts/resolvers/types.ts:

-        browseDir: `${root}/browse/dist`,
-        designDir: `${root}/design/dist`,
+        browseDir: `$HOME/${config.globalRoot}/browse/dist`,
+        designDir: `$HOME/${config.globalRoot}/design/dist`,

skillRoot and binDir stay with ~ because they appear in command substitution and prose contexts that don't trigger the heuristic.

Testing

337/338 gen-skill-docs tests pass. The 1 failure is a pre-existing VERSION/package.json mismatch (#399), unrelated to this change. Verified:

  • Zero B=~/ or D=~/ patterns remain in generated SKILL.md files
  • skillRoot paths still use ~ (test expectations at gen-skill-docs.test.ts:1742/1750 preserved)
  • Only Claude host affected (other hosts use usesEnvVars: true, unaffected by this path)

Fixes #785

This contribution was developed with AI assistance (Codex).

Claude Code's bash safety heuristic fires a permission prompt on every
browse/design command because tilde in variable assignments triggers
"Tilde in assignment value" warnings.

Change browseDir and designDir in buildHostPaths() to use $HOME instead
of ~. Keep skillRoot and binDir with tilde since they appear in command
substitution and prose contexts that don't trigger the heuristic.

Fixes garrytan#785
@time-attack

Copy link
Copy Markdown
Contributor

@16francej Please close this PR. Home-directory path handling already shipped correctly through #993/current main. This branch edits stale generated skill files that would be overwritten during regeneration.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Closing — home-directory path handling already shipped. Thanks @time-attack!

@mvanhorn mvanhorn closed this Jul 15, 2026
0xDevNinja added a commit to 0xDevNinja/gstack that referenced this pull request Jul 16, 2026
- The artifacts-sync preamble assigned `_BRAIN_SYNC_BIN="~/.claude/..."`
  and the telemetry block `-x`-tested the same path; tilde inside double
  quotes is literal, so 42+ SKILL.md files silently no-op'd brain-sync
- `2>/dev/null || true` swallowed the ENOENT, so users never saw failure
  while cross-machine artifact handoff quietly never pushed
- Normalize `ctx.paths.binDir` to `$HOME/...` form for env-var-host (Codex
  etc.) paths, untouched
- Add static invariants `="~/` and `[ -x "~/` so the pattern can't
  regress under future resolver edits

Fixes garrytan#1656. Same shape as garrytan#785 / garrytan#843, different surface (binDir,
not browseDir/designDir).
@marcusLewi

marcusLewi commented Jul 17, 2026 via email

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use $HOME instead of ~ in SKILL.md browse binary assignment

3 participants