Skip to content

Claude Code

Claude Code is the primary integration target for CCE. Setup creates MCP configuration, an instruction file, session hooks, and memory capture hooks.

Terminal window
cce init --agent claude

This creates or updates the following files in your project root.

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"]
}
}
}

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.

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.

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.

Three git hooks keep the index fresh:

  • post-commit runs cce index after each commit
  • post-checkout runs cce index after branch switches
  • post-merge runs cce index after merges

Each hook contains a CCE marker comment so cce uninstall can cleanly remove them.

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:

Terminal window
cce savings

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.

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.

If you see UnicodeDecodeError on Windows, upgrade to v0.4.24+ which adds explicit UTF-8 encoding to all file operations.

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.