github / github/copilot-cli

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

Abierto
#4,365 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:configuration area:sessions
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

### 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_

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la documentación del hook sessionStart y sigue cómo los comandos /new y /clear gestionan las fuentes de los hooks. Confirma el comportamiento actual de los hooks de prompt y define si estas transiciones deben usar sessionStart o un evento distinto. Se considera terminado cuando la semántica de los eventos, los valores de las fuentes y la documentación sean coherentes, y las transiciones afectadas estén cubiertas por pruebas.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
shell
Área
cli, developer-experience
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.