CLI Reference
conclaude provides a command-line interface for initializing configuration, validating settings, and handling Claude Code lifecycle hooks.
Global Options
Section titled “Global Options”These options apply to all commands:
| Option | Description |
|---|---|
--version | Print version information |
--help | Print help information |
Commands
Section titled “Commands”Initialize conclaude configuration and Claude Code hooks in the current directory.
conclaude init [OPTIONS]Options:
| Option | Description |
|---|---|
--config-path <PATH> | Custom path for .conclaude.yaml file |
--claude-path <PATH> | Custom path for .claude directory |
-f, --force | Overwrite existing configuration files |
--schema-url <URL> | Custom schema URL for YAML language server header |
Examples:
# Initialize with defaultsconclaude init
# Force overwrite existing configconclaude init --force
# Custom configuration pathconclaude init --config-path ./config/conclaude.yamlCreated Files:
.conclaude.yaml— Project configuration with YAML language server support.claude/settings.json— Claude Code hook configuration (created or updated)
validate
Section titled “validate”Validate conclaude configuration file syntax and schema compliance.
conclaude validate [OPTIONS]Options:
| Option | Description |
|---|---|
--config-path <PATH> | Path to configuration file or directory to validate |
Examples:
# Validate default configurationconclaude validate
# Validate specific fileconclaude validate --config-path ./production.yaml
# Use in CI scriptsconclaude validate && echo "Config valid" || exit 1Exit Codes:
| Code | Meaning |
|---|---|
0 | Configuration is valid |
1 | Validation failed (syntax error, schema violation, file not found) |
visualize
Section titled “visualize”Display file and directory protection settings from configuration.
conclaude visualize [OPTIONS]Options:
| Option | Description |
|---|---|
-r, --rule <RULE> | Specific rule to visualize |
--show-matches | Show files that match the rule patterns |
Available Rules:
uneditableFiles— Files protected from editingpreventRootAdditions— Root directory protection statustoolUsageValidation— Tool-specific validation rules
Examples:
# Show all rules overviewconclaude visualize
# Show specific rule detailsconclaude visualize --rule uneditableFiles
# Show matching filesconclaude visualize --rule uneditableFiles --show-matchesHook Commands
Section titled “Hook Commands”These commands are called by Claude Code during session lifecycle events. They read JSON payloads from stdin and output results.
PreToolUse
Section titled “PreToolUse”Fired before Claude uses any tool (Write, Bash, Read, etc.).
echo '{"session_id":"...","tool_name":"Write",...}' | conclaude PreToolUseUse Cases:
- Block file creation at project root
- Protect files from editing
- Validate tool inputs
PostToolUse
Section titled “PostToolUse”Fired after a tool operation completes.
echo '{"session_id":"...","tool_name":"Write",...}' | conclaude PostToolUseUse Cases:
- Audit logging
- Performance monitoring
- Post-processing validation
Fired when Claude finishes a task and the session is about to end.
echo '{"session_id":"...","stop_hook_active":true,...}' | conclaude StopUse Cases:
- Run linting and formatting checks
- Execute test suites
- Verify build succeeds
- Continuous validation (infinite mode)
SessionStart
Section titled “SessionStart”Fired when a Claude Code session begins.
echo '{"session_id":"...",...}' | conclaude SessionStartUse Cases:
- Initialize session logging
- Set up monitoring
- Prepare workspace
UserPromptSubmit
Section titled “UserPromptSubmit”Fired when the user submits input to Claude.
echo '{"session_id":"...","prompt":"...",...}' | conclaude UserPromptSubmitUse Cases:
- Log user prompts
- Pre-process input
SubagentStart
Section titled “SubagentStart”Fired when a Claude subagent (coder, tester, etc.) begins work.
echo '{"session_id":"...","agent_id":"coder",...}' | conclaude SubagentStartUse Cases:
- Track subagent initialization
- Resource allocation
- Monitoring setup
SubagentStop
Section titled “SubagentStop”Fired when a Claude subagent completes its work.
echo '{"session_id":"...","agent_id":"coder",...}' | conclaude SubagentStopUse Cases:
- Log subagent completion
- Cleanup operations
- Metrics collection
Notification
Section titled “Notification”Fired for system notifications.
echo '{"session_id":"...",...}' | conclaude NotificationPreCompact
Section titled “PreCompact”Fired before transcript compaction.
echo '{"session_id":"...",...}' | conclaude PreCompactPermissionRequest
Section titled “PermissionRequest”Fired when a tool requests permission.
echo '{"session_id":"...",...}' | conclaude PermissionRequestSessionEnd
Section titled “SessionEnd”Fired when a session terminates.
echo '{"session_id":"...",...}' | conclaude SessionEndExit Codes
Section titled “Exit Codes”All hook commands use consistent exit codes:
| Code | Meaning |
|---|---|
0 | Success — operation allowed to proceed |
1 | Error — validation failure, parsing error, or handler crash |
2 | Blocked — hook explicitly blocked the operation |
Environment Variables
Section titled “Environment Variables”Configuration
Section titled “Configuration”| Variable | Description |
|---|---|
CONCLAUDE_LOG_LEVEL | Log level: debug, info, warn, error |
CONCLAUDE_DISABLE_FILE_LOGGING | Disable logging to temporary files |
Hook Context
Section titled “Hook Context”Available to commands executed by hooks:
| Variable | Description |
|---|---|
CONCLAUDE_SESSION_ID | Unique session identifier |
CONCLAUDE_TRANSCRIPT_PATH | Path to session transcript file |
CONCLAUDE_CWD | Current working directory |
CONCLAUDE_HOOK_EVENT | Name of executing hook |
CONCLAUDE_CONFIG_DIR | Directory containing config file |
Subagent Hooks
Section titled “Subagent Hooks”Additional variables for SubagentStart and SubagentStop:
| Variable | Description |
|---|---|
CONCLAUDE_AGENT_ID | Raw agent identifier (e.g., “adb0a8b”) |
CONCLAUDE_AGENT_NAME | Semantic agent name (e.g., “coder”, “tester”, “stuck”) extracted from main transcript. Falls back to CONCLAUDE_AGENT_ID if extraction fails. (SubagentStop only) |
CONCLAUDE_SUBAGENT_TYPE | Subagent type (e.g., “implementation”) (SubagentStart only) |
CONCLAUDE_AGENT_TRANSCRIPT_PATH | Path to subagent transcript |
CONCLAUDE_PERMISSION_MODE | Permission mode (SubagentStart only) |