[FEATURE] add startup/session-init hook event to settings.json hooks

Resolved 💬 1 comment Opened May 30, 2026 by msusol Closed Jul 3, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Claude Code's hooks system currently fires on tool-use events (PreToolUse, PostToolUse, Stop, etc.) and the statusLine command renders per-conversation context. Neither fires at CLI startup — before a conversation exists.

This means plugins like a custom statusLine command don't initialize until the user sends a first message or runs /new. In interactive terminal environments (IntelliJ terminal, VS Code terminal, etc.) this creates a visible gap where the status line is absent at the initial prompt.

Proposed Solution

Add a startup (or SessionInit) hook event that fires once when the Claude Code CLI process starts, before displaying the initial prompt:

{
  "hooks": {
    "Startup": [
      {
        "type": "command",
        "command": "bash ~/.claude/plugins/my-plugin/on-start.sh"
      }
    ]
  }
}

This mirrors how the existing hooks work but runs exactly once at process init.

Alternative Solutions

Users must either send a first message or run /new to trigger the statusLine command. There is no way to pre-initialize plugin state from within Claude Code's own extension points.

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

Driven by token exhaustion on Claude Pro in CLI
show me the money $$ ref: https://github.com/msusol/claude-code-plugins

  • Status line plugins that should be active from the first prompt, not after the first message
  • Environment validation (check API keys, warn about config issues) before the session begins
  • Session logging / telemetry initialization
  • Loading dynamic config that should be available session-wide

Additional Context

  • The hook could receive a JSON payload with session metadata (model, session ID, etc.) via stdin, consistent with how other hooks work
  • A Shutdown counterpart would be a natural complement for cleanup

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗