Reduce Claude Code token usage by 70-90% with cross-session memory and four-layer optimization: semantic codebase indexing, PostToolUse tool compression, turn summarization, and session consolidation. MCP server powered by Ollama — zero API calls, runs entirely on your machine.
Server has 11 tools with complete input schemas and descriptions. Naming follows verb_noun convention (get_, record_, flush_, trigger_, compress_). Descriptions are substantive (100-200 chars typical), explaining WHAT and WHEN. However, parameter descriptions are sparse or missing for several tools. Output schemas are not documented in the visible code. Error handling is minimal, no recovery guidance or actionable error messages. Tool composition is reasonable but some tools lack clarity on prerequisites and dependencies.
Compress the raw output of a tool call to its essential content. Dispatches by tool_type: bash/grep/test_runner/list_dir use deterministic rules (instant), read_file uses the codebase index cache when current, web/large file reads use the local LLM.
Flush the current session: summarize all recorded turns, consolidate with prior sessions, and reset for a fresh context window.
Retrieve a semantic map of the entire codebase using the file index. Returns purpose, exports, and key imports for each file, ordered by relevance to the current task.
Retrieve compression statistics for the current session: total tokens saved, per-tool breakdown, and compression strategy distribution.
Retrieve the cached semantic summary for a single file: purpose, exports, key imports, side effects, and notes. Uses the codebase index.
Report the last index run, total indexed files, and how many files have changed since the last run.
Output schemas not documented. Tools return structured objects (e.g., compress_tool_result returns {compressed, strategy, raw_tokens, compressed_tokens, saved_tokens}) but LLMs cannot see the expected response structure. This forces LLMs to guess what fields are available for downstream tool calls.
Parameter descriptions missing or minimal for several tools. get_optimized_context, flush_session, new_session, get_session_stats, get_index_status, and get_compression_stats have empty input schemas (no properties) but lack explanation of what they do with no parameters or when to call them.
Inferred effective spec: 2025-06-18+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 48 | 2025-06-18+ | v2 |
Retrieve optimized context for the current session, applying all four compression layers: semantic index, tool result compression, turn summarization, and session consolidation.
Retrieve statistics for the current session: turn count, token usage, compression savings, and per-tool compression breakdown.
Create a new Claude Code session and return its ID. Called automatically on first use; manual invocation is rare.
Record the current turn (user prompt and assistant response) to the session database for later summarization and context optimization.
Kick off a background re-index of the project. Returns immediately if an index is already running.
Error handling lacks recovery guidance. compress_tool_result validates inputs and throws errors (e.g., 'Invalid tool_type', 'file_path must be a relative path') but does not guide the LLM on what to do next. Errors should suggest alternatives or corrective actions.
Tool composition unclear. record_turn, flush_session, and new_session interact with session state, but dependencies are not documented. LLMs cannot infer: Must new_session be called before record_turn? What happens if flush_session is called twice? Are these idempotent?
No tool annotations (readOnlyHint, destructiveHint, idempotentHint). Tools are marked with Risk: READ_ONLY or WRITE in metadata, but MCP tool annotations are not visible in the schema. This prevents clients from understanding side effects.