CommandCodeAI / CommandCodeAI/command-code

Feature: Just 3 Hooks are there Please expand the hooks system to match Claude Code / Codex parity

Abierto
#463 3 comentarios 0 reacciones 1 asignado Ver en GitHub

@vipulgupta2048 ya está trabajando en esto.

Desde el 30/6/2026.

Lenguaje dominante
Sin datos de lenguaje
Estrellas
4k
Forks
350
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Feature Description

Command Code currently supports only 3 hook events:

  • PreToolUse
  • PostToolUse
  • Stop

This is severely limited compared to Codex and Claude Code, which both expose a much richer hook lifecycle. The gaps prevent meaningful observability, automation, and integration with orchestration tools like herdr, tmux, and cmux.

Missing events (present in Codex):

  • PermissionRequest — intercept before a permission dialog
  • PostCompact / PreCompact — hook around context compaction
  • SessionStart — fire on session begin/resume
  • SubagentStart / SubagentStop — detect when subagents spawn/finish
  • UserPromptSubmit — intercept before Claude processes the prompt

Missing events (present in Claude Code, not even in Codex):

  • Setup — one-time prep on init
  • UserPromptExpansion — before slash command expands to a prompt
  • PermissionDenied — when auto-mode classifier denies a tool call
  • PostToolUseFailure — after a tool call fails (currently only success is hooked)
  • PostToolBatch — after a full parallel tool batch resolves
  • Notification — when the assistant sends a notification
  • MessageDisplay — while assistant message text is being displayed
  • TaskCreated — when a task is created via TaskCreate

Missing tool matcher support:
Command Code's supported tools table (shell, read, write, edit) also lacks matcher support for MCP tools, which both Codex and Claude Code support via mcp__* patterns.

Use Case

Without these hooks, Command Code cannot be properly integrated into multi-agent orchestration setups.

Concrete pain points today:

  1. herdr cannot recognize cmd agents in tmux/cmux sessions because there is no SessionStart or SubagentStart event to listen on — the hooks to signal "an agent started" simply don't exist
  2. No failure visibilityPostToolUseFailure is missing, so failed tool calls are silent
  3. No notification hooks — the Notification event missing means tools like cmux cannot trigger alerts when Command Code finishes a task
  4. No permission interceptionPermissionRequest / PermissionDenied missing means no way to auto-approve or audit permission dialogs programmatically
  5. No subagent lifecycleSubagentStart / SubagentStop missing breaks any workflow that needs to track spawned agents

Codex and Claude Code already solved these. Command Code needs hook parity to be usable in the same workflows.

Additional Context

Reference implementations for all listed events:

Priority order for missing events (highest impact first):

  1. SessionStart — needed for herdr/cmux agent detection
  2. SubagentStart / SubagentStop — needed for multi-agent orchestration
  3. Notification — needed for cmux notification triggers
  4. PostToolUseFailure — needed for error observability
  5. PermissionRequest / PermissionDenied — needed for auto-approval workflows
  6. UserPromptSubmit — needed for prompt interception
  7. PostToolBatch, MessageDisplay, TaskCreated, UserPromptExpansion, Setup — parity completion
Image Image
How important is this to you?

Very important

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.