anchor.diff:  Hooks can be defined in the following locations:
   
   * On the agent
  -* In your pipeline’s repository
  +* In your pipeline's repository
   * In [plugins](/docs/plugins) applied to steps
   
   For example, you could define an agent-wide `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 plugin `environment` hook which fetches API keys
  -from a secrets’ storage service.
  +from a secrets' storage service.
   
   There are two categories of hook:
   
  
positive.code: hooks have access to all the standard [Buildkite environment variables](/docs/pipelines/environment-variables).
  
  Job lifecycle hooks are copied to `$TMPDIR` directory and *sourced* by the
  agent’s default shell. This has a few implications:
  
  * `$BASH_SOURCE` contains the location the hook is sourced from
  * `$0` contains the location of the copy of the script that is running from `$TMPDIR`
  
negative.code: directory that agent level hooks are defined.
  
  {:toc}
  
  ## Hook locations
  
  Hooks can be defined in three locations:
  
  * Agent hooks - these exist on the agent file system in a directory created by
  your agent installer and configured by the [`hooks-path`](configuration#hooks-path)
  setting. You can define both agent lifecycle and job lifecycle hooks in the
  agent hooks location. Job lifecycle hooks defined here will be run for every job
  the agent receives, from any pipeline.
  * Repository hooks - these exist in your pipeline repository's
  `.buildkite/hooks` directory and can define job lifecycle hooks. Job lifecycle
  hooks defined here will be run for every pipeline that uses the repository.
  * Plugin hooks - these are provided by any [plugins](/docs/plugins) you've
  included in your pipeline steps and can define job lifecycle hooks. Job
  lifecycle hooks defined by a plugin will only be run for the step that includes
  them. Plugins can be *vendored* (if they are already present in the repository,
  and included using a relative path) or *non-vendored* (when they are included
  from elsewhere), which affects the order they are run in.
  
  ### Agent hooks
  
  Every agent installer creates a hooks directory containing a set of
  sample hooks. You can find the location of your agent hooks directory in your
  platform's installation documentation.
  
  To get started with agent hooks copy the relevant example script and remove the
  `.sample` file extension.
  
  See [agent lifecycle hooks](#agent-lifecycle-hooks) and
  [job lifecycle hooks](#job-lifecycle-hooks) for the hook types that can be
  defined in the agent hooks directory.
  
  ### Repository hooks
  
  Repository hooks allow you to execute repository-specific scripts. Repository
  hooks live alongside your repository's source code under the `.buildkite/hooks`
  directory.
  
  To get started, create a shell script in `.buildkite/hooks` named
  `post-checkout`. It will be sourced and run after your repository has been
  checked out as part of every job for any pipeline that uses this repository.
  
  You can define any of the [job lifecycle hooks](#job-lifecycle-hooks) whose
  `Order` includes *Repository*.
  
  ### Plugin hooks
  
  Plugin hooks allow plugins you've defined in your Pipeline Steps to override
  default behavior.
  
  See the [plugin documentation](/docs/plugins) for how to implement plugin hooks
  and [job lifecycle hooks](#job-lifecycle-hooks) for the list of hook types that
  a plugin can define.
  
  ## Agent lifecycle hooks
  
  