René's URL Explorer Experiment


Title: Hooks | Command Code - Command Code Docs

Open Graph Title: Hooks | Command Code

X Title: Hooks | Command Code

Description: Run your own scripts at key lifecycle events in Command Code. Find scopes, precedence, the full settings/input/output reference, copy-paste examples, and best practices for writing safe hooks.

Open Graph Description: Run your own scripts at key lifecycle events in Command Code. Find scopes, precedence, the full settings/input/output reference, copy-paste examples, and best practices for writing safe hooks.

X Description: Run your own scripts at key lifecycle events in Command Code. Find scopes, precedence, the full settings/input/output reference, copy-paste examples, and best practices for writing safe hooks.

Keywords:

Opengraph URL: https://commandcode.ai/docs/hooks

X: @CommandCodeAI

direct link

Domain: commandcode.ai


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Docs","item":"https://commandcode.ai/docs"},{"@type":"ListItem","position":2,"name":"Hooks"}]}

authorCommand Code
og:imagehttps://commandcode.ai/docs/api/og?title=Hooks | Command Code
og:image:altHooks | Command Code
twitter:cardsummary_large_image
twitter:creator@CommandCodeAI
twitter:imagehttps://commandcode.ai/docs/api/og?title=Hooks | Command Code

Links:

https://commandcode.ai/docs
Introductionhttps://commandcode.ai/docs
Quickstarthttps://commandcode.ai/docs/quickstart
Common Workflowshttps://commandcode.ai/docs/workflows
Pricing & Limitshttps://commandcode.ai/docs/resources/pricing-limits
Usage Limitshttps://commandcode.ai/docs/resources/usage-limits
Go Planhttps://commandcode.ai/docs/plans/go
GOAT PlanNewhttps://commandcode.ai/docs/plans/goat
Pro PlanNewhttps://commandcode.ai/docs/plans/pro
Max Planshttps://commandcode.ai/docs/plans/max
Provider APIhttps://commandcode.ai/docs/provider
Available Modelshttps://commandcode.ai/docs/reference/cli/models
Other payment methodshttps://commandcode.ai/docs/resources/payment-methods
Interactive Modehttps://commandcode.ai/docs/interactive-mode
Plan Modehttps://commandcode.ai/docs/plan-mode
Permissionshttps://commandcode.ai/docs/permissions
Memoryhttps://commandcode.ai/docs/memory
Tastehttps://commandcode.ai/docs/taste
Agentshttps://commandcode.ai/docs/agents
Skillshttps://commandcode.ai/docs/skills
MCPhttps://commandcode.ai/docs/mcp
Hookshttps://commandcode.ai/docs/hooks
Modshttps://commandcode.ai/docs/mods
Toolshttps://commandcode.ai/docs/reference/tools
Context & Compactionhttps://commandcode.ai/docs/context
Sessions & Checkpointshttps://commandcode.ai/docs/sessions
Background Taskshttps://commandcode.ai/docs/background-tasks
Git Worktreeshttps://commandcode.ai/docs/worktrees
Headless Modehttps://commandcode.ai/docs/headless
Desktop Apphttps://commandcode.ai/docs/desktop
IDE Extensionshttps://commandcode.ai/docs/ide
IDE Integrationhttps://commandcode.ai/docs/ide-integration
ACPhttps://commandcode.ai/docs/acp
Visionhttps://commandcode.ai/docs/vision
Windowshttps://commandcode.ai/docs/windows
BYOK Providershttps://commandcode.ai/docs/byok
Settings & Confighttps://commandcode.ai/docs/settings
Importhttps://commandcode.ai/docs/import
/designhttps://commandcode.ai/docs/design
/goalhttps://commandcode.ai/docs/goal
/loophttps://commandcode.ai/docs/loop
Remote controlhttps://commandcode.ai/docs/remote-control
ArtifactsNewhttps://commandcode.ai/docs/artifacts
CloudBetahttps://commandcode.ai/docs/cloud
Studiohttps://commandcode.ai/docs/studio
CLI Referencehttps://commandcode.ai/docs/reference/cli
Slash Commandshttps://commandcode.ai/docs/reference/slash-commands
Common Issueshttps://commandcode.ai/docs/troubleshooting/common-issues
FAQshttps://commandcode.ai/docs/troubleshooting/faqs
Telemetryhttps://commandcode.ai/docs/troubleshooting/telemetry
Error Codeshttps://commandcode.ai/docs/troubleshooting/errors
Security & Privacyhttps://commandcode.ai/docs/resources/security
Zero Data Retentionhttps://commandcode.ai/docs/resources/zdr
Legalhttps://commandcode.ai/docs/resources/legal
Changeloghttps://commandcode.ai/changelog
Overviewhttps://commandcode.ai/docs/harness-engineering
Tool Call Repairshttps://commandcode.ai/docs/harness-engineering/tool-call-repairs
The Read Toolhttps://commandcode.ai/docs/harness-engineering/read-tool
The Shell Toolhttps://commandcode.ai/docs/harness-engineering/shell-tool
What's New in v1https://commandcode.ai/docs/whats-new
https://commandcode.ai/docs
Homehttps://commandcode.ai
Referencehttps://commandcode.ai/docs/reference/cli
Modelshttps://commandcode.ai/models
Pricinghttps://commandcode.ai/pricing
Changeloghttps://commandcode.ai/changelog
Loginhttps://commandcode.ai/signin
https://x.com/CommandCodeAI
https://commandcode.ai/discord
https://github.com/CommandCodeAI/command-code
Overviewhttps://commandcode.ai/docs/hooks
What are hooks?https://commandcode.ai/docs/hooks#what-are-hooks
What you can do with hooks?https://commandcode.ai/docs/hooks#what-you-can-do-with-hooks
Supported eventshttps://commandcode.ai/docs/hooks#supported-events
Supported toolshttps://commandcode.ai/docs/hooks#supported-tools
How hooks workhttps://commandcode.ai/docs/hooks#how-hooks-work
Quickstarthttps://commandcode.ai/docs/hooks#quickstart
1. Create the settings filehttps://commandcode.ai/docs/hooks#1-create-the-settings-file
2. Try it outhttps://commandcode.ai/docs/hooks#2-try-it-out
Configurationhttps://commandcode.ai/docs/hooks#configuration
Orderinghttps://commandcode.ai/docs/hooks#ordering
Settings schemahttps://commandcode.ai/docs/hooks#settings-schema
Hook Definition fields (outer)https://commandcode.ai/docs/hooks#hook-definition-fields-outer
HookEntry fields (inner)https://commandcode.ai/docs/hooks#hook-entry-fields-inner
Example settings.jsonhttps://commandcode.ai/docs/hooks#example-settings-json
Hook input (stdin)https://commandcode.ai/docs/hooks#hook-input-stdin
Common fieldshttps://commandcode.ai/docs/hooks#common-fields
Tool-call fieldshttps://commandcode.ai/docs/hooks#tool-call-fields
Event-specific fieldshttps://commandcode.ai/docs/hooks#event-specific-fields
Environment variableshttps://commandcode.ai/docs/hooks#environment-variables
Hook output (stdout)https://commandcode.ai/docs/hooks#hook-output-stdout
Common output fieldshttps://commandcode.ai/docs/hooks#common-output-fields
PreToolUseOutput fieldshttps://commandcode.ai/docs/hooks#pre-tool-use-output-fields
PostToolUseOutput fieldshttps://commandcode.ai/docs/hooks#post-tool-use-output-fields
StopOutput fieldshttps://commandcode.ai/docs/hooks#stop-output-fields
SessionStartOutput fieldshttps://commandcode.ai/docs/hooks#session-start-output-fields
Who sees each fieldhttps://commandcode.ai/docs/hooks#who-sees-each-field
Exit codeshttps://commandcode.ai/docs/hooks#exit-codes
Exit code 2 block-reason resolutionhttps://commandcode.ai/docs/hooks#exit-code-2-block-reason-resolution
Exit code 0 stdout handlinghttps://commandcode.ai/docs/hooks#exit-code-0-stdout-handling
Block and halt decision matrixhttps://commandcode.ai/docs/hooks#block-and-halt-decision-matrix
Execution semanticshttps://commandcode.ai/docs/hooks#execution-semantics
Shellhttps://commandcode.ai/docs/hooks#shell
Execution orderhttps://commandcode.ai/docs/hooks#execution-order
Timeoutshttps://commandcode.ai/docs/hooks#timeouts
Isolationhttps://commandcode.ai/docs/hooks#isolation
Permission modeshttps://commandcode.ai/docs/hooks#permission-modes
Example: full hook scripthttps://commandcode.ai/docs/hooks#example-full-hook-script
Exampleshttps://commandcode.ai/docs/hooks#examples
Block dangerous bash commandshttps://commandcode.ai/docs/hooks#block-dangerous-bash-commands
Warn the agent about sensitive files on readhttps://commandcode.ai/docs/hooks#warn-the-agent-about-sensitive-files-on-read
Audit tool calls to a log filehttps://commandcode.ai/docs/hooks#audit-tool-calls-to-a-log-file
Quality gate (Stop hook)https://commandcode.ai/docs/hooks#quality-gate-stop-hook
Inject git status on session starthttps://commandcode.ai/docs/hooks#inject-git-status-on-session-start
Best practiceshttps://commandcode.ai/docs/hooks#best-practices
When to use hookshttps://commandcode.ai/docs/hooks#when-to-use-hooks
Writing safe hookshttps://commandcode.ai/docs/hooks#writing-safe-hooks
Testing a hook locallyhttps://commandcode.ai/docs/hooks#testing-a-hook-locally
Common failure modeshttps://commandcode.ai/docs/hooks#common-failure-modes
Debugging hookshttps://commandcode.ai/docs/hooks#debugging-hooks
Performancehttps://commandcode.ai/docs/hooks#performance
Next stepshttps://commandcode.ai/docs/hooks#next-steps
What are hooks?https://commandcode.ai/docs/hooks#what-are-hooks
What you can do with hooks?https://commandcode.ai/docs/hooks#what-you-can-do-with-hooks
Supported eventshttps://commandcode.ai/docs/hooks#supported-events
modshttps://commandcode.ai/docs/mods
Supported toolshttps://commandcode.ai/docs/hooks#supported-tools
Settings schemahttps://commandcode.ai/docs/hooks#settings-schema
How hooks workhttps://commandcode.ai/docs/hooks#how-hooks-work
reference sectionshttps://commandcode.ai/docs/hooks#settings-schema
Quickstarthttps://commandcode.ai/docs/hooks#quickstart
1. Create the settings filehttps://commandcode.ai/docs/hooks#1-create-the-settings-file
2. Try it outhttps://commandcode.ai/docs/hooks#2-try-it-out
Configurationhttps://commandcode.ai/docs/hooks#configuration
Orderinghttps://commandcode.ai/docs/hooks#ordering
Example settings.jsonhttps://commandcode.ai/docs/hooks#example-settingsjson
Settings schemahttps://commandcode.ai/docs/hooks#settings-schema
Hook Definition fields (outer)https://commandcode.ai/docs/hooks#hook-definition-fields-outer
HookEntry fields (inner)https://commandcode.ai/docs/hooks#hook-entry-fields-inner
Example settings.jsonhttps://commandcode.ai/docs/hooks#example-settings-json
Hook input (stdin)https://commandcode.ai/docs/hooks#hook-input-stdin
Common fieldshttps://commandcode.ai/docs/hooks#common-fields
permission modehttps://commandcode.ai/docs/hooks#permission-modes
Tool-call fieldshttps://commandcode.ai/docs/hooks#tool-call-fields
tool_input fieldshttps://commandcode.ai/docs/hooks#tool-input-fields
Event-specific fieldshttps://commandcode.ai/docs/hooks#event-specific-fields
PostToolUsehttps://commandcode.ai/docs/hooks#post-tool-use
Stophttps://commandcode.ai/docs/hooks#stop
SessionStarthttps://commandcode.ai/docs/hooks#session-start
Environment variableshttps://commandcode.ai/docs/hooks#environment-variables
Hook output (stdout)https://commandcode.ai/docs/hooks#hook-output-stdout
Common output fieldshttps://commandcode.ai/docs/hooks#common-output-fields
PreToolUseOutput fieldshttps://commandcode.ai/docs/hooks#pre-tool-use-output-fields
PostToolUseOutput fieldshttps://commandcode.ai/docs/hooks#post-tool-use-output-fields
StopOutput fieldshttps://commandcode.ai/docs/hooks#stop-output-fields
SessionStartOutput fieldshttps://commandcode.ai/docs/hooks#session-start-output-fields
Loop preventionhttps://commandcode.ai/docs/hooks#loop-prevention
Feeding text to the model on retryhttps://commandcode.ai/docs/hooks#feeding-text-to-the-model-on-retry
Who sees each fieldhttps://commandcode.ai/docs/hooks#who-sees-each-field
Exit codeshttps://commandcode.ai/docs/hooks#exit-codes
decision matrixhttps://commandcode.ai/docs/hooks#block-and-halt-decision-matrix
Exit code 2 block-reason resolutionhttps://commandcode.ai/docs/hooks#exit-code-2-block-reason-resolution
Exit code 0 stdout handlinghttps://commandcode.ai/docs/hooks#exit-code-0-stdout-handling
Block and halt decision matrixhttps://commandcode.ai/docs/hooks#block-and-halt-decision-matrix
Execution semanticshttps://commandcode.ai/docs/hooks#execution-semantics
Shellhttps://commandcode.ai/docs/hooks#shell
Execution orderhttps://commandcode.ai/docs/hooks#execution-order
Timeoutshttps://commandcode.ai/docs/hooks#timeouts
Isolationhttps://commandcode.ai/docs/hooks#isolation
decision matrixhttps://commandcode.ai/docs/hooks#block-and-halt-decision-matrix
Permission modeshttps://commandcode.ai/docs/hooks#permission-modes
Example: full hook scripthttps://commandcode.ai/docs/hooks#example-full-hook-script
Exampleshttps://commandcode.ai/docs/hooks#examples
Block dangerous bashhttps://commandcode.ai/docs/hooks#block-dangerous-bash-commands
Warn on sensitive readshttps://commandcode.ai/docs/hooks#warn-the-agent-about-sensitive-files-on-read
Audit tool callshttps://commandcode.ai/docs/hooks#audit-tool-calls-to-a-log-file
Quality gatehttps://commandcode.ai/docs/hooks#quality-gate-stop-hook
Inject git statushttps://commandcode.ai/docs/hooks#inject-git-status-on-session-start
Block dangerous bash commandshttps://commandcode.ai/docs/hooks#block-dangerous-bash-commands
Warn the agent about sensitive files on readhttps://commandcode.ai/docs/hooks#warn-the-agent-about-sensitive-files-on-read
Audit tool calls to a log filehttps://commandcode.ai/docs/hooks#audit-tool-calls-to-a-log-file
Writes and edits (PostToolUse)https://commandcode.ai/docs/hooks#writes-and-edits-post-tool-use
Shell commands (PreToolUse)https://commandcode.ai/docs/hooks#shell-commands-pre-tool-use
Quality gate (Stop hook)https://commandcode.ai/docs/hooks#quality-gate-stop-hook
Inject git status on session starthttps://commandcode.ai/docs/hooks#inject-git-status-on-session-start
Best practiceshttps://commandcode.ai/docs/hooks#best-practices
When to use hookshttps://commandcode.ai/docs/hooks#when-to-use-hooks
Modshttps://commandcode.ai/docs/mods
Writing safe hookshttps://commandcode.ai/docs/hooks#writing-safe-hooks
deny-dangerous.shhttps://commandcode.ai/docs/hooks#block-dangerous-bash-commands
Testing a hook locallyhttps://commandcode.ai/docs/hooks#testing-a-hook-locally
Common failure modeshttps://commandcode.ai/docs/hooks#common-failure-modes
Hook outputhttps://commandcode.ai/docs/hooks#hook-output-stdout
Debugging hookshttps://commandcode.ai/docs/hooks#debugging-hooks
Performancehttps://commandcode.ai/docs/hooks#performance
Next stepshttps://commandcode.ai/docs/hooks#next-steps
Modshttps://commandcode.ai/docs/mods
CLI Referencehttps://commandcode.ai/docs/reference/cli
Skillshttps://commandcode.ai/docs/skills
Discord communityhttps://commandcode.ai/discord
What are hooks?https://commandcode.ai/docs/hooks#what-are-hooks
What you can do with hooks?https://commandcode.ai/docs/hooks#what-you-can-do-with-hooks
Supported eventshttps://commandcode.ai/docs/hooks#supported-events
Supported toolshttps://commandcode.ai/docs/hooks#supported-tools
How hooks workhttps://commandcode.ai/docs/hooks#how-hooks-work
Quickstarthttps://commandcode.ai/docs/hooks#quickstart
Configurationhttps://commandcode.ai/docs/hooks#configuration
Settings schemahttps://commandcode.ai/docs/hooks#settings-schema
Hook input (stdin)https://commandcode.ai/docs/hooks#hook-input-stdin
Environment variableshttps://commandcode.ai/docs/hooks#environment-variables
Hook output (stdout)https://commandcode.ai/docs/hooks#hook-output-stdout
Exit codeshttps://commandcode.ai/docs/hooks#exit-codes
Block and halt decision matrixhttps://commandcode.ai/docs/hooks#block-and-halt-decision-matrix
Execution semanticshttps://commandcode.ai/docs/hooks#execution-semantics
Permission modeshttps://commandcode.ai/docs/hooks#permission-modes
Example: full hook scripthttps://commandcode.ai/docs/hooks#example-full-hook-script
Exampleshttps://commandcode.ai/docs/hooks#examples
Best practiceshttps://commandcode.ai/docs/hooks#best-practices
Next stepshttps://commandcode.ai/docs/hooks#next-steps
Mods// NEXThttps://commandcode.ai/docs/mods
// PREVMCPhttps://commandcode.ai/docs/mcp
Join Discordhttps://commandcode.ai/discord
issue on GitHubhttps://github.com/CommandCodeAI/command-code/issues
Discordhttps://commandcode.ai/discord
𝕏https://x.com/MrAhmadAwais
Get helphttps://commandcode.ai/contact
Follow us on Xhttps://x.com/CommandCodeAI
Follow on LinkedInhttps://www.linkedin.com/company/commandcodeai/
Join our Discord serverhttps://commandcode.ai/discord
Follow us on GitHubhttps://github.com/CommandCodeAI/command-code

Viewport: width=device-width, initial-scale=1


URLs of crawlers that visited me.