# Uninstall ## Option 1: Run the uninstall script If gstack is installed on your machine: ```bash ~/.claude/skills/gstack/bin/gstack-uninstall ``` This handles skills, symlinks, harness registrations (the files `gstack-harness` wrote into OpenClaw, Hermes, a Dot or another harness, from their ledgers, plus the opt-in [start hook](hosts.md#start-hook), which it turns off through the harness's own CLI), global state (`~/.gstack/`), project-local state, browse daemons, and temp files. Use `--keep-state` to preserve config and analytics; it also keeps the repo's `.gstack/` and `.gstack-worktrees/`. Use `--force` to skip confirmation. A plain uninstall keeps the git-tracked files under `.gstack/` (such as ship policy) and removes only the ones git ignores. It stops with exit 2, before removing anything, when a checkout under `.gstack-worktrees/` has uncommitted changes, has commits no branch or tag holds, or is not a worktree this repo registered. Pass `--force-worktrees` to delete those checkouts anyway. Every checkout is checked, including a worktree created inside another checkout under `.gstack-worktrees/`. A git submodule inside a clean checkout is deleted with it only when every commit it holds is on a remote-tracking branch; otherwise it stops the uninstall. A locked worktree (`git worktree lock`) always stops the uninstall, even with `--force-worktrees`; unlock it with `git worktree unlock ` if you want it gone. If `git worktree list` fails, the uninstall stops too, even with `--force-worktrees`. The check runs again after you confirm, before anything is removed, so a checkout you edit while the confirmation prompt waits is kept: uninstall exits 2 and removes nothing. Run from inside the gstack install itself, a `.gstack/` that holds its own git repository also stops the uninstall, because deleting the install would take it along. A `.gstack/` that is its own git repository is kept, with a message saying so, because its commits may exist nowhere else. When `.gstack-worktrees` is a symlink, uninstall removes only the link and never follows it, so the folder it points at and the worktrees there are kept. ## Option 2: Manual removal (no local repo) If you don't have the repo cloned (e.g. you installed via a Claude Code paste and later deleted the clone): ```bash # 1. Stop browse daemons pkill -f "gstack.*browse" 2>/dev/null || true # 2. Remove per-skill directories whose SKILL.md points into gstack/ # (rm -rf, not rmdir — installed dirs also contain runtime-asset links) find ~/.claude/skills -mindepth 1 -maxdepth 1 -type d ! -name gstack 2>/dev/null | while IFS= read -r dir; do link="$dir/SKILL.md" [ -L "$link" ] || continue target=$(readlink "$link" 2>/dev/null) || continue case "$target" in gstack/*|*/gstack/*) rm -rf "$dir" ;; esac done # Directories gstack created carry a .gstack-owned marker (the only signal on # Windows, where installs are file copies with no symlink to read) for marker in ~/.claude/skills/*/.gstack-owned; do [ -f "$marker" ] && rm -rf "$(dirname "$marker")" done # Alias skills install as copies (no symlink to detect) — remove by name rm -rf ~/.claude/skills/_gstack-command ~/.claude/skills/connect-chrome 2>/dev/null # 3. Remove gstack rm -rf ~/.claude/skills/gstack # 4. Remove global state rm -rf ~/.gstack # 5. Remove integrations (skip any you never installed) rm -rf "${CODEX_HOME:-$HOME/.codex}/skills/gstack"* 2>/dev/null rm -rf ~/.factory/skills/gstack* 2>/dev/null rm -rf ~/.kiro/skills/gstack* 2>/dev/null rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/gstack"* "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/.gstack-skills" 2>/dev/null rm -rf "${HERMES_HOME:-$HOME/.hermes}/skills/gstack" 2>/dev/null rm -rf ~/.cursor/skills/gstack* 2>/dev/null rm -rf ~/.config/opencode/skills/gstack* 2>/dev/null rm -rf ~/.gemini/antigravity-cli/skills/gstack* 2>/dev/null rm -rf ~/.gemini/skills/gstack* 2>/dev/null # 6. Remove temp files rm -f /tmp/gstack-* 2>/dev/null # 7. Per-project cleanup (run from each project root) rm -rf .claude/skills/gstack .agents/skills/gstack* .factory/skills/gstack* 2>/dev/null # Browse state: removes only the files git ignores, so tracked files such as # ship policy, and a .gstack/ that is its own git repo, stay. git clean -fdXq -- .gstack 2>/dev/null # Worktrees, deepest first: each goes only when it has no uncommitted changes, # no commits a branch or tag lacks, and no checkout inside it. git refuses a # locked one. Anything printed as kept still holds work: save it, then re-run. root=$(git rev-parse --show-toplevel) git worktree list --porcelain | sed -n 's/^worktree //p' | sort -r | while IFS= read -r wt; do case "$wt" in "$root/.gstack-worktrees/"*) ;; *) continue ;; esac if [ -z "$(git -C "$wt" status --porcelain --untracked-files=all)" ] && [ -z "$(git -C "$wt" log --oneline -1 HEAD --not --branches --tags)" ] && [ -z "$(find "$wt" -mindepth 2 -name .git -print -quit)" ]; then git worktree remove "$wt" || echo "kept $wt" else echo "kept $wt: it holds work or another checkout" fi done find .gstack-worktrees -depth -type d -empty -delete 2>/dev/null || true ``` Never `rm -rf .gstack-worktrees` by hand: a checkout there can hold uncommitted work, commits no branch has, or another worktree nested inside it, and `rm -rf` deletes all of it. Anything the loop above keeps, check and remove yourself. Manual removal leaves gstack's hook entries behind in `~/.claude/settings.json` (the uninstall script removes all of them for you, including entries whose `_gstack_source` tag was stripped). Edit that file and delete every hook whose command path points into `.claude/skills/gstack/`: the SessionStart auto-update hook, the AskUserQuestion PreToolUse/PostToolUse hooks, and the Stop hooks (session timeline, plus verify-gate if you opted in). Left in place, they error on every matching event once the install directory is gone. If you turned on the OpenClaw or Hermes [start hook](hosts.md#start-hook), manual removal also leaves its `gstack-start` plugin turned on. Turn it off with `openclaw config unset plugins.entries.gstack-start` or `hermes plugins disable gstack-start`, then delete `${OPENCLAW_STATE_DIR:-~/.openclaw}/extensions/gstack-start` or `${HERMES_HOME:-~/.hermes}/plugins/gstack-start`. ## Clean up CLAUDE.md The uninstall script does not edit CLAUDE.md. In each project where gstack was added, remove the `## gstack` and `## Skill routing` sections. ## Playwright `~/Library/Caches/ms-playwright/` (macOS) is left in place because other tools may share it. Remove it if nothing else needs it. ## Aside gstack never installed Aside, so it never uninstalls it. Keep it or remove it like any other app.