Sign in
Explore
Add-ons · HookEveryday codingData & AIPrompt engineeringReviewedMakes network calls

memorable-user-prompt-hook.ts

UserPromptSubmit hook that passes prompts to the third-party memorable CLI for recall, behind a consent setting, a secret scan and a trust policy.

Kind
Hook
Works with
Claude Code
Languages
TypeScript / JavaScript
Source
garrytan/gstack @ 01593aa67c94
Path
hosts/claude/hooks/memorable-user-prompt-hook.ts
Jobs
Context management
Topics
Prompt engineering

Credit

Made by
garrytan
Original
github.com/garrytan/gstack/blob/01593aa67c94780528e8f5121e473…
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
  • memorable-user-prompt-hook.ts
  • the component is a script
Uses the network
Yes
  • Marked in the catalog record
Needs secrets
None found
Reads environment variables
  • OUTPUT_CAP_BYTES
  • TRUNCATION_MARKER
  • GSTACK_MEMORABLE_BIN
  • MEMORABLE_BIN
  • HOOK_NAME
  • STDIN_CAP_BYTES
Reads outside the project
  • /usr/bin/env (memorable-user-prompt-hook.ts)
  • ~/.memorable/bin/memorable (memorable-user-prompt-hook.ts)
Source revision
01593aa67c94
Licence
MIT
Last activity
27 Nov 2026
Source changed after the scan
Yes
  • Last push 27 Nov 2026, scanned 3 Nov 2026; read it again before you rely on this scan
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 bun
/**
 * memorable-user-prompt-hook — gstack-mediated bridge from Claude Code's
 * UserPromptSubmit event to the third-party `memorable` CLI (memorable.sh).
 *
 * The vendor's own installer registers `memorable hook user-prompt` directly.
 * Registering it THROUGH gstack instead buys the user what gstack gives every
 * other off-machine sink: an explicit consent key, a receipt per attempted
 * send, a secret pre-scan, a trust envelope around what comes back, healing
 * and clean removal. This file is that mediation.
 *
 *   stdin JSON -> cap 1 MiB -> parse -> MEMORABLE=0? -> gate memorable_recall == on?
 *      -> win32? -> trust policy (deny / read-only veto, by session cwd; fail-closed)
 *      -> HIGH-tier secret scan (raw bytes AND decoded string leaves, each admitted by the clock)
 *      -> resolve vendor -> budget >= 500 ms? -> gate re-check
 *      -> receipt (fail-closed: no receipt, no send)
 *      -> VENDOR SPAWN (own process group, allowlisted env, group-killed on timeout)
 *      -> parse vendor JSON -> additionalContext only -> control-strip
 *      -> 8 KiB cap (UTF-8 boundary) -> trust envelope -> stdout (awaited)
…