Save tokens on commands that don't need AI. Intercepts commands meant for AI coding assistants and runs simple/deterministic ones locally with zero LLM calls.
Single tool 'maybe_execute_locally' has a clear, action-oriented name and a detailed description (194 chars) explaining its dual-path behavior (handled vs. unhandled). Input schema is well-structured with typed properties and descriptions. However, the output schema is NOT documented, the description mentions return fields but the tool definition lacks a formal outputSchema. Parameter 'context' is optional but its nested properties lack individual type constraints. Error handling is implicit (handled:false with reason) but not formally specified. The tool's purpose is narrow and well-defined, but schema incompleteness and missing output documentation prevent a higher score.
Route a command through token-ninja. Returns {handled:true, stdout, stderr, exit_code, rule_id, tokens_saved_estimate} when a local rule matched, or {handled:false, reason} when the AI should handle it. Always call this BEFORE invoking your own LLM — if handled=true, use the output directly.
Output schema not documented. Description mentions return fields (handled, stdout, stderr, exit_code, rule_id, tokens_saved_estimate) but tool definition lacks formal outputSchema declaration. LLMs cannot plan downstream operations without knowing the response structure.
Nested context object properties lack type constraints. 'cwd' and 'ai_tool' have descriptions but no explicit 'type' field in the schema. This allows LLMs to pass invalid types (numbers, objects) without validation.
ai_tool parameter accepts free-form string instead of enum. Description lists valid values (claude|codex|cursor|aider|gemini|continue) but does not enforce them via schema enum constraint. LLMs may hallucinate unsupported tool names.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 60 | 2026-07-28+ | v2 |
Error handling guidance incomplete. When handled=false, the 'reason' field is free-form text. No documented error categories (retryable, user-fixable, fatal) or recovery hints. LLMs cannot determine next steps from bare reason strings.
No idempotency guarantee documented. Tool executes commands locally, repeated calls with the same command may produce different results (e.g., file state changes). Agents retrying on ambiguous failures risk duplicate side effects.