# Claude Code Source: https://docs.entire.io/agents/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](/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 ``` 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. 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 | **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 [`checkpoint rewind` command reference](/cli-reference/checkpoint#checkpoint-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 [`session resume` command reference](/cli-reference/sessions#session-resume) for full flag documentation. **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`checkpoint explain` command reference](/cli-reference/checkpoint#checkpoint-explain) for full flag documentation. The `--generate` flag on `entire checkpoint explain` requires the configured provider CLI, such as Claude CLI, to be installed and authenticated. **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. 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. ## Troubleshooting 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 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. # Codex Source: https://docs.entire.io/agents/codex Integrate Entire with Codex for AI coding session capture Codex is OpenAI's CLI coding agent. Entire integrates with Codex through Codex's native hook system, automatically capturing sessions and checkpoints. The Codex integration is in preview and may contain bugs. ## Prerequisites * [Entire CLI installed](/installation) * [Codex installed and authenticated](https://help.openai.com/en/articles/11096431) * A Git repository with Entire enabled ## Enable ```bash theme={null} entire agent add codex codex ``` `entire agent add codex` installs hooks into `.codex/hooks.json` and enables Codex's required `codex_hooks = true` feature flag in `.codex/config.toml` automatically — no manual config needed. Entire integrates with Codex through project-level hook configuration in `.codex/hooks.json`. The hooks track the session lifecycle: 1. **Session Start** — `SessionStart` creates a new Entire session. 2. **Prompt Tracking** — `UserPromptSubmit` captures each user prompt. 3. **Turn Completion** — `Stop` finalizes each turn and advances checkpoint state. 4. **Transcript Capture** — Entire reads Codex's JSONL rollout transcript from `~/.codex/` or `CODEX_HOME`. 5. **Session Storage** — data is saved to the `entire/checkpoints/v1` branch. | Data | Description | | ------------ | -------------------------------------------------- | | Conversation | Full transcript of prompts and responses | | File changes | Files modified via `apply_patch` in Codex rollouts | | Token usage | Input, cached-input, output, and reasoning tokens | | Timestamps | Session, turn, and checkpoint timing | **Rewind during sessions.** Use `entire checkpoint rewind` to restore to a previous checkpoint during or after a Codex session. When you rewind, Entire restores the checkpointed transcript state and shows the command to continue the Codex session. See the [`checkpoint rewind` command reference](/cli-reference/checkpoint#checkpoint-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 `codex resume SESSION_ID`. See the [`session resume` command reference](/cli-reference/sessions#session-resume) for full flag documentation. **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`checkpoint explain` command reference](/cli-reference/checkpoint#checkpoint-explain) for full flag documentation. 1. **Subagent capture is not available.** Unlike Claude Code, Codex does not currently expose subagent lifecycle hooks, so Entire captures the main Codex session but not nested subagent sessions. 2. **Session completion is turn-based.** Codex does not emit a distinct session-end hook. Entire relies on Codex's per-turn `Stop` hook and transcript data rather than a final shutdown event. 3. **Transcript paths can be missing.** In ephemeral Codex runs, the transcript path may be null. Entire can still process hook events, but full transcript capture is limited in that mode. 4. **`PreToolUse` is currently shell-only** and is not used for lifecycle tracking. 5. **Transcript capture depends on Codex writing rollout JSONL files.** **Enable Codex through Entire.** Use `entire agent add codex` instead of manually editing `.codex/hooks.json`. Entire preserves existing Codex hook config and also writes the required `.codex/config.toml` feature flag. **Commit at logical points.** Create checkpoints at natural stopping points: after implementing a feature, before risky refactors, or when you'd want to rewind later. ```bash theme={null} # 1. Enable Entire with Codex cd my-project entire agent add codex # 2. Start Codex codex # 3. Work with Codex # Ask it to make changes, edit files, and iterate # 4. Check status (in another terminal) entire status # 5. Rewind if needed entire checkpoint rewind # 6. Commit when ready git add . git commit -m "Add feature with Codex" # 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. ## Troubleshooting 1. Verify Entire is enabled: `entire status` 2. Check that `.codex/hooks.json` exists in the repository 3. Ensure `.codex/config.toml` contains `codex_hooks = true` 4. Ensure Codex is running from within the repository 1. Checkpoints require file changes — ensure Codex is modifying files 2. Commit or stage work as part of your normal Git flow 3. Check your settings in `.entire/settings.json` 4. Verify Codex hooks were installed with `entire agent add codex` 1. Ensure Codex is writing rollout files in `~/.codex/` or your `CODEX_HOME` 2. Verify the hook payload includes a transcript path 3. Avoid ephemeral mode if you want full transcript capture 4. Look for errors in Entire hook output with `entire doctor` # Copilot CLI Source: https://docs.entire.io/agents/copilot-cli Integrate Entire with GitHub's Copilot CLI Copilot CLI is GitHub's AI-powered coding agent for the command line. Entire captures sessions from Copilot CLI, tracking file changes, conversation transcripts, and token usage. The Copilot CLI integration is in preview and may contain bugs. ## Prerequisites * [Entire CLI installed](/installation) * [Copilot CLI](https://github.com/features/copilot/cli) installed * A Git repository with Entire enabled ## Enable ```bash theme={null} entire agent add copilot-cli copilot ``` `entire agent add copilot-cli` creates `.github/hooks/entire.json`, which Copilot CLI automatically discovers and executes at key lifecycle events. You can commit `.github/hooks/entire.json` to your repository so your team gets Entire integration automatically. 1. **Session Detection** — Copilot CLI fires hooks on session start and end. 2. **Turn Tracking** — each prompt and agent response is captured via hooks. 3. **Checkpoint Creation** — created when you or the agent make a Git commit. 4. **Transcript Capture** — session transcripts are read from Copilot CLI's JSONL event log. 5. **Session Storage** — data saved to the `entire/checkpoints/v1` branch. | Data | Description | | ------------ | ---------------------------------------- | | Conversation | Full transcript of prompts and responses | | File changes | All files modified during the session | | Token usage | Input, output, and cache tokens | | Timestamps | Session and checkpoint timing | | Checkpoints | Rewind points within sessions | **Rewind during sessions.** Use `entire checkpoint rewind` to restore to a previous checkpoint during or after a Copilot CLI session. See the [`checkpoint rewind` command reference](/cli-reference/checkpoint#checkpoint-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 `copilot --resume SESSION_ID`. See the [`session resume` command reference](/cli-reference/sessions#session-resume) for full flag documentation. **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`checkpoint explain` command reference](/cli-reference/checkpoint#checkpoint-explain) for full flag documentation. The `--generate` flag on `entire checkpoint explain` requires the configured provider CLI, such as Claude CLI, to be installed and authenticated. * Token usage is only available in aggregate after the session ends, not mid-session. * No subagent start hook — only subagent stop events are captured. * The `userPromptSubmitted` hook fires before `sessionStart` on the first prompt (handled automatically). * Works best when you commit at logical stopping points, or tell the agent to handle committing. **Commit at logical points.** Commit when you've made meaningful progress: ```bash theme={null} git add . git commit -m "Implement feature with Copilot assistance" ``` **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. ```bash theme={null} # 1. Setup cd my-project entire agent add copilot-cli # 2. Start Copilot CLI copilot # 3. Work with Copilot # 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 Copilot" # 7. Push to see on entire.io git push ``` ## Troubleshooting 1. Ensure you're in an Entire-enabled repo: `entire status` 2. Verify hooks are installed: check `.github/hooks/entire.json` exists 3. Make sure Copilot CLI is running from within the repository 4. Run `entire agent add copilot-cli` to reinstall hooks 1. Checkpoints require file changes 2. Make sure Copilot is modifying files in the repository 3. Check your settings in `.entire/settings.json` 1. Verify Copilot CLI is writing events to `~/.copilot/session-state/` 2. Check that the session has a valid `events.jsonl` file 3. Token usage is only fully available after the session ends # Cursor Source: https://docs.entire.io/agents/cursor Integrate Entire with Cursor IDE and CLI for AI coding session capture Cursor is an AI-powered code editor available as both an IDE and a command-line agent. Entire integrates with Cursor through its hook system, capturing sessions and checkpoints across both interfaces. The Cursor integration is in preview and may contain bugs. ## Prerequisites * [Entire CLI installed](/installation) * [Cursor IDE or Cursor CLI installed](https://www.cursor.com/) * A Git repository with Entire enabled ## Enable ```bash theme={null} entire agent add cursor cursor # or: agent (for Cursor CLI) ``` **Rewind and resume are not available** for Cursor sessions. You can use other Entire commands (`status`, `doctor`, `checkpoint explain`, `disable`), but cannot restore to previous checkpoints. Plan your commits carefully — you cannot undo changes via `entire checkpoint rewind`. Entire integrates with Cursor through hook configuration in `.cursor/hooks.json`. Both Cursor IDE and Cursor CLI are supported — choose the IDE for traditional development workflows or the CLI for scripted tasks, parallel processing, or terminal-first development. The hooks track the full session lifecycle: 1. **Session Start** — fires when Cursor launches, creating a new Entire session. 2. **Prompt Tracking** — `before-submit-prompt` hook captures each prompt submission. 3. **Subagent Tracking** — `subagent-start` and `subagent-stop` hooks track nested agent operations. 4. **Session End** — fires when Cursor exits, finalizing the session. 5. **Compaction** — `pre-compact` hook triggers before session data compaction. 6. **Transcript Capture** — session transcript is read from Cursor's JSONL log files. 7. **Session Storage** — data saved to the `entire/checkpoints/v1` branch. | Data | Description | | -------------- | ---------------------------------------- | | Conversation | Full transcript of prompts and responses | | File changes | All files modified during the session | | Subagent calls | Nested agent invocations and operations | | Timestamps | Session, message, and checkpoint timing | Unlike Claude Code, Cursor transcripts do not include token usage data or detailed tool invocation records. **Session capture.** Entire automatically captures the conversation flow and file modifications when Cursor launches. Run `entire status` from a separate terminal to see active sessions. **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`checkpoint explain` command reference](/cli-reference/checkpoint#checkpoint-explain) for full flag documentation. Rewind and resume are not supported — see the warning above and the caveats below. **No rewind or resume.** Cannot restore to previous checkpoints; cannot resume previous sessions. **No token accounting.** Cursor transcripts do not include token usage data (unlike Claude Code). You can still see the conversation and file changes, but not the computational cost. **File detection via `git status`.** Cursor's transcript format lacks detailed tool invocation records, so modified file detection relies on `git status` instead of transcript analysis. This means files must be committed or staged to be tracked, file modifications not in git are not captured in transcripts, and the file change detection is accurate but less granular than Claude Code. **Context attachment differences (CLI).** When using Cursor CLI, the `@` syntax for attaching files/folders as context does not behave identically to the IDE. The IDE's `@` mentions work through the AI chat interface for context selection; the CLI may require different handling — check Cursor CLI documentation for current behavior. **No detailed tool records.** Tool invocation details are limited compared to Claude Code. **Preview integration.** May contain rough edges or undocumented behavior. **Commit at logical points.** Create checkpoints at natural stopping points: after implementing a feature, before making major changes, or when you'd want to document progress. Especially important since rewind is not available. **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. **With Cursor IDE:** ```bash theme={null} # 1. Enable Entire cd my-project entire agent add cursor # 2. Start Cursor IDE cursor # 3. Work with Cursor IDE # Use @ mentions to attach files for context # Ask the AI to implement features # 4. Check status (in another terminal) entire status # 5. Commit when ready git add . git commit -m "Add feature with Cursor" # 6. Push to see on entire.io git push ``` **With Cursor CLI:** ```bash theme={null} # 1. Enable Entire cd my-project entire agent add cursor # 2. Run Cursor CLI agent # 2.1 Instruct Cursor CLI "refactor the authentication module" # 3. In parallel terminal, run another Cursor CLI agent # 3.1 Instruct the other CLI "update database schema" # 4. Check both sessions entire status # 5. Commit all changes git add . git commit -m "Parallel refactoring with Cursor CLI" # 6. Push to see on entire.io git push ``` ## Troubleshooting 1. Verify Entire is enabled: `entire status` 2. Check that hooks are installed: `cat .cursor/hooks.json` 3. Ensure Cursor is running from within the repository 4. For Cursor CLI, verify the process exits cleanly to trigger session-end hook 1. Checkpoints require file changes — ensure Cursor is modifying files 2. Changes must be staged or committed (git status is used for detection) 3. Check your settings in `.entire/settings.json` 4. Verify the `.cursor/hooks.json` hooks are present 1. Ensure Cursor's session storage exists (check `~/.cursor/` directory) 2. Verify JSONL transcript files are being written by Cursor 3. Check that the session completed normally (session-end hook must fire) 4. Look for errors in Entire hook output with `entire doctor` This is expected behavior for Cursor. Since transcripts lack tool\_use blocks, file detection relies on `git status`. Make sure to: 1. Stage or commit your changes with `git add` and `git commit` 2. Run `entire status` to verify files are detected 3. Review actual file changes in `git diff` if transcript shows nothing When using Cursor CLI, @ mentions for file context may not work identically to the IDE: 1. Check Cursor CLI documentation for current context attachment syntax 2. Consider using environment variables or configuration files for context 3. Include relevant files in your initial prompt text instead of @ mentions # Architecture Source: https://docs.entire.io/agents/external-agent-plugins/architecture How the Entire CLI discovers and communicates with external agent plugins External agent plugins are discovered through executable naming and `$PATH` lookup: 1. You create an executable named `entire-agent-` 2. Place it anywhere on your `$PATH` 3. The CLI discovers it at startup and registers it as a new agent The plugin communicates with the CLI through **subcommands** that read/write JSON over stdin/stdout. Each invocation is stateless. Every subcommand invocation receives these environment variables: | Variable | Description | | ------------------------- | ---------------------------------------- | | `ENTIRE_REPO_ROOT` | Absolute path to the git repository root | | `ENTIRE_PROTOCOL_VERSION` | Protocol version (currently `1`) | The working directory is always set to the repository root. The plugin follows these conventions: * **Output:** JSON on stdout (unless noted otherwise) * **Errors:** Non-zero exit code + message on stderr * **Stateless:** Each invocation is independent, no persistent connection # Build an Agent Plugin Source: https://docs.entire.io/agents/external-agent-plugins/build-agent-plugin Use the external-agents agent skill to add support for another coding agent Build an agent plugin when you want Entire to support a coding agent that is not built in yet. The [external-agents repository](https://github.com/entireio/external-agents) includes an agent skill that researches the target agent, scaffolds the binary, writes tests, and implements the protocol. The protocol is language-agnostic; this guide uses that Go-based repo and its skill. For the protocol itself, see [Architecture](/agents/external-agent-plugins/architecture), [Commands](/agents/external-agent-plugins/commands), [Lifecycle](/agents/external-agent-plugins/lifecycle), and [Data Model](/agents/external-agent-plugins/data-model). **Building a private or internal plugin?** This guide is the upstream-contribution path (it ends in a pull request to `external-agents`). For a plugin you won't contribute back, skip the issue and PR steps and follow the protocol reference above. ## Before you start Open an issue in [`entireio/external-agents`](https://github.com/entireio/external-agents) before writing code. Adding support for a new agent creates a long-term support commitment, so align with maintainers first. You need: * The target agent CLI installed and authenticated * [The Entire CLI installed](/installation) * [Go](https://go.dev/doc/install) and [mise](https://mise.jdx.dev/getting-started.html) * A target agent with lifecycle hooks or another reliable event mechanism * Readable session or transcript data * A stable session ID ## Clone the repo ```bash theme={null} git clone https://github.com/entireio/external-agents.git cd external-agents mise trust mise install ``` New integrations live under `agents/entire-agent-`. Each integration is a standalone binary named `entire-agent-`. ## Run the Agent Skill The repo includes an agent skill named `entire-external-agent`, and supported tools auto-discover it with no additional configuration. See the [repo instructions](https://github.com/entireio/external-agents?tab=readme-ov-file#getting-started--zero-setup) for the current supported tools. Run the skill: ```text theme={null} /entire-external-agent ``` When prompted, provide the target agent name and slug. ## What the Skill Does The skill runs three phases: | Phase | What happens | | ------------- | ------------------------------------------------------------------------------------------------ | | **Research** | Finds the target agent's hooks, session IDs, transcript storage, CLI commands, and capabilities. | | **Scaffold** | Creates the plugin structure, protocol stubs, and lifecycle test wiring. | | **Implement** | Uses compliance and lifecycle failures to implement the plugin and add tests. | You can also run a single phase when you need to restart or inspect part of the process. ```text theme={null} /entire-external-agent research /entire-external-agent write-tests /entire-external-agent implement ``` ## Reference examples The [external-agents repository](https://github.com/entireio/external-agents) contains working plugins you can inspect while building your own: | Plugin | Target agent | Notes | | ------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------- | | [`entire-agent-amp`](https://github.com/entireio/external-agents/tree/main/agents/entire-agent-amp) | Amp | Project plugin with transcript preparation, token calculation, and compact transcript support. | | [`entire-agent-goose`](https://github.com/entireio/external-agents/tree/main/agents/entire-agent-goose) | Goose | Project plugin that exports Goose sessions from SQLite-backed storage. | | [`entire-agent-kiro`](https://github.com/entireio/external-agents/tree/main/agents/entire-agent-kiro) | Kiro | Lifecycle hooks and transcript analysis for Kiro sessions. | For a minimal reference implementation outside the main examples repo, see [`roger-roger`](https://github.com/entireio/roger-roger). ## Review the output When the skill finishes, review: * `agents/entire-agent-/AGENT.md` * `agents/entire-agent-/README.md` * The declared capabilities * Protocol compliance results * Lifecycle test results * Any remaining gaps or local dependencies Treat captured hook payloads and transcript fixtures as ground truth. Documentation can drift. ## Verify locally Build the binary, put it on your `PATH`, and enable it in a test repository: ```bash theme={null} cd agents/entire-agent- mise run build export PATH="$PWD:$PATH" cd /path/to/test-repo entire enable --agent SLUG ``` Run the target agent and make a small file change. Then check that Entire captured the session: ```bash theme={null} entire status entire checkpoint list entire checkpoint explain CHECKPOINT_ID --short ``` Look for a checkpoint with the expected session, transcript, and modified files. ## Open the PR Reference the approved issue and include: * Agent name and binary name * Declared capabilities * Protocol compliance status * Lifecycle test status * Unit test coverage * Any local dependencies you could not test * Known limitations CI will build the agent and run the shared checks. # Commands Source: https://docs.entire.io/agents/external-agent-plugins/commands Required commands and optional capabilities for external agent plugins Every plugin must implement these subcommands. ## Required commands ### `info` Returns metadata and declares which optional capabilities your plugin supports. ```bash theme={null} entire-agent-myagent info ``` ```json theme={null} { "protocol_version": 1, "name": "myagent", "type": "MyAgent", "description": "MyAgent - AI-powered code editor", "is_preview": true, "protected_dirs": [".myagent"], "hook_names": ["session-start", "session-end", "stop"], "capabilities": { "hooks": true, "transcript_analyzer": true, "transcript_preparer": false, "token_calculator": false, "text_generator": false, "hook_response_writer": false, "subagent_aware_extractor": false } } ``` | Field | Description | | ------------------ | --------------------------------------------------------------------------- | | `protocol_version` | Must match the CLI's expected version (currently `1`) | | `name` | Registry name (must match the `` in the binary name) | | `type` | Display name / type identifier | | `description` | Human-readable description | | `is_preview` | Whether the agent is in preview | | `protected_dirs` | Directories the CLI should not modify (excluded from checkpoints and diffs) | | `hook_names` | Agent lifecycle hooks this plugin handles | | `capabilities` | Object declaring which optional capabilities are supported | ### `detect` Returns whether the agent is available in the current environment. Return `{"present": false}` if the agent's dependencies are not met — the CLI will skip enabling the agent. ```bash theme={null} entire-agent-myagent detect ``` ```json theme={null} {"present": true} ``` ### `get-session-id` Extracts a session ID from a hook input event. **stdin:** [HookInput](/agents/external-agent-plugins/data-model#hookinput) JSON ```json theme={null} {"session_id": "abc123"} ``` ### `get-session-dir --repo-path ` Returns where agent sessions are stored. ```json theme={null} {"session_dir": "/path/to/sessions"} ``` ### `resolve-session-file --session-dir --session-id ` Resolves the session file path from a session directory and ID. ```json theme={null} {"session_file": "/path/to/session/file.jsonl"} ``` ### `read-session` Reads session data from a hook input event. **stdin:** [HookInput](/agents/external-agent-plugins/data-model#hookinput) JSON **stdout:** [AgentSession](/agents/external-agent-plugins/data-model#agentsession) JSON ### `write-session` Persists session data to disk. The plugin is responsible for choosing the storage location and format. **stdin:** [AgentSession](/agents/external-agent-plugins/data-model#agentsession) JSON Exit `0` on success. ### `read-transcript --session-ref ` Reads a transcript file and returns its raw bytes on stdout. ### `chunk-transcript --max-size ` Splits a transcript (raw bytes on stdin) into chunks. ```json theme={null} {"chunks": ["", "..."]} ``` ### `reassemble-transcript` Reassembles chunks back into a transcript. Called during `entire checkpoint rewind` to reconstruct transcript data from stored chunks. **stdin:** ```json theme={null} {"chunks": ["", "..."]} ``` **stdout:** Raw transcript bytes. ### `format-resume-command --session-id ` Returns the command a user would run to resume a session. ```json theme={null} {"command": "myagent --resume abc123"} ``` ## Optional capabilities Set capabilities to `true` in your `info` response to enable these. The CLI will never call subcommands for capabilities you don't declare. ### `hooks` Manage agent lifecycle hooks for Entire integration. | Subcommand | Description | | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `parse-hook --hook ` | Parse a raw hook payload (stdin) into an [Event](/agents/external-agent-plugins/data-model#event). Return `null` if not relevant. | | `install-hooks [--local-dev] [--force]` | Install hooks. `--local-dev` installs hooks pointing to a local development build. `--force` overwrites existing hook files. Returns `{"hooks_installed": 3}`. | | `uninstall-hooks` | Remove installed hooks. Exit `0` on success. | | `are-hooks-installed` | Check hook status. Returns `{"installed": true}`. | ### `transcript_analyzer` Extract data from agent transcripts. | Subcommand | Description | | --------------------------------------------------- | ------------------------------------------------------ | | `get-transcript-position --path ` | Returns `{"position": 12345}` (byte offset). | | `extract-modified-files --path --offset ` | Returns `{"files": [...], "current_position": 12345}`. | | `extract-prompts --session-ref --offset ` | Returns `{"prompts": ["prompt text", ...]}`. | | `extract-summary --session-ref ` | Returns `{"summary": "...", "has_summary": true}`. | ### `transcript_preparer` | Subcommand | Description | | ----------------------------------------- | --------------------------------------------------- | | `prepare-transcript --session-ref ` | Pre-process a transcript file. Exit `0` on success. | ### `token_calculator` | Subcommand | Description | | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | `calculate-tokens --offset ` | Calculate token usage from transcript bytes (stdin). `--offset` is the byte offset into the transcript to start counting from. | Output: ```json theme={null} { "input_tokens": 1500, "output_tokens": 500, "cache_creation_tokens": 0, "cache_read_tokens": 200, "api_call_count": 3 } ``` Only `input_tokens` and `output_tokens` are required. Other fields default to `0`. ### `text_generator` | Subcommand | Description | | ------------------------------- | --------------------------------------------------------------- | | `generate-text --model ` | Generate text from a prompt (stdin). Returns `{"text": "..."}`. | ### `hook_response_writer` | Subcommand | Description | | ------------------------------------- | ----------------------------------------------------------- | | `write-hook-response --message ` | Write a message in the agent's native hook format (stdout). | ### `subagent_aware_extractor` For agents that spawn subagents. | Subcommand | Description | | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `extract-all-modified-files --offset --subagents-dir ` | Extract modified files from main + subagent transcripts (stdin: main transcript). Returns `{"files": [...]}`. | | `calculate-total-tokens --offset --subagents-dir ` | Calculate total tokens across main + subagent transcripts (stdin: main transcript). Same format as `calculate-tokens`, with optional `subagent_tokens` nested object. | # Data Model Source: https://docs.entire.io/agents/external-agent-plugins/data-model Data types exchanged between the Entire CLI and external agent plugins ## HookInput Passed via stdin to `get-session-id` and `read-session`. ```json theme={null} { "hook_type": "stop", "session_id": "abc123", "session_ref": "/path/to/transcript.jsonl", "timestamp": "2026-01-13T12:00:00Z", "user_prompt": "Fix the login bug", "tool_name": "Write", "tool_use_id": "toolu_abc123", "tool_input": {"path": "/src/main.go"}, "raw_data": {} } ``` | Field | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------------------------------------------------------------------- | | `hook_type` | string | Yes | `session_start`, `session_end`, `user_prompt_submit`, `stop`, `pre_tool_use`, `post_tool_use` | | `session_id` | string | Yes | Agent session identifier | | `session_ref` | string | Yes | Agent-specific session reference (typically a file path) | | `timestamp` | string | Yes | RFC 3339 timestamp | | `user_prompt` | string | No | User's prompt text | | `tool_name` | string | No | Tool name (from tool use hooks) | | `tool_use_id` | string | No | Tool invocation ID | | `tool_input` | object | No | Raw tool input JSON | | `raw_data` | object | No | Agent-specific extension data | ## AgentSession Used as input to `write-session` and output from `read-session`. ```json theme={null} { "session_id": "abc123", "agent_name": "myagent", "repo_path": "/path/to/repo", "session_ref": "/path/to/transcript.jsonl", "start_time": "2026-01-13T12:00:00Z", "native_data": null, "modified_files": ["src/main.go"], "new_files": [], "deleted_files": [] } ``` | Field | Type | Description | | ---------------- | ---------- | ----------------------------------------------- | | `session_id` | string | Agent session identifier | | `agent_name` | string | Agent registry name | | `repo_path` | string | Absolute path to the repository | | `session_ref` | string | Path to session in agent's storage | | `start_time` | string | RFC 3339 timestamp | | `native_data` | bytes/null | Opaque session content in agent's native format | | `modified_files` | string\[] | Files modified during the session | | `new_files` | string\[] | Files created during the session | | `deleted_files` | string\[] | Files deleted during the session | ## Event Returned by `parse-hook`. Represents a normalized lifecycle event. ```json theme={null} { "type": 3, "session_id": "abc123", "session_ref": "/path/to/transcript.jsonl", "prompt": "Fix the login bug", "model": "claude-sonnet-4-20250514", "timestamp": "2026-01-13T12:00:00Z" } ``` **Event types:** | Value | Name | Description | | ----- | ------------- | --------------------------------------------------------- | | 1 | SessionStart | Agent session has begun | | 2 | TurnStart | User submitted a prompt | | 3 | TurnEnd | Agent finished responding | | 4 | Compaction | Context window compression (triggers save + offset reset) | | 5 | SessionEnd | Session terminated | | 6 | SubagentStart | A subagent was spawned | | 7 | SubagentEnd | A subagent completed | **Optional event fields:** `previous_session_id`, `session_ref`, `prompt`, `model`, `timestamp`, `tool_use_id`, `subagent_id`, `tool_input`, `subagent_type`, `task_description`, `response_message`, `metadata`. Only `type` and `session_id` are required. # Lifecycle Source: https://docs.entire.io/agents/external-agent-plugins/lifecycle When the Entire CLI calls each external agent plugin command Understanding when each subcommand is called helps you build a correct integration. Here's the full sequence from the CLI's perspective. ## Phase 1: Discovery (CLI startup) Every time the CLI starts, it scans `$PATH` for binaries matching `entire-agent-`. 1. **`info`** — Called once per discovered binary. The CLI reads your metadata, validates the protocol version, and registers the agent. If this fails, the agent is silently skipped. ## Phase 2: Enable (`entire enable`) When a user enables your agent for a repository: 1. **`detect`** — Called to check whether your agent is available in the current environment. 2. **`install-hooks [--local-dev] [--force]`** — Called to install your hooks into the agent (e.g., writing hook config files). Only called if you declare the `hooks` capability. ## Phase 3: Agent session (hooks firing) Once enabled, your agent's hooks fire during normal usage and the CLI processes them. This phase requires the `hooks` capability — agents that don't declare it won't participate in the hook lifecycle. Every hook invocation follows this flow: ``` Hook fires → parse-hook → Event dispatched by type ``` 1. **`parse-hook --hook `** — Called on every hook invocation with the raw payload on stdin. Return a normalized [Event](/agents/external-agent-plugins/data-model#event), or `null` if the hook has no lifecycle significance (the CLI will do nothing). The CLI then routes the event by type: ### SessionStart (type 1) Fired when the agent begins a new session. 1. **`get-session-id`** — Extract the session ID from the hook input (stdin). 2. **`get-session-dir --repo-path `** — Return where sessions are stored. 3. **`resolve-session-file --session-dir --session-id `** — Resolve the session file path. 4. **`read-session`** — Read existing session data (stdin: [HookInput](/agents/external-agent-plugins/data-model#hookinput)). 5. **`write-session`** — Persist updated session data. 6. **`write-hook-response --message `** — *(optional, if `hook_response_writer` capability)* Write a startup message in your agent's native format. ### TurnStart (type 2) Fired when the user submits a new prompt. 1. **`extract-modified-files --path --offset `** — *(if `transcript_analyzer` capability)* Extract files changed since last checkpoint. 2. The CLI creates a git checkpoint of the current state. ### TurnEnd (type 3) Fired when the agent finishes responding. 1. **`prepare-transcript --session-ref `** — *(if `transcript_preparer` capability)* Pre-process the transcript. 2. **`read-transcript --session-ref `** — Read the raw transcript bytes. 3. **`chunk-transcript --max-size `** — Split large transcripts into storable chunks. 4. **`get-transcript-position --path `** — *(if `transcript_analyzer` capability)* Get the current byte offset. 5. **`extract-modified-files --path --offset `** — *(if `transcript_analyzer` capability)* Extract newly modified files. 6. **`calculate-tokens --offset `** — *(if `token_calculator` capability)* Calculate token usage. 7. The CLI stores a checkpoint in git history. ### Compaction (type 4) Fired when the agent compresses its context window. Follows the same flow as **TurnEnd** (save + reset offset). ### SessionEnd (type 5) Fired when the session terminates. The CLI creates a final checkpoint and cleans up session state. ### SubagentStart / SubagentEnd (types 6–7) Fired when the agent spawns or completes a subagent. If you declare the `subagent_aware_extractor` capability, the CLI calls: * **`extract-all-modified-files --offset --subagents-dir `** * **`calculate-total-tokens --offset --subagents-dir `** ## Phase 4: User commands Some CLI commands invoke your plugin outside the hook flow: | Command | Subcommands called | | -------------------------- | -------------------------------------------------------------------- | | `entire checkpoint rewind` | `read-transcript`, `reassemble-transcript`, `extract-modified-files` | | `entire status` | `get-transcript-position` | | `entire session resume` | `format-resume-command` | ## Phase 5: Disable (`entire disable --uninstall`) 1. **`uninstall-hooks`** — Called to remove your installed hooks. Only called if you declare the `hooks` capability. ## Error handling * **Timeout:** Each subcommand has a 30-second default timeout. * **Output limits:** Stdout and stderr are each capped at 10 MB. Be mindful of this when implementing `read-transcript` for large sessions. * **No retries:** The CLI does not retry failed subcommand calls. A non-zero exit code with a message on stderr is treated as a failure. * **Graceful degradation:** If `parse-hook` returns `null`, the CLI takes no action. If the repo has Entire disabled, hooks exit silently. # Overview Source: https://docs.entire.io/agents/external-agent-plugins/overview Build plugins that integrate third-party AI agents with the Entire CLI External agent plugins are standalone binaries that integrate any AI coding agent with the Entire CLI. The CLI discovers them automatically, with no changes to the main repository required. Plugins are arbitrary executables on your `$PATH` that receive repository paths and session data. Only install plugins you trust, as they have the same filesystem access as the CLI itself. When you select an external agent during `entire agent add` or `entire enable`, the `external_agents` setting is automatically enabled. If you install a new external agent binary after initial setup, you can enable discovery manually by adding `"external_agents": true` to your `.entire/settings.json` file, or by re-running `entire agent`. # Factory Source: https://docs.entire.io/agents/factory-droid Integrate Entire with Factory for AI coding session capture [Factory](https://factory.ai) is an AI-powered development agent. Entire integrates with Factory via its hook-based settings system, automatically capturing sessions and checkpoints. The Factory integration is in preview and may contain bugs. ## Prerequisites * [Entire CLI installed](/installation) * [Factory 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. The hooks track the full session lifecycle: 1. **Session Start** — fires when Factory 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 Factory exits, finalizing the session. 5. **Transcript Capture** — session transcript is read from Factory's JSONL log files. 6. **Session Storage** — data saved to the `entire/checkpoints/v1` branch. | 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 | **Nested session support.** When Factory 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 Factory session. See the [`checkpoint rewind` command reference](/cli-reference/checkpoint#checkpoint-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 [`session resume` command reference](/cli-reference/sessions#session-resume) for full flag documentation. **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`checkpoint explain` command reference](/cli-reference/checkpoint#checkpoint-explain) for full flag documentation. * The integration is in preview and may have rough edges. * Session detection relies on hook-based process detection. * Transcript capture depends on Factory writing JSONL session logs. **Commit at logical points.** Commit when you've made meaningful progress: ```bash theme={null} git add . git commit -m "Implement feature with Factory assistance" ``` **Check status regularly.** Monitor your session with `entire status`. ```bash theme={null} # 1. Enable Entire with Factory cd my-project entire agent add factoryai-droid # 2. Start Factory droid # 3. Work with Factory # 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 Factory" # 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. ## Troubleshooting 1. Ensure you're in an Entire-enabled repo: `entire status` 2. Verify Factory 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` 1. Checkpoints require file changes — ensure Factory is modifying files 2. Check your settings in `.entire/settings.json` 3. Verify the `.factory/settings.json` hooks are present 1. Ensure Factory's session storage exists at `~/.factory/sessions//` 2. Check that JSONL transcript files are being written 3. Look for errors in the Entire hook output # Gemini CLI Source: https://docs.entire.io/agents/gemini-cli Integrate Entire with Google's Gemini CLI Gemini CLI is Google's command-line interface for Gemini AI. Entire supports capturing sessions from Gemini CLI, tracking your AI-assisted coding interactions. The Gemini CLI integration is in preview and may contain bugs. ## Prerequisites * [Entire CLI installed](/installation) * [Gemini CLI](https://github.com/google/gemini-cli) installed * A Git repository with Entire enabled ## Enable ```bash theme={null} entire agent add gemini gemini ``` Entire integrates with Gemini CLI through Git hooks. When you start Gemini CLI in an Entire-enabled repository: 1. **Process Detection** — Entire detects when Gemini CLI is running. 2. **File Monitoring** — file changes are tracked during the session. 3. **Checkpoint Creation** — created when you or the agent make a Git commit. 4. **Session Storage** — data saved to the `entire/checkpoints/v1` branch. The session ends when Gemini CLI exits. | Data | Description | | ------------------ | ------------------------------------- | | File changes | All files modified during the session | | Timestamps | Session and checkpoint timing | | Session boundaries | Start and end of Gemini sessions | | Checkpoints | Rewind points within sessions | **Rewind during sessions.** Use `entire checkpoint rewind` to restore to a previous checkpoint during or after a Gemini CLI session. See the [`checkpoint rewind` command reference](/cli-reference/checkpoint#checkpoint-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 command to resume the session. See the [`session resume` command reference](/cli-reference/sessions#session-resume) for full flag documentation. **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`checkpoint explain` command reference](/cli-reference/checkpoint#checkpoint-explain) for full flag documentation. * Conversation transcripts may not be captured depending on Gemini CLI version. * Session detection relies on process monitoring rather than dedicated lifecycle hooks. * Token usage is not tracked. * Works best when you commit at logical stopping points, or tell the agent to handle committing. **Commit at logical points.** Commit when you've made meaningful progress: ```bash theme={null} git add . git commit -m "Implement feature with Gemini assistance" ``` **Check status regularly.** Monitor your session with `entire status`. ```bash theme={null} # 1. Setup cd my-project entire agent add gemini # 2. Start Gemini CLI gemini # 3. Work with Gemini # 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 Gemini" # 7. Push git push ``` ## Troubleshooting 1. Ensure you're in an Entire-enabled repo: `entire status` 2. Verify Gemini CLI is running from within the repository 3. Check Git hooks are installed: `ls .git/hooks` 1. Checkpoints require file changes 2. Make sure Gemini is modifying files in the repository 3. Check your settings in `.entire/settings.json` # OpenCode Source: https://docs.entire.io/agents/opencode Integrate Entire with OpenCode for AI coding session capture OpenCode is an AI-powered terminal coding agent. Entire integrates with OpenCode via its plugin system, automatically capturing sessions and checkpoints. The OpenCode integration is in preview and may contain bugs. ## Prerequisites * [Entire CLI installed](/installation) * [OpenCode](https://github.com/anomalyco/opencode) installed * A Git repository with Entire enabled ## Enable ```bash theme={null} entire agent add opencode opencode ``` `entire agent add opencode` installs a TypeScript plugin that hooks into OpenCode's event system. The plugin communicates with Entire via hooks: 1. **Session Detection** — the plugin fires on `session.created` events. 2. **Turn Tracking** — each user prompt triggers `turn-start`; when the agent goes idle, `turn-end` fires. 3. **Transcript Export** — on `turn-end`, Entire calls `opencode export` to capture the full transcript. 4. **Checkpoint Creation** — checkpoints are created based on your strategy. 5. **Session Storage** — data saved to the `entire/checkpoints/v1` branch. | Data | Description | | ------------ | ----------------------------------------------- | | Conversation | Full transcript of prompts and responses | | File changes | Files modified via edit, write, and patch tools | | Tool calls | Tool invocations with inputs and outputs | | Token usage | Input, output, reasoning, and cache tokens | | Timestamps | Session, message, and checkpoint timing | **Rewind during sessions.** Use `entire checkpoint rewind` to restore to a previous checkpoint during or after an OpenCode session. When you rewind, Entire reimports the checkpoint-state transcript into OpenCode's database so you can continue seamlessly. See the [`checkpoint rewind` command reference](/cli-reference/checkpoint#checkpoint-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 `opencode -s SESSION_ID`. See the [`session resume` command reference](/cli-reference/sessions#session-resume) for full flag documentation. **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`checkpoint explain` command reference](/cli-reference/checkpoint#checkpoint-explain) for full flag documentation. **Mid-turn commits.** When OpenCode commits during a turn (before the turn ends), Entire captures a checkpoint for that commit. The transcript is fetched on-demand via `opencode export` so the checkpoint includes the latest agent activity. * The integration is in preview and may have rough edges. * Plugin requires Bun runtime (used by OpenCode's plugin system). * Session detection relies on OpenCode's event system. * Works best with the manual-commit strategy. **Use the manual-commit strategy.** For terminal AI tools like OpenCode: ```bash theme={null} entire agent add opencode ``` **Commit when you've made meaningful progress:** ```bash theme={null} git add . git commit -m "Implement feature with OpenCode" ``` ```bash theme={null} # 1. Enable Entire with OpenCode cd my-project entire agent add opencode # 2. Start OpenCode opencode # 3. Work with OpenCode # Ask it to write code, make changes, etc. # 4. Rewind if needed entire checkpoint rewind # 5. Commit when ready git add . git commit -m "Add feature with OpenCode" # 6. 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. ## Troubleshooting 1. Ensure you're in an Entire-enabled repo: `entire status` 2. Verify OpenCode is running from within the repository 3. Check that the plugin is installed: look for the Entire plugin in your OpenCode config 4. Check Git hooks are installed: `ls .git/hooks` 1. Checkpoints require file changes — ensure OpenCode is modifying files 2. Check your strategy settings in `.entire/settings.json` 3. Verify `opencode export` works: `opencode export ` 1. The plugin calls `opencode export` to fetch transcripts — ensure this command works 2. Check that the `.opencode` directory exists in your repository 3. Look for errors in the Entire hook output: run `entire hooks opencode turn-end` manually # Overview Source: https://docs.entire.io/agents/overview Set up Entire with your AI coding agent — supported integrations and how to add your own Entire integrates with AI coding agents by installing lifecycle hooks that capture each session and link it to your Git history. When you commit, Entire writes a checkpoint with the full transcript, file changes, tokens, and tool calls to the `entire/checkpoints/v1` branch — no extra commits on your working branch. The default agent is Claude Code. To choose a different one, run `entire agent add NAME`. ## Built-in agents * **[Claude Code](/agents/claude-code)** — Stable · `--agent claude-code`. Full feature support including nested subagent capture. * **[Codex](/agents/codex)** — Stable · `--agent codex`. Native hook system; main session capture (no subagent hooks yet). * **[Copilot CLI](/agents/copilot-cli)** — Stable · `--agent copilot-cli`. Native hooks; token usage available post-session. * **[Cursor](/agents/cursor)** — Stable · `--agent cursor`. IDE and CLI. Rewind and resume are not available. * **[Factory](/agents/factory-droid)** — Stable · `--agent factoryai-droid`. Subagent-aware capture via `pre-tool-use` and `post-tool-use` hooks. * **[Gemini CLI](/agents/gemini-cli)** — Stable · `--agent gemini`. File changes captured; conversation transcript and token tracking are limited. * **[OpenCode](/agents/opencode)** — Stable · `--agent opencode`. TypeScript plugin integration; supports mid-turn commits. * **[Pi](/agents/pi)** — Preview · `--agent pi`. TypeScript extension integration with JSONL transcript and token capture.