anchor.diff:  cd ci
   ```
   
  -## Global Hooks
  +## Agent hooks
   
  -Each agent installer comes with a hooks directory containing a sample set of hooks. You can find the location of your global hooks directory in your platform’s installation documentation.
  +Each agent installer comes with 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 global hooks copy the relevant example script and remove the `.sample` file extension.
  +To get started with agent hooks copy the relevant example script and remove the `.sample` file extension.
   
  -## Pipeline Hooks
  +## Pipeline hooks
   
   Pipeline hooks allow you to execute pipeline-specific scripts. Pipeline hooks live alongside your pipeline’s source code under the directory `.buildkite/hooks`.
   
  -To get started create a `.buildkite/hooks` directory, and your hook script, and make it executable, for example:
  +To get started create a `.buildkite/hooks` directory, add your hook script, and make it executable.
   
  -```bash
  -mkdir -p .buildkite/hooks
  +## Plugin hooks
   
  -cat << 'HOOK_SCRIPT' > .buildkite/hooks/pre-command
  -set -eu
  -echo "--- \:checkered_flag\: Running pre-command"
  +Plugin hooks allow any plugins you’ve defined to execute and override any of the default behaviour.
   
  -echo "About to run command: $BUILDKITE_COMMAND"
  -HOOK_SCRIPT
  -
  -chmod +x .buildkite/hooks/pre-command
  -```
  +See the [plugin documentation](/docs/agent/v3/plugins) for how to implement plugin hooks.
   
   ## Hooks on Windows
   
  
positive.code: # 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 a global `checkout` hook which speeds up a fresh `git clone` on a new build machine, a global `environment` hook which exports secret API keys as environment variables, or a pipeline-level `command` hook which runs the pipeline’s steps inside a custom containerized environment.
  
  <%= toc %>
  
  ## Overview
  
  There are two types of hooks: global hooks which exist on the agent’s machine and are the same for every pipeline, and pipeline level hooks which exist in each repository in the `.buildkite/hooks` directory.
  
  ## Available Hooks
  
  Hooks are called in the following order:
  
  1. `environment` (global) - runs before all other commands, useful for [exporting secret keys](/docs/agent/v3/securing#using-environment-hooks-for-secrets) etc.
  1. `pre-checkout` (global) - runs before checkout
  1. `checkout` (global) - overrides the default `git checkout` behavior
  1. `post-checkout` (global) - runs after checkout
  1. `post-checkout` (pipeline) - runs after checkout
  1. `pre-command` (global) - runs before the build command
  1. `pre-command` (pipeline) - runs before the build command
  1. `command` (global) - overrides the default script running behavior, useful for changing how the command is evaluated (such as running it inside a container)
  1. `post-command` (pipeline) - runs after the command
  1. `post-command` (global) - runs after the command
  1. `pre-artifact` (pipeline) - runs before artifacts are uploaded, if an artifact upload pattern was defined for the job
  1. `pre-artifact` (global) - runs before artifacts are uploaded, if an artifact upload pattern was defined for the job
  1. `post-artifact` (pipeline) - runs after artifacts have been uploaded, if an artifact upload pattern was defined for the job
  1. `post-artifact` (global) - runs after artifacts have been uploaded, if an artifact upload pattern was defined for the job
  1. `pre-exit` (pipeline) - runs before the job finishes, useful for performing cleanup tasks
  1. `pre-exit` (global) - runs before the job finishes, useful for performing cleanup tasks
  
  <div class="Docs__note">
  <p class="Docs__note__heading">Windows hooks</p>
  These hooks work on unix-based systems with bash in the path. If you're running Windows agents, you'll need some Windows-specific additions to get your hooks running. See <a href="hooks#hooks-on-windows">Hooks on Windows</a> for a detailed description.</p>
  </div>
  
  ## Creating Hook Scripts
  
  Hooks are bash scripts you can use to execute commands and export environment variables. All the standard [Buildkite environment variables](/docs/builds/environment-variables) are available to be used inside your hook scripts.
  
  
negative.code: 
  ```batch
  @ECHO OFF
  ECHO "--- \:house_with_garden\: Setting up the environment"
  SET GITHUB_RELEASE_ACCESS_KEY='xxx'
  ```
  