Sign in
Explore
Add-ons · HookEveryday codingContext & memoryReviewed

gsd-session-state.sh

SessionStart hook that outputs the head of STATE.md so each session starts oriented.

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

Kind
Hook
Works with
Claude Code, Gemini / Antigravity
Languages
Shell
Source
gsd-build/get-shit-done @ bdcaab2c752d
Path
hooks/gsd-session-state.sh
Jobs
Context management
Topics
Context & memory

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-session-state.sh
  • the component is a script
Uses the network
None found
Needs secrets
None found
Reads environment variables
  • ENABLED
  • STATE_PRESENT
  • STATE_HEAD
  • CONFIG_MODE
Reads outside the project
  • /usr/bin/env (gsd-session-state.sh)
Calls other skills
  • /gsd-new-project
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 bash
# gsd-hook-version: {{GSD_VERSION}}
# gsd-session-state.sh — SessionStart hook: inject project state reminder
# Outputs STATE.md head on every session start for orientation.
#
# OPT-IN: This hook is a no-op unless config.json has hooks.community: true.
# Enable with: "hooks": { "community": true } in .planning/config.json

# Check opt-in config — exit silently if not enabled
if [ -f .planning/config.json ]; then
  ENABLED=$(node -e "try{const c=require('./.planning/config.json');process.stdout.write(c.hooks?.community===true?'1':'0')}catch{process.stdout.write('0')}" 2>/dev/null)
  if [ "$ENABLED" != "1" ]; then exit 0; fi
else
  exit 0
fi

# Build the additionalContext text and emit it as a structured JSON
# envelope per the Claude Code SessionStart hook protocol (#2974). Tests
# parse the JSON and assert on typed fields (state_present: bool,
# config_mode: string, etc) rather than substring-matching free-form text.
STATE_PRESENT="false"
STATE_HEAD=""
if [ -f .planning/STATE.md ]; then
  STATE_PRESENT="true"
  STATE_HEAD=$(head -20 .planning/STATE.md)
fi

CONFIG_MODE="unknown"
if [ -f .planning/config.json ]; then
…