anchor.diff:  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
   
  
positive.code: * Job Lifecycle
  
  Agent lifecycle hooks are **executed** by the Buildkite agent as part of the
  agent’s lifecycle. For example, the `pre-bootstrap` hook is executed before
  starting a job’s bootstrap process, and the `agent-shutdown` hook is executed
  before the agent process terminates.
  
  Job lifecycle hooks are **sourced** by the Buildkite bootstrap in the different
  job phases. They are run in a per-job shell environment, and any exported
  environment variables are carried to the job’s subsequent phases and hooks. For
  example, the `environment` hook can modify or export new environment variables
  for the job’s subsequent checkout and command phases.
  
  In August 2021 we changed how we refer to agent hooks to differentiate between
  the hooks feature for both the agent and bootstrap processes, and the agent
  
negative.code: ECHO "--- \:house_with_garden\: Setting up the environment"
  SET GITHUB_RELEASE_ACCESS_KEY='xxx'
  ```
  