feat(install): cross-IDE installers — Cursor, Gemini CLI, OpenCode, Codex
Summary
Today `cce init` installs hooks only for Claude Code (writes to
`
The memory.db, MCP server, and HTTP capture loop are all host-agnostic already — only the hook-installer + settings-writer need IDE-specific variants.
Motivation
A user who hops between Claude Code (terminal) and Cursor (IDE) currently has to rebuild project memory in each tool. With per-IDE installers sharing the same per-project memory.db, "decisions you made last week" are visible regardless of which host you're sitting in today.
This also unblocks the positioning: "cce is the only platform with code search + memory across every major AI coding host."
Scope — one sub-task per IDE
Each host has its own hook-config schema, settings location, and trigger names. The per-IDE installer should follow the existing `hook_installer.install_settings` pattern: idempotent, preserves user hooks, marker-based uninstall.
- [ ] Cursor — `.cursor/rules/cce-memory.mdc` (or whichever hooks mechanism Cursor 3.x exposes; investigate first). Trigger: chat submit / agent-step. Some research needed to confirm what Cursor passes to a hook.
- [ ] Gemini CLI — `~/.gemini/...` or per-project; check Gemini CLI's hook spec.
- [ ] OpenCode — its YAML/TOML hook config; map our 5 lifecycle events onto OpenCode's nearest equivalents.
- [ ] Codex — investigate the OpenAI Codex CLI hook surface.
For each:
- Write a hook script wrapper if the host's payload shape differs from
Claude Code's JSON-on-stdin contract. Convert to our canonical shape
before POSTing to `/hooks/
`. - Add `cce init --host
` flag (or auto-detect by scanning the project for `.cursor/`, `.gemini/`, `.opencode/`, etc.). - Update the CLAUDE.md template (rename or per-host variants) so each host's agent gets the right "call session_recall before answering" instruction.
Acceptance criteria
- [ ] `cce init` detects which AI host(s) are configured for the project and installs hooks for each.
- [ ] `cce sessions status` reports which hosts are wired (per `<storage_base>/hosts.json` or similar).
- [ ] At least one end-to-end live test per host: install → start a session → record a decision → restart → resume context appears.
- [ ] `cce uninstall` cleanly removes all installed host hooks; matches cavemem's behaviour (uninstall doesn't clobber user hooks added to the same files).
- [ ] One implementation PR per host — don't bundle. Easier to land, easier to revert per-host if something breaks.
Open questions to research before each sub-task
- Does the host capture hook stdout the way Claude Code does? If yes, the SessionStart resume injection (#7's `a2a1061`) works as-is. If no, we need an alternative mechanism (e.g. a special MCP "ambient context" tool the agent is instructed to call first).
- What's the canonical session_id provided by the host? Some hosts may not have a stable one across runs.
- Hook latency budget per host — does the host kill slow hooks?
Reference
- cavemem installers (5 hosts, same memory store): https://github.com/JuliusBrussee/cavemem/tree/main/packages/installers
- Comparison that surfaced the idea: PR #7 thread
Suggested order
- Cursor first — biggest user base, most direct pull on positioning.
- Codex / OpenCode in parallel — smaller surface, faster to ship.
- Gemini CLI — least urgent, do last.
The installer path is useful, but the thing teams hit right after install is whether the runtime contracts survive the move between tools.
The portable pieces are usually not just prompts and MCP endpoints. They’re the operational fields around the run: budget state, halt reason, approval requirement, verifier status, and whether the session can safely resume. If those are preserved, the IDE/tool migration feels clean. If they are not, the migration works technically but breaks operator trust.
That control-plane seam has been one of the most useful things we’ve learned while building MartinLoop around coding-agent workflows.
Thanks for the perspective, though CCE focuses on code retrieval rather than runtime orchestration.