🧠 Automatic Entire CLI monitoring for OpenCode, Claude Code, Cursor, and Codex - Never lose session context again
OpenCode Auto-Entire is a plugin and MCP server that automatically checks if Entire CLI is enabled when you start an AI coding session. If not, it prompts you with clear instructions to fix it. It also monitors your complete memory management stack including Claude-Mem and RTK.
Without Entire CLI enabled:
- ❌ Session crashes = lost context and work
- ❌ No checkpoint recovery
- ❌ No audit trail of agent decisions
With OpenCode Auto-Entire:
- ✅ Automatically detects missing Entire on session start
- ✅ Prompts with actionable fix instructions
- ✅ Monitors full memory stack (Entire + Claude-Mem + RTK)
- ✅ Configurable behavior (prompt / auto-init / silent)
- ✅ Works with OpenCode, Claude Code, Cursor, and Codex
# Clone the repository
git clone https://github.com/yourusername/opencode-auto-entire.git
cd opencode-auto-entire
# Run the installer
./scripts/install.sh# Clone the repository
git clone https://github.com/yourusername/opencode-auto-entire.git
cd opencode-auto-entire
# Run the Claude Code installer
./scripts/install-claude.sh
# Restart Claude Code
# Then open any git project and you can use MCP tools✨ Cursor has native MCP support - no configuration needed!
# Clone the repository
git clone https://github.com/yourusername/opencode-auto-entire.git
cd opencode-auto-entire
# Run the installer (includes MCP setup)
./scripts/install-claude.shConfigure in Cursor (2 options):
Option 1: Via Cursor UI (Recommended)
- Open Cursor
- Press
Cmd+Shift+P - Type "MCP" to open MCP management
- Click "Add New Server"
- Enter:
{ "command": "node", "args": ["/Users/YOUR_USERNAME/.claude/plugins/opencode-auto-entire/src/claude-code.ts"] } - Click "Connect"
Option 2: Via Cursor CLI
# List MCP servers
agent mcp list
# Check tools
agent mcp list-tools auto-entire
# Login (if needed)
agent mcp login auto-entireThat's it! Cursor's agent will automatically use MCP tools when helpful.
See Cursor Setup Guide for detailed usage and troubleshooting.
⭐ Automatic Checking (Recommended):
For the same automatic behavior as OpenCode, use the wrapper script:
# Add alias to ~/.bashrc or ~/.zshrc
alias claude='~/.claude/plugins/opencode-auto-entire/scripts/claude-wrapper.sh'
# Reload shell
source ~/.bashrc
# Use claude normally - it will automatically check your memory stack!
claudeSee docs/CLAUDE_WRAPPER.md for full documentation.
Codex CLI supports three integration methods:
Option 1: Codex Skill (Recommended for Auto-Invoke)
# Install skill globally
mkdir -p ~/.agents/skills/
cp -r .agents/skills/auto-entire ~/.agents/skills/Codex auto-invokes the skill based on your prompts! Just start coding normally.
Option 2: MCP Server
# Install for Codex
mkdir -p ~/.codex/plugins/
cp -r . ~/.codex/plugins/opencode-auto-entire
cd ~/.codex/plugins/opencode-auto-entire
npm installAdd to ~/.codex/config.toml:
[mcp_servers.auto-entire]
command = "node"
args = ["/Users/YOUR_USERNAME/.codex/plugins/opencode-auto-entire/src/claude-code.ts"]Option 3: Wrapper Script (True Automatic)
# Add alias to ~/.bashrc or ~/.zshrc
alias codex='~/.codex/plugins/opencode-auto-entire/scripts/codex-wrapper.sh'
# Reload shell
source ~/.bashrc
# Use codex normally - automatic checking!
codexSee Codex Setup Guide for detailed usage instructions.
| Platform | OpenCode | Claude Code | Cursor | Codex |
|---|---|---|---|---|
| macOS | ✅ One-command install | ✅ One-command install | ✅ MCP UI setup | ✅ Skill + MCP |
| Linux | ✅ One-command install | ✅ One-command install | ✅ MCP UI setup | ✅ Skill + MCP |
| Windows | ✅ PowerShell script | ❌ Coming soon | ❌ Coming soon | |
| Setup | opencode.json |
claude-code.example.json |
Settings → MCP | codex.example.toml |
| Platform | Auto-Invoke Method | Lifecycle Events | Best For |
|---|---|---|---|
| OpenCode | Plugin event hook | ✅ session.created | Automatic checking |
| Codex Skill | Description matching | ❌ None | Prompt-based auto-invoke |
| Claude Code | Manual tool invocation | ❌ None | On-demand tools |
| Cursor MCP | Auto-invoke when helpful | ❌ None | Smart auto-invoke |
You have two options for using OpenCode Auto-Entire with Claude Code:
What it does:
- ✅ Automatically checks memory stack BEFORE launching Claude Code
- ✅ Displays status with the same formatting as OpenCode
- ✅ Prompts you with instructions if Entire is missing
- ✅ Supports auto-init mode to automatically enable Entire
- ✅ Works exactly like OpenCode plugin (automatic on every launch)
Setup:
# Add alias to ~/.bashrc or ~/.zshrc
alias claude='~/.claude/plugins/opencode-auto-entire/scripts/claude-wrapper.sh'
# Reload shell
source ~/.bashrc
# Now use claude normally - automatic checking!
claudePros:
- ✅ Same automatic behavior as OpenCode
- ✅ Simple one-time setup
- ✅ No need to remember to run tools
- ✅ Works for both new and existing Claude Code sessions
Cons:
⚠️ Requires alias setup⚠️ Needs to add wrapper to PATH if using custom installation location
What it does:
- ✅ Provides
check_memory_stacktool to check status anytime - ✅ Provides
enable_entiretool to auto-initialize Entire - ✅ Tools available during Claude Code conversations
- ✅ No automatic checking (MCP servers are passive)
Setup:
# Follow installation instructions above
# Already configured in ~/.claude/settings.jsonUsage in Claude Code:
User: Check memory stack with auto-entire
Claude: [runs tool, shows status]
User: Enable Entire with auto-entire
Claude: [auto-initializes Entire]
Pros:
- ✅ Tools available during any conversation
- ✅ No alias setup required
- ✅ Standard MCP integration
Cons:
⚠️ No automatic checking (must manually invoke tools)⚠️ Must remember to run tools each time
| Scenario | Recommended Option |
|---|---|
| Automatic checking wanted | Wrapper Script |
| On-demand tools preferred | MCP Server |
| Can't use aliases | MCP Server |
| Standard workflow | MCP Server |
| Same experience as OpenCode | Wrapper Script |
Recommendation: Use the wrapper script for automatic checking. Keep the MCP server installed for on-demand tools during conversations.
# Clone the repository
git clone https://github.com/yourusername/opencode-auto-entire.git
cd opencode-auto-entire
# Run the installer
.\scripts\install.ps1-
Install Entire CLI:
# macOS brew tap entireio/tap brew install entireio/tap/entire # Linux (various methods) # See: https://github.com/entireio/cli#installation
-
Copy plugin:
# For OpenCode mkdir -p ~/.config/opencode/plugins/ cp -r . ~/.config/opencode/plugins/opencode-auto-entire cd ~/.config/opencode/plugins/opencode-auto-entire npm install # For Claude Code mkdir -p ~/.claude/plugins/ cp -r . ~/.claude/plugins/opencode-auto-entire cd ~/.claude/plugins/opencode-auto-entire npm install
-
Configure:
# For OpenCode - add to ~/.config/opencode/opencode.json { "plugin": [ "file:///Users/YOUR_USERNAME/.config/opencode/plugins/opencode-auto-entire/src/plugin.ts" ] } # For Claude Code - add MCP server to ~/.claude/settings.json { "mcpServers": { "auto-entire": { "command": "node", "args": ["/Users/YOUR_USERNAME/.claude/plugins/opencode-auto-entire/src/claude-code.ts"] } } }
-
Restart your AI coding tool (OpenCode or Claude Code)
On every session start in a git repository:
OpenCode:
- ✅ Automatically checks for Entire CLI on session start
- ✅ Displays memory stack status (Entire + Claude-Mem + RTK)
- ✅ Prompts with instructions if Entire is not enabled
- ✅ Supports auto-init mode for automatic setup
Claude Code:
- ✅ Provides MCP tools for memory stack checks
- ✅ Use "Check memory stack with auto-entire" to see status
- ✅ Use "Enable Entire with auto-entire" to auto-initialize
- ✅ Manual tools available anytime via Claude Code's MCP interface
Cursor IDE:
- ✅ Native MCP support - no configuration needed!
- ✅ Cursor's agent automatically uses MCP tools when helpful in conversations
- ✅ Provides same memory stack checking as OpenCode and Claude Code
- ✅ Zero setup complexity - just install and connect
Codex CLI:
- ✅ Skill auto-invokes based on prompt matching
- ✅ MCP server provides on-demand tools
- ✅ Wrapper script provides true automatic checking
- ✅ Three flexible integration options
Configuration works for OpenCode, Claude Code, Cursor IDE, and Codex CLI:
Create ~/.config/opencode/entire-check.json, ~/.claude/entire-check.json, or ~/.codex/entire-check.json:
{
"enabled": true,
"mode": "prompt",
"checkGitRepo": true,
"showStatus": true
}| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable/disable the plugin |
mode |
"prompt" | "auto-init" | "silent" |
"prompt" |
Behavior when Entire not enabled |
checkGitRepo |
boolean | true |
Only check in git repositories |
showStatus |
boolean | true |
Show status even when Entire is enabled |
prompt (default): Shows a friendly reminder with instructions:
Memory Management Check
Entire CLI: Not initialized
Run: `entire enable --strategy auto-commit`
Claude-Mem: Active
RTK: Active (91.7% efficiency)
Why this matters:
• Entire = Session checkpoint/recovery (crash protection)
• Claude-Mem = Cross-session memory (context persistence)
• RTK = Token optimization (60-90% savings)
Enable Entire to prevent context loss on crashes.
auto-init:
Automatically runs entire enable --strategy auto-commit without asking.
silent: Only logs to console, no UI notification.
After installation, simply start OpenCode in any git repository:
cd your-project
opencodeYou'll see the memory stack check at session start.
When Entire is Not Enabled:
cd your-project
entire enable --strategy auto-commitAfter installation, start Claude Code in any git repository:
cd your-project
claudeThe MCP server provides two tools:
- Check memory stack with auto-entire - Shows status of Entire, Claude-Mem, and RTK
- Enable Entire with auto-entire - Auto-initializes Entire in current directory
When Entire is Not Enabled: You can either:
- Enable manually:
entire enable --strategy auto-commit - Use the MCP tool: "Enable Entire with auto-entire"
After installation, you have three options:
Option 1: Skill (Auto-Invoke) Just start coding normally. Codex auto-invokes the skill when your prompt matches:
User: I need to work on the auth module
Codex: [Auto-invokes auto-entire skill]
🧠 Memory Stack Status
✅ Entire CLI: Enabled
✅ Claude-Mem: Active
✅ RTK: Active (91.7% efficiency)
All systems operational.
Codex: Great! Let's work on the auth module...
Option 2: MCP Server Codex's agent automatically uses MCP tools when helpful:
User: Check my memory stack
Codex: [Uses MCP tool]
🧠 Memory Stack Status
✅ Entire CLI: Enabled
✅ Claude-Mem: Active
✅ RTK: Active (89.3% efficiency)
All systems operational.
Option 3: Wrapper Script (Automatic) If you set up the alias, memory stack checks run automatically:
codex # Wrapper checks memory stack before launchingYou'll see:
Memory Stack Status
Entire CLI: Enabled
Claude-Mem: Active
RTK: Active (91.7% efficiency)
All systems operational.
| Platform | OpenCode Install | Claude Code Install | Claude Code MCP UI | Claude Code Wrapper | Cursor | Codex | Entire CLI |
|---|---|---|---|---|---|---|---|
| macOS | ✅ One-command install | ✅ One-command install | ✅ Built-in MCP | ✅ Script + alias | ✅ MCP UI | ✅ Skill + MCP | ✅ Homebrew |
| Linux | ✅ One-command install | ✅ One-command install | ✅ Built-in MCP | ✅ Script + alias | ✅ MCP UI | ✅ Skill + MCP | ✅ Binary releases |
| Windows | ✅ PowerShell script | ❌ Coming soon | ❌ Coming soon | ❌ Coming soon | |||
| WSL | ✅ Use Linux script | ✅ Use Linux script | ✅ Script + alias | ✅ Binary releases | ✅ MCP UI | ✅ Skill + MCP | ✅ Binary releases |
OpenCode Plugin:
Session Start
│
├──► Entire Check Plugin ──► Verify memory stack health
│ ├──► Entire enabled? ──► ✅ Continue / ⚠️ Prompt user
│ ├──► Claude-Mem active? ──► ✅ Continue / ❌ Warn
│ └──► RTK installed? ──► ✅ Continue / ❌ Note
Claude Code MCP Server:
Claude Code
│
└──► MCP Server (auto-entire) ──► Provides tools
├──► check_memory_stack
└──► enable_entire
Cursor IDE MCP Client:
Cursor IDE
│
└──► MCP Client ──► Auto-discovers MCP servers
└──► Auto-invokes tools when helpful
├──► check_memory_stack
└──► enable_entire
Codex CLI Skill:
Codex CLI
│
└──► Skill System ──► Auto-invokes based on prompt matching
└──► auto-entire skill
├──► Check memory on prompt match
└──► Auto-initialize Entire (optional)
Codex CLI MCP Server:
Codex CLI
│
└──► MCP Server (auto-entire) ──► Provides tools
├──► check_memory_stack ──► Check status
└──► enable_entire ──► Auto-initialize
Codex CLI Wrapper (Automatic):
codex command
│
└──► Wrapper script ──► Run check BEFORE launching Codex
└──► Display memory stack status
Session Start
│
├──► Entire Check Plugin ──► Verify memory stack health
│ ├──► Entire enabled? ──► ✅ Continue /
**Claude Code MCP Server:**
Claude Code │ ├──► MCP Server (auto-entire) ──► Provides tools │ ├──► check_memory_stack ──► Check status │ └──► enable_entire ──► Auto-initialize │ └──► Tool invocation ──► On-demand checks
## Requirements
- **OpenCode** with plugin support OR **Claude Code** with MCP support OR **Cursor IDE** with native MCP support
- Node.js 18+ and npm
- Git (for repository detection)
- **Required:** [Entire CLI](https://github.com/entireio/cli) (session persistence and checkpoint recovery)
- **Optional:** [Claude-Mem](https://github.com/thedotmack/claude-mem) (cross-session memory for context persistence)
- **Optional:** [RTK](https://github.com/rtk-ai/rtk) (token optimization for 60-90% savings)
## Troubleshooting
### Plugin Not Activating
**For OpenCode:**
1. Verify plugin path in `opencode.json`:
```bash
cat ~/.config/opencode/opencode.json
```
2. Check that files exist:
```bash
ls ~/.config/opencode/plugins/opencode-auto-entire/src/
```
3. Restart OpenCode completely
**For Claude Code:**
1. Verify MCP server configuration in `settings.json`:
```bash
cat ~/.claude/settings.json
```
2. Check that files exist:
```bash
ls ~/.claude/plugins/opencode-auto-entire/src/
```
3. Restart Claude Code completely
### "Cannot find module" Error
Make sure you ran `npm install` in the plugin directory:
```bash
# For OpenCode
cd ~/.config/opencode/plugins/opencode-auto-entire
npm install
# For Claude Code
cd ~/.claude/plugins/opencode-auto-entire
npm install
The plugin checks for .entire/settings.json in your project root. If you've enabled Entire but the plugin still says it's not enabled:
# Verify Entire is enabled
entire status
# Check if .entire directory exists
ls -la .entire/Create ~/.config/opencode/entire-check.json:
{
"mode": "silent"
}- Entire CLI - Session persistence and checkpoint recovery
- Claude-Mem - Cross-session memory for Claude Code
- RTK - Token optimization for AI workflows
- Superpowers - Workflow patterns for AI agents
Contributions welcome! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
- Built for the OpenCode ecosystem
- Inspired by the need for better session management in AI-assisted development
- Thanks to the Entire CLI team for making session persistence possible
Note: This plugin was originally created as a personal tool and extracted into a standalone project for broader use.