[DOCS] Missing documentation for `Setup` hook event and associated CLI flags (`--init`, `--init-only`, `--maintenance`)

Resolved 💬 2 comments Opened Jan 17, 2026 by coygeek Closed Jan 21, 2026

Documentation Type

Missing documentation (feature not documented)

Documentation Location

Section/Topic

  • Hooks Reference: The "Hook Events" section. - CLI Reference: The "CLI flags" table.

Current Documentation

In the Hooks Reference (docs/en/hooks.md), the "Hook Events" section lists:

PreToolUse PermissionRequest PostToolUse Notification UserPromptSubmit Stop SubagentStop PreCompact SessionStart SessionEnd

In the CLI Reference (docs/en/cli-reference.md), the flags table covers standard flags like --add-dir, --model, and --print, but does not mention any flags related to initialization or maintenance.

What's Wrong or Missing?

According to the Claude Code Changelog for Version 2.1.10, a significant new feature was added:

"- Added new Setup hook event that can be triggered via --init, --init-only, or --maintenance CLI flags for repository setup and maintenance operations"

This information is entirely missing from the current documentation. Users who want to automate repository bootstrapping or maintenance tasks using Claude Code have no documentation on:

  1. What the Setup hook event does or what its input JSON schema looks like.
  2. The existence of the --init, --init-only, and --maintenance flags.
  3. How Setup hooks differ from SessionStart hooks (e.g., if they run before/after or only during specific flag invocations).

Suggested Improvement

In docs/en/hooks.md:
Add a new entry for the Setup event:

#### Setup Runs when Claude Code is invoked with setup or maintenance flags. This is intended for initial repository indexing, dependency installation, or environment health checks. Trigger Flags: --init, --init-only, --maintenance Matchers: (None)

In docs/en/cli-reference.md:
Add the following entries to the CLI flags table:
| Flag | Description | Example |
| :--- | :--- | :--- |
| --init | Triggers the Setup hook event and then proceeds to the interactive REPL. | claude --init |
| --init-only | Triggers the Setup hook event and exits immediately after completion. | claude --init-only |
| --maintenance | Runs repository maintenance tasks defined in the Setup hook. | claude --maintenance |

Impact

High - Prevents users from using a feature

Additional Context

  • This issue was identified by comparing the v2.1.10 changelog against the live documentation files.
  • The Setup hook is particularly important for enterprise users who need to ensure a repository is "Claude-ready" (e.g., generating a .mcp.json or running a custom indexing script) before developers start their first session.
  • Similar projects (like husky for git hooks) typically provide a "Lifecycle" table; adding a small lifecycle diagram showing when Setup runs vs SessionStart would be very helpful.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗