Token optimizer for AI coding assistants — hooks into Claude Code/Gemini CLI to compress shell outputs and track USD savings. Provides code intelligence tools for BM25 + semantic search, symbol lookup, call graph tracing, and duplicate detection.
ecotokens provides 6 well-named, read-only code analysis tools with clear descriptions and documented input schemas. Tool names follow verb_noun convention (search, outline, symbol, trace_callers, trace_callees, duplicates). Descriptions are substantive (100-200 chars) and explain WHEN to use each tool. Input schemas include type definitions and parameter descriptions. However, output schemas are not documented, LLMs cannot predict what fields to expect from results. Error handling is absent from descriptions. No tool annotations (readOnlyHint, etc.) despite all being read-only. Parameter constraints (e.g., threshold 0-100, depth limits) are mentioned in descriptions but not formalized in schema. Overall solid for a specialized code-analysis server, but lacks production-grade output documentation and error guidance.
Detect near-duplicate or structurally similar code blocks in the indexed codebase and return refactoring proposals.
List symbols (functions, structs, enums, traits, etc.) in a file or directory. Use to explore the structure of a file before reading it in full.
Search the indexed codebase using BM25 + semantic search. Returns results scoped to the current git project, with line numbers pointing to the matching line and context lines around it. Prefer this over grep for code exploration.
Look up a symbol by its stable ID and return its full source code. IDs have the form 'src/file.rs::name#kind' (e.g. 'src/main.rs::cmd_search#fn'). Use ecotokens_outline first to discover available IDs.
Find all functions/methods called by a given symbol (callees). Supports recursive depth traversal. Use to understand what a function depends on.
Find all functions/methods that call a given symbol. Returns file paths, line numbers, and caller names. Use after ecotokens_search finds a definition to discover its usage sites.
Output schemas not documented. LLMs cannot predict result structure (fields, types, pagination). Forces agents to guess what data is available.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint). All 6 tools are read-only but lack explicit annotation for protocol compliance.
No error handling guidance in tool descriptions. Descriptions do not explain what to do if search fails, symbol not found, or index is stale.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 65 | 2026-07-28+ | v2 |
Parameter constraints (threshold 0-100, depth limits, top_k bounds) stated in descriptions but not formalized in JSON Schema (no minimum/maximum fields).
trace_callers and trace_callees accept only symbol name (string), not stable symbol ID. Inconsistent with ecotokens_symbol which uses 'src/file.rs::name#kind' format. Agents may pass wrong identifier format.