Sign in
Explore
Add-ons · HookEveryday codingImages & VideoContext & memoryGraphic designReviewed

gsd-update-banner.js

SessionStart hook that shows a banner when a GSD update is available and the GSD statusline is not installed.

The source repository is archived by its owner, so it gets no more updates.

Kind
Hook
Works with
Claude Code, Gemini / Antigravity
Languages
TypeScript / JavaScript
Source
gsd-build/get-shit-done @ bdcaab2c752d
Path
hooks/gsd-update-banner.js
Jobs
Automation
Topics
Context & memory, Graphic design

Credit

Made by
gsd-build
Original
github.com/gsd-build/get-shit-done/blob/bdcaab2c752d9a33a1a1c…
License
MIT

Listed by Skill Manifest; not made by us.

InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
Adds
  • Entries under `hooks` in .claude/settings.json
Runs scripts
Yes
  • gsd-update-banner.js
  • the component is a script
Uses the network
None found
Needs secrets
None found
Reads outside the project
  • /usr/bin/env (gsd-update-banner.js)
  • ~/.cache/gsd/gsd-update-check.json (gsd-update-banner.js)
  • ~/.cache/gsd (gsd-update-banner.js)
Calls other skills
  • /gsd:update
Source revision
bdcaab2c752d
Licence
MIT
Last activity
Archived by its owner
  • Last push 31 May 2026
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

#!/usr/bin/env node
// gsd-hook-version: {{GSD_VERSION}}
// SessionStart banner that surfaces GSD update availability when GSD's
// statusline isn't installed. Reads the cache that
// gsd-check-update-worker.js writes to ~/.cache/gsd/gsd-update-check.json.
//
// Opt-in by design: bin/install.js only registers this hook when the user
// declines to install (or replace) the GSD statusline. The presence of the
// SessionStart entry IS the opt-in — there is no separate runtime flag.
//
// See issue #2795 for the rationale.

'use strict';

const fs = require('fs');
const path = require('path');
const os = require('os');

// Suppress repeat parse-error banners for 24 hours so a genuinely broken
// cache file doesn't nag the user every session.
const RATE_LIMIT_SECONDS = 24 * 60 * 60;

/**
 * Build the SessionStart JSON envelope to emit, given parsed cache state.
 * Pure function — no I/O. Returns null when the hook should print nothing.
 *
 * @param {object} state
 * @param {object|null} state.cache                  Parsed cache, or null if missing/unreadable.
 * @param {boolean}     state.parseError             True iff cache file existed but JSON.parse failed.
…