mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-23 00:21:14 +01:00
Helper hooks are on by default, the destructive-command check runs as a hook, and prompt routing fires on long bug reports (GST-3110) (#4503)
Claude Code now gets gstack's prompt-routing, skill-contract and destructive-command hooks on by default, and new OpenClaw and Hermes registrations get the start hook. On 60 real bug reports, routing now matches a bug-fix skill on 40 (was 22), but gstack's own skills route 14 (was 17). Why: on Opus 5.5, unattended, a hook line naming a skill got it loaded in 58 of 60 sessions, and a skill relying on its description in 0 of 60 (gstack-evals#369). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1v/outside-voice#1 reader=outside-voice Review-Finding: p1v/adversarial-native#4 reader=adversarial-native Review-Finding: p2/red-team#1 reader=red-team
This commit is contained in:
1 parent
43026970b7
commit
3f1b82b22a
28 files changed
+543
-95
No files matched your search
+2
-2
@@ -194,8 +194,8 @@ registered as a short entry that tells the agent to read the skill's full
|
||||
reads in pages (`.gstack-skills/` under `--skills all`).
|
||||
Install, verify and remove: [hosts.md](hosts.md#agent-harnesses).
|
||||
Agents in OpenClaw read gstack's skills but rarely run their start command, so
|
||||
there is an opt-in [start hook](hosts.md#start-hook): `gstack-harness register
|
||||
openclaw --start-hook` adds a `gstack-start` plugin that puts a one-line note on
|
||||
there is a [start hook](hosts.md#start-hook), on by default for a new registration (`gstack-harness register
|
||||
openclaw --no-start-hook` turns it off; an upgrade keeps an existing off): it adds a `gstack-start` plugin that puts a one-line note on
|
||||
every user turn, and grants it the conversation access OpenClaw requires for
|
||||
`before_prompt_build` through `openclaw config set`.
|
||||
|
||||
|
||||
+5
-5
@@ -24,7 +24,7 @@ neither does `./setup --local`.
|
||||
|
||||
**What it writes.** Copies in the harness's own skills folder, never edits to
|
||||
`openclaw.json`, Hermes's `config.yaml` or any context file you did not name.
|
||||
The one exception is the [start hook](#start-hook), which you turn on yourself:
|
||||
The one exception is the [start hook](#start-hook), which is on by default for a new registration:
|
||||
it adds a plugin and enables it through the harness's own commands.
|
||||
A context block is opt-in: `gstack-harness register openclaw|hermes|generic
|
||||
--context <file>` writes the marked block into that file only, after printing
|
||||
@@ -70,11 +70,11 @@ characters, the part of a description Hermes's skills index shows.
|
||||
| any other harness | the router in an Agent Skills folder you name, and/or a 600-byte routing block between `<!-- gstack:begin harness-routing -->` markers in a context file you name | `gstack-harness register generic --skills-dir <dir>` and/or `--context <file>`; `gstack-harness manifest generic` prints every skill as JSON | the harness's own skill list | `gstack-harness unregister generic` |
|
||||
|
||||
<a id="start-hook"></a>
|
||||
### Start hook (OpenClaw and Hermes, opt-in)
|
||||
### Start hook (OpenClaw and Hermes, on by default for new registrations)
|
||||
|
||||
Every gstack skill starts with a command in its Preamble (`gstack-skill-start`) that sets up the session: whether it runs unattended, questions, consent, upgrade checks. In OpenClaw and Hermes, agents read gstack's skills but almost never run that command (1 start in 29 chances, HARN-18). The start hook is a small `gstack-start` plugin that puts one note of about 210 characters on every user turn, telling the agent to run that command first, exactly as written, with no pipe.
|
||||
|
||||
It is off unless you turn it on, because turning it on changes the harness's own settings:
|
||||
It is on by default (gstack-evals#369: a line on the prompt naming a skill got Opus 5.5 to load it in 58 of 60 sessions, where a skill relying on its description loaded in 0 of 60). Turning it on changes the harness's own settings:
|
||||
|
||||
| | OpenClaw | Hermes |
|
||||
|---|---|---|
|
||||
@@ -83,13 +83,13 @@ It is off unless you turn it on, because turning it on changes the harness's own
|
||||
| Settings it changes, through the harness's own CLI | `openclaw config set plugins.entries.gstack-start.hooks.allowConversationAccess true` and `...enabled true` in `openclaw.json`. OpenClaw runs `before_prompt_build` from a plugin it did not bundle only with that grant, which also lets the plugin's hooks see conversation content (the plugin reads only its own note.txt) | `hermes plugins enable gstack-start` adds it to `plugins.enabled` in `config.yaml` |
|
||||
| Check | `openclaw plugins inspect gstack-start --runtime --json` lists `before_prompt_build` under `typedHooks` | `hermes plugins list` shows `gstack-start` enabled |
|
||||
|
||||
**Turn it on.** `gstack-harness register openclaw --start-hook` (or `hermes`), or `gstack-config set harness_start_hook on` followed by `./setup`, or `GSTACK_HARNESS_START_HOOK=1 ./setup --host openclaw`. The first of these that is set decides: the `--start-hook`/`--no-start-hook` flag, then `GSTACK_HARNESS_START_HOOK` (`1`/`on` or `0`/`off`), then `harness_start_hook`, then the choice saved in the registration's ledger. Whatever decides, the choice is saved, so refresh and upgrades keep it. The hook goes only into the harness profile's own plugin folder; a registration with a custom `--skills-dir`, or OpenClaw run with `OPENCLAW_CONFIG_PATH` pointing at another config, gets no hook (`HARNESS_HOOK_UNSUPPORTED` with `--start-hook`; with `GSTACK_HARNESS_START_HOOK` or `harness_start_hook`, `register` and `./setup --host` say why and exit 4). `OPENCLAW_CONFIG_PATH` naming the profile's own `openclaw.json`, by any path that resolves to it, is fine. A hook you already turned on stays on when a later run happens to have `OPENCLAW_CONFIG_PATH` set.
|
||||
**On by default, and how to choose.** A new registration with no choice gets the hook. The first of these that is set decides: the `--start-hook`/`--no-start-hook` flag, then `GSTACK_HARNESS_START_HOOK` (`1`/`on` or `0`/`off`), then `harness_start_hook` in gstack-config, then the choice saved in the registration's ledger, then the default. Every off a registration saved is kept, including one saved before the default changed: an upgrade never turns an existing start hook on. The first `./setup` or `/gstack-upgrade` after the change prints, once, `off, as before: gstack now turns it on only for new registrations; turn it on: gstack-harness register <harness> --start-hook`. The only off the default overrides is one gstack recorded because it had to refuse the hook (a custom `--skills-dir` or a foreign `OPENCLAW_CONFIG_PATH`), so the hook comes on once that cause is gone. When the default turns the hook on and the harness cannot activate it yet, the skills are registered and the run does not fail; later refreshes try again. The hook goes only into the harness profile's own plugin folder; a registration with a custom `--skills-dir`, or OpenClaw run with `OPENCLAW_CONFIG_PATH` pointing at another config, gets no hook (`HARNESS_HOOK_UNSUPPORTED` with `--start-hook`; with `GSTACK_HARNESS_START_HOOK` or `harness_start_hook`, `register` and `./setup --host` say why and exit 4). `OPENCLAW_CONFIG_PATH` naming the profile's own `openclaw.json`, by any path that resolves to it, is fine. A hook you already turned on stays on when a later run happens to have `OPENCLAW_CONFIG_PATH` set.
|
||||
|
||||
**Run the harness's own setup first.** gstack turns the hook on only in a harness that already has its config (`openclaw.json` from `openclaw onboard`, `config.yaml` from `hermes setup`). Without one, the harness CLI would create a config holding nothing but gstack's plugin setting, with no model, provider or terminal settings, so gstack runs no harness command: the plugin's files are written, the hook reports `written` with the setup to run, and `register` and `./setup --host` exit 4. Once the harness is set up, the next `./setup` or `gstack-harness refresh` turns the hook on, changing only the `gstack-start` plugin entry.
|
||||
|
||||
**Check it.** The receipt and `gstack-harness status` show `start hook: active` (configured for new sessions; a running OpenClaw gateway or Hermes gateway picks it up when it reloads or restarts), `written` (files in place but not active, with the reason and the command that fixes it), `disabled` (you turned it off in the harness), `unknown` (the harness CLI is not on `PATH`, as inside OpenClaw's or Hermes's own terminal tool, and the config file cannot settle it; gstack reads `plugins.enabled` and `plugins.disabled` from Hermes's `config.yaml` and the plugin entry from `openclaw.json` instead), `unchecked` (a run that left a hook already on alone, or `status --no-check`; `gstack-harness status` checks it) or `off`. When the run that turns the hook on (or `--start-hook`) leaves it inactive, `gstack-harness register` and `./setup --host` exit 4 after registering the skills (`HARNESS_HOOK_INACTIVE`). Later refreshes and upgrades try once more each time, without failing, until the hook is active or you disable the plugin in the harness.
|
||||
|
||||
**Turn it off.** `gstack-harness register openclaw --no-start-hook` (or `hermes`), or `gstack-config set harness_start_hook off` followed by `./setup`. Either turns the plugin off through the harness's CLI and removes its folder. You can also switch it off in the harness (`openclaw config set plugins.entries.gstack-start.enabled false`, `hermes plugins disable gstack-start`); gstack then leaves it off and never turns it back on unless you pass `--start-hook` again. `gstack-harness unregister` and `gstack-uninstall` remove it with the rest (Hermes only disables it when its folder holds an edited file or a kept `.edited-*` copy, so your edit survives), and print the harness command to run when the harness CLI is not on `PATH`. In a profile with no harness config yet (no `openclaw.json` or `config.yaml`), the hook was never turned on, so turning it off or unregistering runs no harness command and leaves the config alone.
|
||||
**Turn it off.** `gstack-harness register openclaw --no-start-hook` (or `hermes`), which that registration keeps, or `gstack-config set harness_start_hook off` followed by `./setup`, which every registration keeps. Either turns the plugin off through the harness's CLI and removes its folder. You can also switch it off in the harness (`openclaw config set plugins.entries.gstack-start.enabled false`, `hermes plugins disable gstack-start`); gstack then leaves it off and never turns it back on unless you pass `--start-hook` again. `gstack-harness unregister` and `gstack-uninstall` remove it with the rest (Hermes only disables it when its folder holds an edited file or a kept `.edited-*` copy, so your edit survives), and print the harness command to run when the harness CLI is not on `PATH`. In a profile with no harness config yet (no `openclaw.json` or `config.yaml`), the hook was never turned on, so turning it off or unregistering runs no harness command and leaves the config alone.
|
||||
|
||||
**What it costs.** The note is about 50 tokens and lands on every user turn, and each copy stays in the session's history, so a long session pays more (mostly cache reads). HARN-18's panel measures the added cost per trial. OpenClaw also logs that it cannot verify where the plugin came from, because gstack writes it instead of installing it from npm or ClawHub.
|
||||
|
||||
|
||||
+6
-4
@@ -39,10 +39,12 @@ explicit "no" removes a live registration. `GSTACK_TIMELINE_STOP_HOOK=no` and
|
||||
--source gstack-timeline-stop` removes it by hand, and `gstack-uninstall`
|
||||
removes it too.
|
||||
|
||||
Two more hooks are off by default and registered only when you turn them on:
|
||||
skill routing (`./setup --skill-routing`, a `UserPromptSubmit` hook that names
|
||||
the gstack skill a prompt fits) and skill contracts (`./setup --skill-contracts`,
|
||||
a `Stop` hook that blocks once when a skill ends without its required outputs);
|
||||
Three more hooks are on by default: skill routing (a `UserPromptSubmit` hook
|
||||
that names the gstack skill a prompt fits), skill contracts (a `Stop` hook that
|
||||
blocks once when a skill ends without its required outputs) and the
|
||||
destructive-command check (a `PreToolUse` hook that runs /careful's check before
|
||||
every Bash and PowerShell command). Turn one off with `./setup --no-skill-routing`,
|
||||
`--no-skill-contracts` or `--no-destructive-guard`, or `gstack-config set <name> off`;
|
||||
see [skill-routing-and-contracts.md](skill-routing-and-contracts.md). The
|
||||
opt-in skill gates (`./setup --ceo-review-gate`, `./setup --autoplan-gate`)
|
||||
register their own hooks the same way; see [skill-gates.md](skill-gates.md).
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
# Skill routing and skill contracts
|
||||
|
||||
Two Claude Code hooks that help a model actually run gstack's skills (GST-1088). Each has one default, `SWITCH_DEFAULT` in `lib/skill-route.ts`; `gstack-config defaults` prints it. With both off nothing changes. The opt-in gates that hold one skill rule mid-run (the /plan-ceo-review and /autoplan gates) are in [skill-gates.md](skill-gates.md).
|
||||
Three Claude Code hooks that help a model actually run gstack's skills (GST-1088, GST-3110). All three are on by default. On Opus 5.5, unattended, a hook line naming a skill got it loaded in 58 of 60 bug-fix sessions, where the same skill relying on its description loaded in 0 of 60 (gstack-evals#369, and B1 before it on the same 60 tasks). With the contract hook, all 66 /review sessions ran its specialist reviewers, 42 of them after the hook's one block; in an earlier run without it, 0 of 66 did (gstack-evals board posts GEVA-271 and GEVA-105). Each has one default, `SWITCH_DEFAULT` in `lib/skill-route.ts`; `gstack-config defaults` prints it. With all three off nothing changes. The opt-in gates that hold one skill rule mid-run (the /plan-ceo-review and /autoplan gates) are in [skill-gates.md](skill-gates.md).
|
||||
|
||||
- **Skill routing** (`skill_routing`, a UserPromptSubmit hook). When a prompt matches an installed skill's `triggers:`, the hook adds one line of context naming that skill, for example "this request fits /verify. Run /verify with the Skill tool before you start".
|
||||
- **Skill contracts** (`skill_contracts`, a Stop hook). A skill can declare the outputs that must exist before it is done. When the model tries to stop without them, the hook blocks once and names what is missing.
|
||||
- **Destructive-command check** (`destructive_guard`, a PreToolUse hook on Bash and PowerShell). /careful's check, run in every session without the model loading /careful: see [below](#destructive-command-check).
|
||||
|
||||
## Turn them on or off
|
||||
|
||||
Each switch resolves in this order, and the first one set wins:
|
||||
|
||||
1. The `./setup` flag: `--skill-routing` / `--no-skill-routing` and `--skill-contracts` / `--no-skill-contracts` (also `--skill-routing=on|off`). A flag is saved to config, so it survives upgrades.
|
||||
2. The environment: `GSTACK_SKILL_ROUTING` and `GSTACK_SKILL_CONTRACTS` (`on` or `off`). Not saved.
|
||||
3. Config: `gstack-config set skill_routing on|off` and `gstack-config set skill_contracts on|off`.
|
||||
1. The `./setup` flag: `--skill-routing` / `--no-skill-routing`, `--skill-contracts` / `--no-skill-contracts` and `--destructive-guard` / `--no-destructive-guard` (also `--skill-routing=on|off`). A flag is saved to config, so it survives upgrades.
|
||||
2. The environment: `GSTACK_SKILL_ROUTING`, `GSTACK_SKILL_CONTRACTS` and `GSTACK_DESTRUCTIVE_GUARD` (`on` or `off`). Not saved.
|
||||
3. Config: `gstack-config set skill_routing on|off`, `gstack-config set skill_contracts on|off` and `gstack-config set destructive_guard on|off`.
|
||||
4. The default: `SWITCH_DEFAULT` in `lib/skill-route.ts`, the only place it is written. Setup, the hooks, `gstack-config get|list|defaults` and `gstack-skill-route --default <switch>` all read it.
|
||||
|
||||
`on` also accepts yes, true and 1; `off` accepts no, false and 0. Setup warns about any other value, uses the default for that run, and does not save it; the hooks also use the default for such a value. A config file that exists but cannot be read turns both hooks off in setup and in the hooks, whatever the default, because it may hold an `off` you set.
|
||||
@@ -20,6 +21,9 @@ Setup registers a hook only when its switch is on, prints one line the first tim
|
||||
|
||||
gstack-config set skill_contracts off
|
||||
gstack-config set skill_routing off
|
||||
gstack-config set destructive_guard off
|
||||
|
||||
**Upgrading from an install where they were off.** The default used to be off, and nothing was saved unless you chose. So the first `./setup` (or `/gstack-upgrade`) after this change registers each hook you never turned off, prints one line per hook with its off switch, and once prints a short notice listing what it turned on. An off you set earlier, by flag, `gstack-config` or the environment, is read before the default and kept.
|
||||
|
||||
The off switch is for people. The text the Stop hook shows the model never mentions it.
|
||||
|
||||
@@ -37,7 +41,10 @@ The hook scores the prompt against the `triggers:` list in each installed `SKILL
|
||||
- A trigger scores 1 when its whole phrase appears in the prompt. Otherwise it scores the share of its content words (common words dropped, light stemming, so "failing" matches "fails") that the prompt contains. A trigger with one content word counts only on its whole phrase, unless that word has five or more letters and is not a question word.
|
||||
- Only /review, /qa and /verify route (/investigate did too until it was cut, GST-1717). In the d7 check (PR #3912), scoring every installed skill's triggers sent 17 of 32 non-fit Terminal-Bench prompts to some skill at 0.66; routing only the four routed skills of that time sent 4. The other skills wait for their own trigger review.
|
||||
- The skill with the best score routes when it reaches the threshold, 0.66: both words of a two-word trigger, or two of three.
|
||||
- Prompts that start with `/` (you already picked a skill) and prompts over 8,000 characters (pasted logs) are never routed.
|
||||
- Words a bug report uses for the defect (error, exception, traceback, crash, fails, failure, broken, regression, incorrect, wrong, defect, and exception names such as `ValueError`) score as "bug", so "parse_one raises ValueError, please fix" matches a "fix this bug" trigger. Paths and identifiers stay whole (`site-packages`, `src/review.ts`, `max_retries`), so a traceback's paths never match a trigger's words.
|
||||
- When a trigger ties with another of the same skill on score and words, a whole-phrase match wins.
|
||||
- A prompt longer than 5,000 characters is scored on its first 4,000 and last 1,000 characters, where the request usually sits; a log pasted between them is not scored, so its words cannot match everything. Until GST-3110 such prompts (over 8,000 characters) were never routed.
|
||||
- Prompts that start with `/` (you already picked a skill) are never routed.
|
||||
- The injected line names its source and its off switch, and asks the model to tell you in one sentence that gstack routed the request.
|
||||
|
||||
### Dry run
|
||||
@@ -45,7 +52,7 @@ The hook scores the prompt against the `triggers:` list in each installed `SKILL
|
||||
`gstack-skill-route --explain` shows what the hook would do, with the switch on or off. It never injects anything.
|
||||
|
||||
$ gstack-skill-route --explain "run the checks and verify my change"
|
||||
switch: skill_routing off (default)
|
||||
switch: skill_routing on (default)
|
||||
threshold: 0.66
|
||||
skills: 63 scanned in /home/you/.claude/skills
|
||||
candidates:
|
||||
@@ -60,6 +67,13 @@ Add `--json` for a machine-readable answer, or `--threshold <n>` to see another
|
||||
|
||||
Every decision is one line in `$GSTACK_STATE_ROOT/hooks/skill-route.log`: the session, the event (`routed`, `no-route` with its reason, or an error) and, for errors, `failures=<n>` for that session. The log never holds prompt text. On any error the hook prints nothing and exits 0; it never blocks a prompt.
|
||||
|
||||
<a id="destructive-command-check"></a>
|
||||
## Destructive-command check
|
||||
|
||||
`./setup` registers `hosts/claude/hooks/destructive-guard-hook` as a PreToolUse hook on `Bash|PowerShell`. It runs `careful/bin/check-careful.sh`, the same check /careful and /guard load, so it fires even when the model never loads /careful. Its decisions are the check's own: `ask` before the destructive families (`rm -rf`, `DROP TABLE`, `TRUNCATE`, force-push, `git reset --hard`, `kubectl delete` and the rest in /careful's table), which you can always approve, and `deny` for the two catastrophic simple shapes (a recursive delete of `/` or your home directory, and a force-push to the default branch). An ask's reason, which you read, adds `(gstack's destructive-command check, on in every session; off: gstack-config set destructive_guard off)`; a deny's reason, which the model reads, never names the off switch. In a session nobody is watching (`claude -p`, which Claude Code marks `CLAUDE_CODE_ENTRYPOINT=sdk-cli`, or a session `gstack-session-kind` reports as headless), an ask would wait for an answer that never comes, so the hook prints the same reason as a warning and lets the command run, which is what happens when the check is off; a deny stays a deny. It costs about a tenth of a second per Bash call.
|
||||
|
||||
The hook reads `destructive_guard` every time it runs, so `gstack-config set destructive_guard off` takes effect on the next command. With it off, /careful and /guard still load their own session hooks.
|
||||
|
||||
## Contracts
|
||||
|
||||
### Schema (version 1)
|
||||
|
||||
+2
-2
@@ -1484,7 +1484,7 @@ gstack can invoke a skill for you when your request matches one. By default (`pr
|
||||
|
||||
## Safety & Guardrails
|
||||
|
||||
Four skills that add safety rails to any Claude Code session. They work via Claude Code's PreToolUse hooks — transparent, session-scoped, no configuration required.
|
||||
Four skills that add safety rails to any Claude Code session. They work via Claude Code's PreToolUse hooks — transparent, no configuration required. /careful's destructive-command check also runs in every session by default (`destructive_guard`; off: `gstack-config set destructive_guard off`); the others are session-scoped.
|
||||
|
||||
### `/careful`
|
||||
|
||||
@@ -1502,7 +1502,7 @@ On Windows the same hook checks Claude Code's PowerShell tool and any `pwsh`/`po
|
||||
|
||||
Common build artifact cleanups (`rm -rf node_modules`, `dist`, `.next`, `__pycache__`, `build`, `coverage`) are whitelisted — no false alarms on routine operations.
|
||||
|
||||
You can override any MEDIUM warning. Two catastrophic shapes are hard-denied instead of asked: recursive deletes of the filesystem root or your home directory (including the `/*`, `~/`, and `$HOME/` forms), and force-pushes to the repo's default branch (`--force-with-lease` never triggers the deny; the escape hatch is ending the session-scoped `/careful` session). You can also add your own warn rules — one POSIX ERE per line — in `~/.gstack/careful-patterns.txt` (global) or `~/.gstack/projects/<slug>/careful-patterns.txt` (per-project); custom patterns only ever add warnings, never suppress the built-ins. The guardrails are accident prevention, not access control.
|
||||
You can override any MEDIUM warning. Two catastrophic shapes are hard-denied instead of asked: recursive deletes of the filesystem root or your home directory (including the `/*`, `~/`, and `$HOME/` forms), and force-pushes to the repo's default branch (`--force-with-lease` never triggers the deny; to run one anyway, turn the every-session check off with `gstack-config set destructive_guard off` and don't load `/careful` or `/guard`). You can also add your own warn rules — one POSIX ERE per line — in `~/.gstack/careful-patterns.txt` (global) or `~/.gstack/projects/<slug>/careful-patterns.txt` (per-project); custom patterns only ever add warnings, never suppress the built-ins. The guardrails are accident prevention, not access control.
|
||||
|
||||
### `/freeze`
|
||||
|
||||
|
||||
+4
-4
@@ -8,7 +8,7 @@ If gstack is installed on your machine:
|
||||
~/.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.
|
||||
This handles skills, symlinks, harness registrations (the files `gstack-harness` wrote into OpenClaw, Hermes, a Dot or another harness, from their ledgers, plus the [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 <path>` if you want it gone. If `git worktree list` fails, the uninstall stops too, even with `--force-worktrees`, and so it does on git older than 2.36, which cannot list worktrees with `-z`. 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.
|
||||
|
||||
@@ -126,12 +126,12 @@ Manual removal leaves gstack's hook entries behind in `~/.claude/settings.json`
|
||||
`_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, the Stop hooks
|
||||
(session timeline, plus verify-gate and skill contracts if you opted in), and
|
||||
the skill-routing UserPromptSubmit hook if you turned it on, and the
|
||||
(session timeline, skill contracts, which is on by default, and verify-gate if you opted in), and
|
||||
the skill-routing UserPromptSubmit hook and the destructive-command PreToolUse hook (both on by default), and the
|
||||
/plan-ceo-review and /autoplan skill-gate hooks if you turned those on. 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),
|
||||
If the OpenClaw or Hermes [start hook](hosts.md#start-hook) is on (the default for a new registration),
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user