Claude Code
Claude Code is the primary integration target for CCE. Setup creates MCP configuration, an instruction file, session hooks, and memory capture hooks.
Quick setup
Section titled “Quick setup”cce init --agent claudeThis creates or updates the following files in your project root.
Files created
Section titled “Files created”.mcp.json
Section titled “.mcp.json”Registers the CCE MCP server so Claude Code can call tools like context_search.
{ "mcpServers": { "context-engine": { "command": "cce", "args": ["serve", "--project-dir", "/path/to/your/project"] } }}CLAUDE.md
Section titled “CLAUDE.md”Contains instructions telling Claude to use context_search for code questions instead of reading files directly. The CCE block is wrapped in markers:
<!-- CCE:BEGIN -->...instructions...<!-- CCE:END -->You can add your own content above or below the markers. CCE will only update the section between them during upgrades.
Session hooks
Section titled “Session hooks”CCE installs a SessionStart hook that prints a one-line status summary at the beginning of each Claude Code session:
CCE v0.4.23 · my-project · 1247 chunks indexed · 94% saved over 42 queries ($11.20 saved)USE context_search MCP tool for all code questions. Do NOT use Read/Grep to explore code.This reminds Claude to use CCE from the very first message.
Memory hooks
Section titled “Memory hooks”5 lifecycle hooks capture session context automatically:
- SessionStart prints the resume block (prior decisions, last session rollup, savings)
- UserPromptSubmit records each prompt
- PostToolUse captures tool calls and results
- Stop marks the turn complete, queues compression
- SessionEnd marks the session complete, queues rollup
These are stored in memory.db and surfaced in subsequent sessions via session_recall. The dashboard “Sessions” view shows all captured data.
Git hooks
Section titled “Git hooks”Three git hooks keep the index fresh:
post-commitrunscce indexafter each commitpost-checkoutrunscce indexafter branch switchespost-mergerunscce indexafter merges
Each hook contains a CCE marker comment so cce uninstall can cleanly remove them.
Verify it’s working
Section titled “Verify it’s working”After restarting Claude Code, check that CCE tools are available:
> What tools do you have from context-engine?Claude should list context_search, expand_chunk, related_context, session_recall, etc.
Then ask a question about your code:
> How does the auth flow work?Claude should use context_search instead of reading files. Check savings:
cce savingsTroubleshooting
Section titled “Troubleshooting””No MCP tools found”
Section titled “”No MCP tools found””Claude Code needs a restart after cce init. Close and reopen your terminal, or run /mcp in Claude Code to check registered servers.
Tools available but Claude doesn’t use them
Section titled “Tools available but Claude doesn’t use them”Check that CLAUDE.md contains the CCE instructions block. Open it and look for the ## Context Engine (CCE) section. If missing, re-run cce init.
”cce: command not found” in MCP logs
Section titled “”cce: command not found” in MCP logs”The cce binary must be on your PATH. If you installed with uv tool install, it’s at ~/.local/bin/cce. Add ~/.local/bin to your PATH if not already there.
Windows: encoding errors
Section titled “Windows: encoding errors”If you see UnicodeDecodeError on Windows, upgrade to v0.4.24+ which adds explicit UTF-8 encoding to all file operations.
Memory hooks not capturing
Section titled “Memory hooks not capturing”Run cce sessions status to check if the hook server is reachable. If it says “not active,” start cce serve in a separate terminal or verify the hooks are installed with cat .claude/settings.json | grep cce_hook.