Skip to content

fix(hooks): remove unsupported prompt-type SessionStart hook; convert PostCompact to command - #128

Open
jfcvb68nbb-max wants to merge 1 commit into
AgriciDaniel:mainfrom
jfcvb68nbb-max:fix/sessionstart-prompt-hook
Open

fix(hooks): remove unsupported prompt-type SessionStart hook; convert PostCompact to command#128
jfcvb68nbb-max wants to merge 1 commit into
AgriciDaniel:mainfrom
jfcvb68nbb-max:fix/sessionstart-prompt-hook

Conversation

@jfcvb68nbb-max

Copy link
Copy Markdown

Fixes the SessionStart: prompt-type hooks are not supported startup error (tracked in #93 and ~10 duplicates: #125, #116, #106, #97, #96, #87, #61, #40, #29).

Problem

hooks/hooks.json declares type: "prompt" hooks that the Claude Code / Codex harness rejects — prompt hooks require conversation context, which these events don't provide:

  • SessionStart — 3rd hook is prompt-type → printed as a startup error every session.
  • PostCompact — its only hook is prompt-type → the whole block is dropped, so wiki/hot.md is never re-read after a compaction (the feature silently never worked).

Fix

  • SessionStart: delete the prompt hook. It was redundant — the first command hook ([ -f wiki/hot.md ] && cat wiki/hot.md) already prints that context to stdout.
  • PostCompact: convert the prompt hook to the same command form, so hot-cache restoration actually fires after compaction.

No behavior lost: hot.md still restores on both SessionStart and PostCompact, now via command hooks that print to stdout. PostToolUse and Stop hooks are untouched.

Validation

  • hooks/hooks.json parses as valid JSON.
  • SessionStart types → ["command","command"]; PostCompact → ["command"]; zero prompt-type hooks remain.
  • Reproduced and verified the fix on Windows 11 (Claude Code + Codex CLI); the original reporter saw it on WSL2 — platform-independent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant