Repository navigation
gstack: artifacts auto-sync silently broken due to unexpanded ~ in double-quoted bash variable assignments #1715
Description
Bug: Bash tilde expansion fails inside double-quoted variable assignments in gstack skill preamble, preventing artifacts auto-sync on all skill invocations
Description
On Windows (Git Bash), the gstack skill preamble's artifacts sync logic silently never runs. The ~ in double-quoted variable assignments is not resolved to the home directory path.
This means gstack-brain-sync --once is never called at skill boundaries, so cross-machine artifact synchronization (checkpoints, learnings, timeline, etc.) does not happen automatically.
Root Cause
In Bash, tilde expansion only occurs when ~ is at the beginning of an unquoted word. Inside double-quoted variable assignments, ~ is treated as a literal character.
Lines 369-370 in every SKILL.md preamble:
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"When $_BRAIN_CONFIG_BIN is later invoked:
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get artifacts_sync_mode 2>/dev/null || echo off)The shell tries to execute the literal path ~/.claude/... (which doesn't exist as a literal file path), the command fails, and artifacts_sync_mode falls back to off. This causes all subsequent sync conditions to evaluate to false.
The same issue affects the end-of-skill sync commands in the Telemetry section:
"~/.claude/skills/gstack/bin/gstack-brain-sync" --once 2>/dev/null || trueImpact
- Every gstack skill invocation (
/context-save,/qa,/ship,/plan-*,/review, etc.) silently skips the artifacts sync - Cross-machine artifact sharing via the gstack artifacts git repo (
gstack-record) never works automatically - No user-visible error — all
|| true/2>/dev/nullpatterns swallow the failure silently - This has been broken since the artifacts sync feature was introduced
Affected Files
All 92 SKILL.md files across two directories:
~/.claude/skills/*/SKILL.md(46 files — loaded by Claude Code at runtime)~/.claude/skills/gstack/*/SKILL.md(46 files — gstack distribution copies)
Affected skills include: autoplan, benchmark, benchmark-models, browse, canary, codex, context-restore, context-save, cso, design-consultation, design-html, design-review, design-shotgun, devex-review, document-generate, document-release, health, investigate, ios-clean, ios-design-review, ios-fix, ios-qa, ios-sync, land-and-deploy, landing-report, learn, make-pdf, office-hours, open-gstack-browser, pair-agent, plan-ceo-review, plan-design-review, plan-devex-review, plan-eng-review, plan-tune, qa, qa-only, retro, review, scrape, setup-browser-cookies, setup-deploy, setup-gbrain, ship, skillify, sync-gbrain
Fix
Change "~/.claude/..." to "$HOME/.claude/..." in two places in the preamble template and the end-of-skill telemetry section.
In the Artifacts Sync preamble section:
- _BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
- _BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
+ _BRAIN_SYNC_BIN="$HOME/.claude/skills/gstack/bin/gstack-brain-sync"
+ _BRAIN_CONFIG_BIN="$HOME/.claude/skills/gstack/bin/gstack-config"In the end-of-skill Telemetry section:
- "~/.claude/skills/gstack/bin/gstack-brain-sync" --once 2>/dev/null || true
+ "$HOME/.claude/skills/gstack/bin/gstack-brain-sync" --once 2>/dev/null || trueVerification
After fixing, the preamble correctly shows ARTIFACTS_SYNC: mode=full | ... instead of ARTIFACTS_SYNC: off. Git status on ~/.gstack/ confirms that gstack-brain-sync --once modified learnings.jsonl, timeline.jsonl, and .brain-queue.jsonl.
Environment
- OS: Windows 11 (Git Bash)
- Shell: Bash (via Git for Windows)
Activity
time-attack commentedon Jul 15, 2026
@16francej — recommend closing this issue because #1656 is the earlier report of the same generated-artifact synchronization defect. #1692 owns the generator repair, so discussion should continue there. Please retain the original attribution and generated-file count under #1656.
v1.64.0.0 fix wave: full tracker audit — 90 fixes, 52 issues closed, …
capy-ai commentedon Oct 3, 2026
The skill preamble no longer assigns quoted
"~/.claude/..."brain-sync paths; artifacts sync runs insidebin/gstack-skill-start, and no generated skill preamble carries the quoted-tilde brain-sync lines.Fixed in v1.64.0.0 (#2571).
If you still see this on the latest gstack, please reopen with details.