Golden Thread Watch
A watch is a note in the vault, Projects/golden-thread/watches/<slug>.md, made from
<base>/../../templates/watch.md; its frontmatter says what to watch (url, label, track,
branch, watch_paths, current_version, p0_when, gh_repo). A cron job (gt_watch.py fetch) asks
each remote what changed and queues classified events outside the vault, in
$GT_WATCH_STATE or ~/.claude/golden-thread/watch/. The SessionStart hook reports
the queue — P0s first. This skill is the interactive side.
Since 0.15.0 watch is a Golden Thread module (plugin gt-watch, module watch), not part
of gt core: it is invoked as /gt-watch:gt-watch <command>, and bash install.sh --without watch removes it — skill, script, hook and all.
Script: <base>/../../scripts/gt_watch.py (installed copy:
~/.claude/golden-thread/hooks/gt_watch.py — use that one for install-cron, because
its path survives version bumps). Vault: $GT_VAULT if set, else vault_path in
~/.claude/vault-config.json. Pass the environment through unchanged — the demo sets
GT_VAULT, GT_WATCH and GT_WATCH_STATE and every command must honour them.
Severity is decided by the script's rules, never by you. P0: a new security
advisory; a new tag or release carrying a CVE/GHSA id or "security fix/release/update"
or "vulnerability"; a commit carrying a CVE/GHSA id; a change to SECURITY.md or a
watch_path that says one of those phrases; a watch's own p0_when pattern. Do not
promote or demote an event because its prose sounds urgent or harmless — explain it,
and let the user override by editing the watch note.
add
- Ask (once, together) for a label and anything non-default: which kinds to track
(commits, tags, releases — default all), watch_paths, the version in use here.
Accept "defaults" and move on.
- Run
python3 <script> add <url> --label "<label>" [--track tags,commits] [--watch-path src/auth/] [--current-version 2.4.0] [--p0-when "<regex>"].
It verifies the URL with git ls-remote (an unreachable URL is refused with the
reason — relay it), writes the note, and takes a baseline so only changes AFTER
now are reported.
- If it says the
watch setting is off, offer to switch it on
(python3 ~/.claude/golden-thread/hooks/gt_settings.py set watch report — gt's
settings tool; the module ships only gt_watch.py) and to install the
hourly fetch (python3 ~/.claude/golden-thread/hooks/gt_watch.py install-cron --every 1h).
Do either only on a yes. Skip this step when GT_WATCH is set in the environment
(a demo) — it must not change the user's settings or crontab.
remove
python3 <script> remove <slug>. Offer uninstall-cron only if no watches remain.
list
python3 <script> list — show it as is.
check
python3 <script> check fetches now, whatever the setting, then show
python3 <script> show.
show []
-
Run python3 <script> show <slug> (add --all for already-acknowledged events).
-
For each P0 and review event, read what changed: the cache path printed at the end
is a bare clone — git -C <cache> show --stat <sha>, git -C <cache> log -1 <sha>,
git -C <cache> for-each-ref refs/tags/<tag> --format='%(contents)'.
-
Explain in plain words: what changed, why the rule fired (quote the reason), and
what it means for the user's projects that depend on it (check the watch note's
body and current_version).
-
On a P0, file it in <vault>/INBOX.md as one line, through gt's write queue —
never a direct write; since gt 0.17.11 a Write/Edit or shell redirect to vault content
is denied (Core rule 1). The line is
- [ ] P0 upstream: <label> <ref> — <reason> (/gt-watch:gt-watch show <slug>);
put it in a scratch file outside the vault, then queue it and apply it with gt's
scripts (~/.claude/plugins/cache/golden-thread-plugin/gt/<newest>/scripts/):
python3 <gt-scripts>/gt_write_queue.py --vault "<vault>" --op append --path INBOX.md --content-file "<scratch file>"
python3 <gt-scripts>/gt_broker.py drain --vault "<vault>"
Pass the environment through (the demo's GT_VAULT is the vault). Say that it was
filed only if the drain applied it; if it held the write (another session's live
claim on INBOX.md), say it is queued and will land at the next drain. Do not file
review or routine events.
-
Offer to ack what was shown.
ack []
python3 <script> ack [<slug>] marks queued events seen; the hook stops reporting them
and a later change is reported again. It never touches what the fetch has seen.
Rules
- Never write
state.json or events.jsonl yourself — only the fetch does. ack is
the only thing that writes acked.json.
- Never put watch state in the vault; only the watch notes live there.
- Watch notes are ordinary notes — the user may edit their frontmatter in Obsidian.