--- title: Using hooks with {% data variables.copilot.copilot_cli %} shortTitle: Use hooks intro: "Extend {% data variables.product.prodname_copilot %} agent behavior with custom shell commands at key points during agent execution." versions: feature: copilot contentType: how-tos category: - Author and optimize with Copilot # Copilot discovery page - Build with Copilot CLI # Copilot CLI bespoke page redirect_from: - /copilot/how-tos/copilot-cli/use-hooks docsTeamMetrics: - copilot-cli --- {% data reusables.copilot.cloud-agent.hooks-intro %} ## Creating a hook in a repository on {% data variables.product.github %} {% data reusables.copilot.cloud-agent.create-hooks-instructions %} ## Troubleshooting {% data reusables.copilot.cloud-agent.troubleshoot-hooks %} ## Further reading * [AUTOTITLE](/copilot/reference/hooks-configuration) * [AUTOTITLE](/copilot/concepts/agents/cloud-agent/about-cloud-agent) * [AUTOTITLE](/copilot/concepts/agents/about-copilot-cli) * [AUTOTITLE](/copilot/how-tos/use-copilot-agents/cloud-agent/customize-the-agent-environment)