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 repository-specific
  -environment variables.
  +Hooks can be used to extend or override built-in behaviours of the Buildkite
  +Agent. Hooks can be configured on your agent hosts, in your repository, or from
  +Pipeline Plug-ins. For example, you could create an agent `checkout` hook which
  +speeds up a fresh `git clone` on a new build machine, a repository `pre-command`
  +hook which sets up repository-specific environment variables, or a plug-in
  +`environment` hook which exports secret API keys as environment variables.
   
   {:toc}
   
  
positive.code:   </tbody>
  </table>
  
  ## Available Step Hooks
  
  The following is a complete list of available step hooks, and the order in which
  they are run as part of each job:
  
negative.code: 
  There are two types of hook:
  
  * Lifecycle hooks
  * Step hooks
  
  Lifecycle hooks are **executed** as part of the agent lifecycle. For example,
  the `pre-bootstrap` hook is executed before starting the per-job bootstrap
  process, and the `agent-shutdown` is executed before the agent process
  terminates.
  
  Step hooks are **sourced** as part of each Buildkite Job. Step hooks are run in
  a per-job shell environment, and any exported environment variables are carried
  to subsequent phases and hooks for a given job. For example, the `environment`
  hook can modify or export new environment variables for the subsequent job
  phases and hooks.
  
  ## Agent Hook Locations
  
  There are three locations that agent hooks are found:
  
  * Global hooks - these exist on the agent file system in a directory created by your agent installer and can define both
  Lifecycle and Step hooks. The Step hooks are run for every job on any pipeline.
  * Repository hooks - these exist in your pipeline repository’s `.buildkite/hooks` directory and can define Step hooks.
  * Plugin hooks - these are provided by any [plugins](/docs/plugins) you've defined in your `pipeline.yml` and can define Step hooks.
  
  ### Global hooks
  
  Each agent installer creates a global hooks directory containing a set of sample
  hooks. You can find the location of your agent hooks directory in your
  platform’s installation documentation.
  
  