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 repository `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 repository-specific environment variables.
   
   {:toc}
   
  
positive.code: 
  ## Creating hook scripts
  
  Hooks are bash scripts you can use to execute commands and export environment variables. All the standard [Buildkite environment variables](/docs/pipelines/environment-variables) are available to be used inside your hook scripts.
  
  The following is an example of a custom `environment` hook which exports a GitHub API key for the pipeline’s release build step:
  
  
negative.code: 
  export GITHUB_RELEASE_ACCESS_KEY='xxx'
  ```
  
  ## Hooks on Windows
  
  