> ## Documentation Index
> Fetch the complete documentation index at: https://docs.entire.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Hooks

> Configure which AI coding agents Entire captures.

Use this page when you are choosing which AI coding agents Entire captures, adding an agent after setup, or fixing agent sessions that are not being captured.

For agent-specific setup and caveats, see [Agents](/agents/overview).

<Note>
  Agent hooks are different from [Git hooks](/guides/configuration/git-hooks).
  Agent hooks capture the AI session while you work; Git hooks connect that
  captured session to commits and pushes.
</Note>

## What this config affects

Agent hooks control whether Entire can capture:

* prompts and transcripts
* tool activity
* changed files
* token usage, when available
* session start and session end events

## Start here if

* you are adding or changing an agent
* agent sessions are not being captured or hooks need to be reinstalled
* you are enabling an external agent plugin

## Configure agent hooks

<Tabs>
  <Tab title="Built-in agents">
    Add a supported agent with:

    ```bash theme={null}
    entire agent add AGENT_NAME
    ```

    For example:

    ```bash theme={null}
    entire agent add codex
    entire agent add claude-code
    ```

    During initial setup, choose an agent with:

    ```bash theme={null}
    entire enable --agent codex
    ```

    ### Agent hook files

    Each agent stores its hook configuration in its own directory. When you run `entire enable` or `entire agent add`, hooks are installed in the appropriate location for each selected agent:

    | Agent         | Hook location                    | Format               |
    | ------------- | -------------------------------- | -------------------- |
    | Claude Code   | `.claude/settings.json`          | JSON hooks config    |
    | Codex         | `.codex/hooks.json`              | JSON hooks config    |
    | Copilot CLI   | `.github/hooks/entire.json`      | JSON hooks config    |
    | Cursor        | `.cursor/hooks.json`             | JSON hooks config    |
    | Gemini CLI    | `.gemini/settings.json`          | JSON hooks config    |
    | OpenCode      | `.opencode/plugins/entire.ts`    | TypeScript plugin    |
    | Factory Droid | `.factory/settings.json`         | JSON hooks config    |
    | Pi            | `.pi/extensions/entire/index.ts` | TypeScript extension |

    You can enable multiple agents at the same time. Each agent's hooks are independent.
  </Tab>

  <Tab title="External agents">
    ## External agent plugins

    External agent plugins let Entire discover additional agents from executables on your `$PATH`.

    Enable external agent discovery with:

    ```json .entire/settings.json theme={null}
    {
      "external_agents": true
    }
    ```

    Entire looks for executables named `entire-agent-<name>`.

    See [External Agent Plugins](/agents/external-agent-plugins/overview) for setup, protocol, and security details.
  </Tab>
</Tabs>

## Reinstall agent hooks

If an agent hook is missing, stale, or was edited outside Entire, reinstall it with:

```bash theme={null}
entire agent add AGENT_NAME --force
```

## Verify agent hooks

After configuring agent hooks, run:

```bash theme={null}
entire agent list
entire status --detailed
```

Use `entire agent list` to confirm the agent is installed. Use `entire status --detailed` to confirm Entire is enabled in the repository.

Then start a fresh session with the configured agent from inside the repository. If the agent was already running before hooks were installed, restart it.
