anchor.diff:  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:
  +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`
  
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: Hooks can be defined in the following locations:
  
  * On the agent
  * 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.
  
  There are two categories of hook:
  
  