> ## 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.

# Claude Code

> Integrate Entire with Claude Code for seamless session capture

Claude Code is Anthropic's official CLI for Claude, designed for software engineering tasks. Entire has first-class integration with Claude Code — it is the default agent and is the most stable integration, capturing full session transcripts, file changes, tool calls, token usage, and nested subagent sessions.

## Prerequisites

* [Entire CLI installed](/cli/installation)
* [Claude Code installed](https://docs.anthropic.com/en/docs/claude-code)
* A Git repository with Entire enabled

## Enable

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

<AccordionGroup>
  <Accordion title="How it works">
    Entire automatically detects when Claude Code is active and begins capturing the session via Git hooks:

    1. **Session Detection** — when Claude Code starts, Entire detects the process.
    2. **Hook Triggers** — Git hooks fire on file changes and commits.
    3. **Checkpoint Creation** — checkpoints are created when you or the agent make a Git commit.
    4. **Metadata Capture** — session data is stored on the `entire/checkpoints/v1` branch.
  </Accordion>

  <Accordion title="What gets captured">
    Entire captures the following from Claude Code sessions:

    | Data         | Description                              |
    | ------------ | ---------------------------------------- |
    | Conversation | Full transcript of prompts and responses |
    | File changes | All files modified during the session    |
    | Tool calls   | Commands executed, files read, etc.      |
    | Token usage  | Input, output, and cache tokens          |
    | Timestamps   | Start time, checkpoints, end time        |
  </Accordion>

  <Accordion title="Features">
    **Nested session support.** When Claude Code spawns sub-agents via the Task tool, Entire captures these as nested sessions:

    ```
    Main Session
    ├── Checkpoint 1
    ├── Sub-agent Session (Task: "Run tests")
    │   ├── Sub-checkpoint 1
    │   └── Sub-checkpoint 2
    └── Checkpoint 2
    ```

    Nested sessions preserve the full context of complex multi-agent workflows.

    **Rewind during sessions.** Use `entire checkpoint rewind` while Claude Code is running to restore to a previous checkpoint. See the [`rewind` command reference](/cli/commands#rewind) for full flag documentation.

    **Resume previous sessions.** Switch to a session's branch with `entire session resume <branch>`. The CLI restores the session log if needed and prints the Claude Code resume command. See the [`resume` command reference](/cli/commands#resume) for full flag documentation.

    **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`explain` command reference](/cli/commands#explain) for full flag documentation.

    <Note>
      The `--generate` flag on `entire checkpoint explain` requires the configured provider CLI, such as Claude CLI, to be installed and authenticated.
    </Note>
  </Accordion>

  <Accordion title="Best practices">
    **Commit at logical points.** Create checkpoints at natural stopping points: after implementing a feature, before making major changes, or when you'd want to rewind later.

    **Review sessions in PRs.** Commits include `Entire-Checkpoint` trailers. Reviewers can click through to view session details — understanding *why* code was written helps with review.
  </Accordion>

  <Accordion title="Example workflow">
    A typical workflow with Claude Code and Entire:

    ```bash theme={null}
    # 1. Enable Entire
    cd my-project
    entire enable

    # 2. Start Claude Code
    claude

    # 3. Work with Claude (in Claude Code)
    > Add user authentication with JWT tokens

    # 4. Check status (in another terminal)
    entire status

    # 5. Made a mistake? Rewind
    entire checkpoint rewind

    # 6. Commit when ready
    git add .
    git commit -m "Add JWT authentication"

    # 7. Push to see on entire.io
    git push
    ```

    Your session is now visible on [entire.io](https://entire.io) with full context for code review.
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Session not being captured">
    1. Verify Entire is enabled: `entire status`
    2. Check that Git hooks are installed: `ls .git/hooks`
    3. Ensure Claude Code is running from within the repository
  </Accordion>

  <Accordion title="Rewind not working">
    Rewind requires an active session with checkpoints. Check:

    ```bash theme={null}
    entire status
    ```

    If no session is active, checkpoints may only exist on the sessions branch.
  </Accordion>
</AccordionGroup>
