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

# Factory Droid

> Integrate Entire with Factory's Droid agent for AI coding session capture

Droid is [Factory](https://factory.ai)'s AI-powered development agent. Entire integrates with Droid via its hook-based settings system, automatically capturing sessions and checkpoints. The Droid integration is in preview and may contain bugs.

## Prerequisites

* [Entire CLI installed](/cli/installation)
* [Droid installed](https://docs.factory.ai/cli/getting-started/quickstart)
* A Git repository with Entire enabled

## Enable

```bash theme={null}
entire agent add factoryai-droid
droid
```

`entire agent add factoryai-droid` installs hooks into `.factory/settings.json` automatically.

<AccordionGroup>
  <Accordion title="How it works">
    The hooks track the full session lifecycle:

    1. **Session Start** — fires when Droid launches, creating a new Entire session.
    2. **Turn Tracking** — each user prompt triggers tracking via `user-prompt-submit` hooks.
    3. **Subagent Tracking** — `pre-tool-use` and `post-tool-use` hooks capture Task tool invocations for nested session support.
    4. **Session End** — fires when Droid exits, finalizing the session.
    5. **Transcript Capture** — session transcript is read from Droid's JSONL log files.
    6. **Session Storage** — data saved to the `entire/checkpoints/v1` branch.
  </Accordion>

  <Accordion title="What gets captured">
    | Data         | Description                                |
    | ------------ | ------------------------------------------ |
    | Conversation | Full transcript of prompts and responses   |
    | File changes | All files modified during the session      |
    | Tool calls   | Tool invocations with inputs and outputs   |
    | Token usage  | Input, output, reasoning, and cache tokens |
    | Timestamps   | Session, message, and checkpoint timing    |
  </Accordion>

  <Accordion title="Features">
    **Nested session support.** When Droid spawns sub-agents via the Task tool, Entire captures these as nested sessions through `pre-tool-use` and `post-tool-use` hooks:

    ```
    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` to restore to a previous checkpoint during or after a Droid session. 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 `droid --session-id <id>`. 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.
  </Accordion>

  <Accordion title="Caveats and limitations">
    * The integration is in preview and may have rough edges.
    * Session detection relies on hook-based process detection.
    * Transcript capture depends on Droid writing JSONL session logs.
  </Accordion>

  <Accordion title="Best practices">
    **Commit at logical points.** Commit when you've made meaningful progress:

    ```bash theme={null}
    git add .
    git commit -m "Implement feature with Droid assistance"
    ```

    **Check status regularly.** Monitor your session with `entire status`.
  </Accordion>

  <Accordion title="Example workflow">
    ```bash theme={null}
    # 1. Enable Entire with Factory Droid
    cd my-project
    entire agent add factoryai-droid

    # 2. Start Droid
    droid

    # 3. Work with Droid
    # Ask it to write code, make changes, etc.

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

    # 5. Rewind if needed
    entire checkpoint rewind

    # 6. Commit when ready
    git add .
    git commit -m "Add feature with Droid"

    # 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 detected">
    1. Ensure you're in an Entire-enabled repo: `entire status`
    2. Verify Droid is running from within the repository
    3. Check that hooks are installed in `.factory/settings.json`
    4. Check Git hooks are installed: `ls .git/hooks`
  </Accordion>

  <Accordion title="No checkpoints created">
    1. Checkpoints require file changes — ensure Droid is modifying files
    2. Check your settings in `.entire/settings.json`
    3. Verify the `.factory/settings.json` hooks are present
  </Accordion>

  <Accordion title="Transcript not captured">
    1. Ensure Droid's session storage exists at `~/.factory/sessions/<repo>/`
    2. Check that JSONL transcript files are being written
    3. Look for errors in the Entire hook output
  </Accordion>
</AccordionGroup>
