sessionStart prompt hooks don't fire on /new , and /clear seems to skip sessionStart entirely — naming/behavior mismatch
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
Describe the feature or problem you'd like to solve
Invoke a skill foreach new session
Proposed solution
The sessionStart hook name strongly implies it fires whenever a new "session" (conversation) begins — including via /new and /clear . In practice:
- Hook entries of "type": "prompt" only fire on true CLI process startup ( source: "startup" ), not on /new ( source: "new" ) or /clear , per the docs note: "Prompt hooks fire only for new interactive sessions... They do not fire on resume." This is confusing because /new is documented as "Start a new conversation" and intuitively should count as a "new interactive session."
- /clear ("Abandon this session and start fresh") doesn't appear to trigger sessionStart at all — it's not listed among the source values ( "startup" | "resume" | "new" ).
This creates a real usability gap: a user-level hook meant to re-apply a session-scoped customization (e.g., auto-running a skill/mode via a prompt hook) silently stops working after /new or /clear , with no indication in /env that anything is "missing" — the hook config is loaded, it just never fires again for these transitions.
Suggestions:
• Either make "type": "prompt" hooks fire for source: "new" (matching user expectation and documented /new behavior), or rename the event/restrict the docs wording so it's unambiguous that sessionStart (for prompt hooks) really means "process startup only."
• Clarify/confirm whether /clear fires sessionStart at all, and add it explicitly to the source enum if so.
• Consider a distinct event (e.g., conversationStart ) for /new / /clear transitions, separate from true process-level sessionStart , so hook authors can target the semantics they actually need.
Example prompts or workflows
No response
Additional context
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
sessionStart hook のドキュメントから始め、/new と /clear コマンドが hook のソースをどのように扱うかを追跡します。prompt hook の現在の動作を確認し、これらの遷移で sessionStart を使用するべきか、それとも別のイベントを使用するべきかを定義します。イベントのセマンティクス、ソース値、ドキュメントに一貫性があり、影響を受ける遷移がテストでカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- shell
- 領域
- cli, developer-experience
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100