github / github/copilot-cli

sessionStart  prompt hooks don't fire on  /new , and  /clear  seems to skip sessionStart entirely — naming/behavior mismatch

Offen
#4,365 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area:configuration area:sessions
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

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:

  1. 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."
  2.  /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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Dokumentation des sessionStart-Hooks und verfolge, wie die Befehle /new und /clear Hook-Quellen behandeln. Bestätige das aktuelle Verhalten für Prompt-Hooks und lege fest, ob diese Übergänge sessionStart oder ein separates Ereignis verwenden sollten. Erledigt ist die Aufgabe, wenn Ereignissemantik, Quellenwerte und Dokumentation konsistent sind und die betroffenen Übergänge durch Tests abgedeckt sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
cli, developer-experience
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.