Skip to main content
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

How It Works

Entire integrates with OpenCode through a TypeScript plugin that hooks into OpenCode’s event system. When you enable Entire with the OpenCode agent, the plugin is installed automatically:
entire enable --agent opencode
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

Captured Data

DataDescription
ConversationFull transcript of prompts and responses
File changesFiles modified via edit, write, and patch tools
Tool callsTool invocations with inputs and outputs
Token usageInput, output, reasoning, and cache tokens
TimestampsSession, message, and checkpoint timing

Features

Rewind Support

Rewind to previous checkpoints during or after a session:
# Interactive mode
entire rewind

# Or rewind to a specific checkpoint
entire rewind --to <checkpoint-id>

# List available rewind points
entire rewind --list
FlagDescription
--to <commit>Rewind to specific commit ID (non-interactive)
--listList available rewind points (JSON output)
--logs-onlyOnly restore logs, don’t modify working directory
--resetReset branch to commit (destructive)
When you rewind, Entire reimports the checkpoint-state transcript into OpenCode’s database so you can continue seamlessly.

Resume Previous Sessions

Resume a previous OpenCode session by switching to its branch:
entire resume <branch>
This command:
  1. Checks out the specified branch
  2. Finds the session ID from commits unique to this branch
  3. Restores the session log if it doesn’t exist locally
  4. Shows the command to resume the session (e.g., opencode -s <session-id>)
FlagDescription
-f, --forceResume from older checkpoint without confirmation

Explain Commits

View or generate explanations of how code was written:
# Explain a specific commit
entire explain --commit abc1234

# Explain a specific checkpoint
entire explain --checkpoint a3b2c4d5

# Show full transcript
entire explain --full
FlagDescription
-c, --checkpoint <id>Explain a specific checkpoint (ID or prefix)
--commit <sha>Explain a specific commit (SHA or ref)
--fullShow full parsed transcript (all prompts/responses)
-s, --shortShow summary only (omit prompts and files)

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.

Best Practices

Use Manual Commit Strategy

For terminal AI tools like OpenCode:
entire enable --agent opencode --strategy manual-commit
Commit when you’ve made meaningful progress:
git add .
git commit -m "Implement feature with OpenCode"

Example Workflow

# 1. Enable Entire with OpenCode
cd my-project
entire enable --agent opencode

# 2. Start OpenCode
opencode

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

# 4. Rewind if needed
entire 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 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 <session-id>
  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

Limitations

  • 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