Skip to content

fix(opencode): detect runtime config directory instead of hardcoding .claude#825

Open
Tibsfox wants to merge 1 commit intogsd-build:mainfrom
Tibsfox:fix/opencode-hardcoded-paths
Open

fix(opencode): detect runtime config directory instead of hardcoding .claude#825
Tibsfox wants to merge 1 commit intogsd-build:mainfrom
Tibsfox:fix/opencode-hardcoded-paths

Conversation

@Tibsfox
Copy link
Contributor

@Tibsfox Tibsfox commented Feb 28, 2026

Summary

Three files had hardcoded .claude paths that break OpenCode and Gemini installations where the config directory is .config/opencode, .opencode, or .gemini. While the installer templates most paths correctly at install time, these files either run at runtime (hooks) or contain bash pseudo-code that the model interprets directly (workflow/command markdown).

This is a follow-up to the partial fix in v1.20.4 which addressed gsd-statusline.js and parts of gsd-check-update.js, but left 3 files with hardcoded paths as noted by the original reporter.

Changes

1. hooks/gsd-check-update.js — Runtime detection

Added detectConfigDir() helper that probes for get-shit-done/VERSION across all runtime directories (.config/opencode, .opencode, .gemini, .claude), falling back to .claude. Used for:

  • Global cache directory (was hardcoded to ~/.claude/cache)
  • Project-local VERSION file (was hardcoded to ./.claude/get-shit-done/VERSION)
  • Global VERSION file (was hardcoded to ~/.claude/get-shit-done/VERSION)

2. commands/gsd/reapply-patches.md — Multi-runtime patch directories

Replaced hardcoded ~/.claude/gsd-local-patches and ./.claude/gsd-local-patches with runtime detection loops that check all config directories for both global and local installs.

3. workflows/update.md — Install detection and cache cleanup

  • Version file detection now loops through all runtime directories instead of hardcoding .claude
  • Cache cleanup clears gsd-update-check.json across all runtime directories instead of just .claude

Verification

  1. Install GSD for OpenCode: npx get-shit-done-cc --opencode --global
  2. Trigger update check — gsd-check-update.js should find VERSION in .config/opencode/ or .opencode/
  3. Run /gsd:update — should detect install type correctly regardless of runtime
  4. Run /gsd:reapply-patches — should find patches in the correct runtime directory

Closes #682

🤖 Generated with Claude Code

….claude

Three files had hardcoded `.claude` paths that break OpenCode and
Gemini installations where the config directory is `.config/opencode`,
`.opencode`, or `.gemini` respectively.

Changes:
- hooks/gsd-check-update.js: add detectConfigDir() helper that checks
  all runtime directories for get-shit-done/VERSION, falling back to
  .claude. Used for cache dir, project VERSION, and global VERSION.
- commands/gsd/reapply-patches.md: detect runtime directory for both
  global and local patch directories instead of hardcoding ~/.claude/
  and ./.claude/
- workflows/update.md: detect runtime directory for local and global
  VERSION/marker files, and clear cache across all runtime directories

Closes gsd-build#682

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

Bug: OpenCode hooks have hardcoded .claude paths

1 participant