anchor.diff:  # Buildkite Agent Hooks
   
  -Every agent installer comes with a hooks directory which can be used to override and extend the built-in agent behavior. For example you could create an agent `checkout` hook which speeds up a fresh `git clone` on a new build machine, an agent `environment` hook which exports secret API keys as environment variables, or a pipeline `pre-command` hook which sets up some repository-specific environment variables.
  +Every agent installer comes with a hooks directory which can be used to override and extend the built-in agent behavior. For example you could create an agent `checkout` hook which speeds up a fresh `git clone` on a new build machine, an agent `environment` hook which exports secret API keys as environment variables, or a repository `pre-command` hook which sets up some repository-specific environment variables.
   
   <%= toc %>
   
  
positive.code: There are three types of hooks:
  
  1. [Agent hooks](#agent-hooks) - these exist on the agent’s machine, and are run for every job on any pipeline.
  1. [Pipeline hooks](#pipeline-hooks) - these exist in the pipeline repository’s `.buildkite/hooks` directory.
  1. [Plugin hooks](#plugin-hooks) - these are provided by any [plugins](/docs/agent/v3/plugins) defined in your pipeline repository’s `pipeline.yml`.
  
  ## Available hooks
  
  
negative.code: 
  To get started with agent hooks copy the relevant example script and remove the `.sample` file extension.
  
  ## Repository hooks
  
  Repository hooks allow you to execute repository-specific scripts. Repository hooks live alongside your repository’s source code under the directory `.buildkite/hooks`.
  
  To get started create a `.buildkite/hooks` directory, add your hook script, and make it executable.
  
  