{"at":"2026-11-23T02:38:25.863Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T02:38:26.842Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T02:38:29.397Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T02:38:30.409Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{}},"instructions":"Token Pilot reads code by structure: the skeleton of a file, one symbol's body, the places a symbol is used, a diff or log mapped to functions.\nIt pays off on code files of a few hundred lines or more, on searches for a symbol across the project, and on long git output.\nFor a small file, a config file or a known line range, Read is just as good.","protocolVersion":"2025-11-25","serverInfo":{"name":"token-pilot","version":"2.0.0"}}}}
{"at":"2026-11-23T02:38:30.409Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T02:38:30.409Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T02:38:30.410Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Use INSTEAD OF Read/cat for code files. Returns code structure (classes, functions, methods with signatures and line ranges) — 60-80% fewer tokens than raw content. Use read_symbol() to drill into specific code.","inputSchema":{"properties":{"depth":{"description":"Max depth for nested symbols (default: 2)","type":"number"},"force":{"description":"Bypass dedup — return full content even if the same path was already loaded earlier in this session. Use when the prior result was compacted out of context.","type":"boolean"},"max_tokens":{"description":"Token budget. If output exceeds this, auto-downgrades: full → outline → compact. Use for context-constrained sessions.","type":"number"},"path":{"description":"File path (absolute or relative to project root)","type":"string"},"scope":{"description":"Output scope: full (default, all details), nav (names + lines only, 2-3x smaller), exports (public API only)","enum":["full","nav","exports"],"type":"string"},"session_id":{"description":"Optional Claude Code session_id. When provided, dedup state (already-loaded files) persists across MCP server restarts and /clear, tied to that session. Omit to use ephemeral process-scoped dedup.","type":"string"},"show_docs":{"description":"Include doc comments (default: true)","type":"boolean"},"show_imports":{"description":"Include import details (default: true)","type":"boolean"}},"required":["path"],"type":"object"},"name":"smart_read"},{"description":"Read source code of ONE specific function/method/class — INSTEAD OF reading the whole file. Supports Class.method syntax.","inputSchema":{"properties":{"context_after":{"description":"Lines of context after (default: 0)","type":"number"},"context_before":{"description":"Lines of context before (default: 2)","type":"number"},"force":{"description":"Bypass dedup (see smart_read.force).","type":"boolean"},"include_edit_context":{"description":"Append raw code block for Edit old_string (saves a read_for_edit call)","type":"boolean"},"path":{"description":"File path","type":"string"},"session_id":{"description":"Optional Claude Code session_id for cross-restart dedup (see smart_read).","type":"string"},"show":{"description":"Display mode: full (all lines), head (first 50), tail (last 30), outline (head + methods + tail). Default: auto (full ≤300 lines, outline >300)","enum":["full","head","tail","outline"],"type":"string"},"symbol":{"description":"Symbol name, e.g. \"UserService.updateUser\"","type":"string"}},"required":["path","symbol"],"type":"object"},"name":"read_symbol"},{"description":"Batch read MULTIPLE symbols from ONE file — saves N-1 round-trips vs calling read_symbol N times. BEST FIT: 3–8 symbols in one file when you need their bodies. For 1–2 symbols use read_symbol (simpler). If you'd request ≥70% of the file's symbols, the handler refuses and points you to smart_read — that's cheaper than a large batch. For edit preparation use read_for_edit.","inputSchema":{"properties":{"context_after":{"description":"Lines of context after each symbol (default: 0)","type":"number"},"context_before":{"description":"Lines of context before each symbol (default: 2)","type":"number"},"path":{"description":"File path","type":"string"},"show":{"description":"Display mode for each symbol (default: auto)","enum":["full","head","tail","outline"],"type":"string"},"symbols":{"description":"Array of symbol names (max 10), e.g. [\"UserService.create\", \"UserService.update\", \"UserService.delete\"]","items":{"type":"string"},"type":"array"}},"required":["path","symbols"],"type":"object"},"name":"read_symbols"},{"description":"Read a specific line range from a file. Use when you know exact lines — lighter than reading the whole file.","inputSchema":{"properties":{"end_line":{"description":"End line (1-indexed, inclusive)","type":"number"},"force":{"description":"Bypass dedup (see smart_read.force).","type":"boolean"},"path":{"description":"File path","type":"string"},"session_id":{"description":"Optional Claude Code session_id for cross-restart dedup (see smart_read).","type":"string"},"start_line":{"description":"Start line (1-indexed)","type":"number"}},"required":["path","start_line","end_line"],"type":"object"},"name":"read_range"},{"description":"Read a specific section from Markdown, YAML, JSON, or CSV files. Markdown: by heading name. YAML/JSON: by top-level key. CSV: by row range (rows:1-50). Much cheaper than reading the whole file. DOCS/DATA ONLY — `heading` is required; this does NOT read code by line/symbol. For source files use read_range (line range) or read_symbol (one symbol).","inputSchema":{"properties":{"heading":{"description":"Section heading (Markdown), top-level key (YAML/JSON), or row range \"rows:1-50\" (CSV). Case-insensitive.","type":"string"},"path":{"description":"Path to .md, .yaml, .yml, .json, or .csv file","type":"string"}},"required":["path","heading"],"type":"object"},"name":"read_section"},{"description":"Use INSTEAD OF re-reading whole file after edits. Shows only changed hunks. REQUIRES: call smart_read or read_for_edit BEFORE editing to create baseline snapshot.","inputSchema":{"properties":{"context_lines":{"description":"Lines of context around changes (default: 3)","type":"number"},"path":{"description":"File path","type":"string"}},"required":["path"],"type":"object"},"name":"read_diff"},{"description":"Raw text around a symbol or line, ready to paste as Edit's old_string — handy before editing one function of a large file without reading the whole file. Read works just as well when you already have the file open. Supports batch: pass \"symbols\" array to get multiple edit contexts in one call. Unlike read_symbols (for reading/understanding), this returns unformatted code optimized for copy-paste into Edit. Optional: include_callers, include_tests, include_changes for enriched context.","inputSchema":{"properties":{"context":{"description":"Lines of context around target (default: 5)","type":"number"},"include_callers":{"description":"Show top callers of this symbol (saves a separate find_usages call)","type":"boolean"},"include_changes":{"description":"Show recent git changes in the target region","type":"boolean"},"include_tests":{"description":"Show related test file and test names","type":"boolean"},"line":{"description":"Line number to edit (alternative to symbol)","type":"number"},"path":{"description":"File path","type":"string"},"section":{"description":"Section to edit: heading (Markdown), top-level key (YAML/JSON), or \"rows:1-50\" (CSV). Returns raw section content for Edit old_string.","type":"string"},"symbol":{"description":"Symbol name to edit (e.g. \"UserService.updateUser\")","type":"string"},"symbols":{"description":"Array of symbol names for batch edit context (max 10). Alternative to single \"symbol\" — returns all symbols in one call.","items":{"type":"string"},"type":"array"}},"required":["path"],"type":"object"},"name":"read_for_edit"},{"description":"Batch smart_read for multiple files at once — INSTEAD OF calling Read on each file. Returns structure for each file. Max 20 files.","inputSchema":{"properties":{"force":{"description":"Bypass dedup (see smart_read.force).","type":"boolean"},"max_tokens":{"description":"Token budget per file. If a file exceeds this, auto-downgrades to compact outline.","type":"number"},"paths":{"description":"Array of file paths","items":{"type":"string"},"type":"array"},"session_id":{"description":"Optional Claude Code session_id for cross-restart dedup (see smart_read).","type":"string"}},"required":["paths"],"type":"object"},"name":"smart_read_many"},{"description":"Use INSTEAD OF Grep for finding symbol references. Semantic search — groups by: definitions, imports, usages. Supports scope, kind, limit, lang filters. Use context_lines to include surrounding code. HINT: for very short / generic symbols (≤4 chars like `id`, `err`, `Cmd`, `db`) Grep is usually cheaper than find_usages — the semantic grouping doesn't pay off when the symbol resolves ambiguously across thousands of files.","inputSchema":{"properties":{"context_lines":{"description":"Lines of source context around each match (0-10). When set, shows surrounding code — saves follow-up read_symbol calls.","type":"number"},"kind":{"description":"Show only specific section (default: \"all\")","enum":["definitions","imports","usages","all"],"type":"string"},"lang":{"description":"Filter by language/extension (e.g., \"php\", \"typescript\")","type":"string"},"limit":{"description":"Max results per category (default: 50, max: 500)","type":"number"},"mode":{"description":"Output mode: full (with context, default), list (file:line only, 5-10x smaller for initial discovery)","enum":["full","list"],"type":"string"},"scope":{"description":"Filter results by path prefix (e.g., \"src/Domain/\")","type":"string"},"symbol":{"description":"Symbol name to find usages of","type":"string"}},"required":["symbol"],"type":"object"},"name":"find_usages"},{"description":"START HERE for unfamiliar codebases. Shows project type, architecture, framework detection, quality tools, CI, directory map. Use include filter for specific sections.","inputSchema":{"properties":{"include":{"description":"Sections to include (default: all). Use [\"stack\"] for quick type check, [\"quality\",\"ci\"] for tooling overview.","items":{"enum":["stack","ci","quality","architecture"],"type":"string"},"type":"array"}},"type":"object"},"name":"project_overview"},{"description":"Show ranked import graph for a file: imports, importers, and tests scored by relevance (test adjacency, import closeness, recent changes, path proximity). Files ranked into HIGH VALUE / MEDIUM / LOW to prioritize reading.","inputSchema":{"properties":{"path":{"description":"File path to analyze","type":"string"}},"required":["path"],"type":"object"},"name":"related_files"},{"description":"Use INSTEAD OF listing dir + reading each file. One call returns all symbols (classes, functions, methods, routes) for every code file in a directory. Supports recursive with max_depth.","inputSchema":{"properties":{"max_depth":{"description":"Max recursion depth when recursive=true (default: 2, max: 5)","type":"number"},"path":{"description":"Directory path","type":"string"},"recursive":{"description":"Recursively outline subdirectories (default: false)","type":"boolean"}},"required":["path"],"type":"object"},"name":"outline"},{"description":"Show token savings report: calls, tokens saved, per-tool breakdown, top files, cache hits. Use verbose=true for full breakdown (per-intent, decision insights, savings by category).","inputSchema":{"properties":{"verbose":{"description":"Show detailed breakdown: per-intent, savings by category, decision insights (default: false)","type":"boolean"}},"type":"object"},"name":"session_analytics"},{"description":"Recursive depth-N call hierarchy for a function. Shows who calls who transitively — complements find_usages (flat one-level refs) by revealing full chains from leaf helpers to entry points. Use for debugging, refactor impact, and verifying reachability.","inputSchema":{"properties":{"depth":{"description":"Walk-up depth. Default 3, max 6.","type":"number"},"symbol":{"description":"Function / method name, unqualified (e.g. `fetchUser`).","type":"string"}},"required":["symbol"],"type":"object"},"name":"call_tree"},{"description":"Find dead code — functions, classes, and variables with no references across the project. Use for cleanup and refactoring.","inputSchema":{"properties":{"export_only":{"description":"Only check exported (capitalized) symbols","type":"boolean"},"limit":{"description":"Max results (default: 30)","type":"number"},"module":{"description":"Filter by module path (e.g., \"src/services/\")","type":"string"}},"type":"object"},"name":"find_unused"},{"description":"Find code quality issues: TODO/FIXME comments, deprecated symbols, structural code patterns (bare except:, print() calls). Use for project-wide audits.","inputSchema":{"properties":{"check":{"description":"What to check: \"pattern\" (structural search via ast-grep, e.g. \"except:\", \"print($$$ARGS)\"), \"todo\" (TODO/FIXME comments), \"deprecated\" (deprecated symbols), \"annotations\" (find by decorator name), \"all\" (todo + deprecated summary)","enum":["pattern","todo","deprecated","annotations","all"],"type":"string"},"lang":{"description":"Language filter for check=\"pattern\" (e.g., \"python\", \"typescript\")","type":"string"},"limit":{"description":"Max results (default: 50)","type":"number"},"name":{"description":"Decorator/annotation name for check=\"annotations\". Example: \"Deprecated\", \"Controller\"","type":"string"},"pattern":{"description":"Code pattern for check=\"pattern\". ast-grep syntax: \"except:\" finds bare excepts, \"print($$$ARGS)\" finds print calls.","type":"string"}},"required":["check"],"type":"object"},"name":"code_audit"},{"description":"Analyze module dependencies, dependents, public API, and unused deps. Use for architecture understanding and dependency cleanup.","inputSchema":{"properties":{"check":{"description":"What to check: \"deps\" (dependencies), \"dependents\" (who depends on this), \"api\" (public symbols), \"unused-deps\" (dead dependencies), \"all\" (everything). Default: \"all\"","enum":["deps","dependents","api","unused-deps","all"],"type":"string"},"module":{"description":"Module name or path pattern (e.g., \"auth\", \"src/Domain/\")","type":"string"}},"required":["module"],"type":"object"},"name":"module_info"},{"description":"Show the transitive dependency path(s) between two modules — how module A reaches module B through the import graph. Use to answer 'how does X depend on Y?', trace coupling, or generate a dependency diagram. format='mermaid'/'dot' emits a diagram; default text lists the hops.","inputSchema":{"properties":{"all":{"description":"Show all simple paths instead of just the shortest (default: false)","type":"boolean"},"format":{"description":"Output format: \"text\" (default, hop listing), \"json\", \"mermaid\" or \"dot\" (dependency diagram)","enum":["text","json","mermaid","dot"],"type":"string"},"from":{"description":"Source module — the one whose dependencies are followed (name or path, e.g. \"auth\", \"apps/api\")","type":"string"},"maxDepth":{"description":"Cap on path length in hops (default: 20, max: 50)","type":"number"},"maxPaths":{"description":"Cap on number of paths returned (default: 50, max: 200)","type":"number"},"to":{"description":"Target module to reach","type":"string"},"viaKind":{"description":"Restrict traversal to a dependency kind (default: \"all\")","enum":["api","implementation","all"],"type":"string"}},"required":["from","to"],"type":"object"},"name":"module_route"},{"description":"Use INSTEAD OF raw git diff. Shows changed files with AST symbol mapping — which functions/classes were modified/added/removed. Small diffs include hunks, large diffs show summary.","inputSchema":{"properties":{"path":{"description":"Filter to specific file or directory","type":"string"},"ref":{"description":"Git ref — required for scope=\"commit\" (commit hash) or scope=\"branch\" (branch name)","type":"string"},"scope":{"description":"Diff scope (default: \"unstaged\")","enum":["unstaged","staged","commit","branch"],"type":"string"}},"type":"object"},"name":"smart_diff"},{"description":"One-call exploration of a directory: outline (all symbols), imports (external deps + who imports this area), tests (matching test files), recent git changes. Use INSTEAD OF separate outline + related_files + git log calls. Default since v0.30.0 returns only outline+changes — telemetry showed the all-4 default producing negative token reduction for small areas. Opt into imports/tests explicitly via `include` when you need them.","inputSchema":{"properties":{"include":{"description":"Sections to include. Default: [\"outline\",\"changes\"]. Add \"imports\" for dep graph, \"tests\" to map test files — both can be heavy on large areas.","items":{"enum":["outline","imports","tests","changes"],"type":"string"},"type":"array"},"path":{"description":"Directory path (or file path — will use its parent directory)","type":"string"}},"required":["path"],"type":"object"},"name":"explore_area"},{"description":"One-shot ranked context + call/inheritance graph blast-radius for a query. Returns ranked symbols, the source heads of the top-ranked files, graph neighbours (callers + subclasses — the blast radius), and related test files in a single compact block. Use INSTEAD OF separate find_usages + read_symbol + call_tree when you need to understand an area fast — cheaper than chaining those three.","inputSchema":{"properties":{"graph":{"description":"Include call/inheritance graph neighbours (blast radius). Default: true. Set false to skip the graph walk.","type":"boolean"},"max_files":{"description":"Cap on the number of source file heads returned (default: binary's own limit)","type":"number"},"query":{"description":"Search terms (the binary splits the string into terms itself), e.g. \"AstIndexClient buildIndex\"","type":"string"}},"required":["query"],"type":"object"},"name":"explore"},{"description":"Use INSTEAD OF raw git log. Structured commit history with category detection (feat/fix/refactor/docs), file stats, author breakdown. Filters by path and ref. HEADS UP: two verification runs measured this tool at ~39% token reduction (borderline — vs 95-99% for outline/smart_diff). Cumulative data being gathered — tool may be dropped or redesigned in v0.30.0 if numbers don't improve. Prefer scoping with `path` or `count` to tighten savings.","inputSchema":{"properties":{"count":{"description":"Number of commits (default: 10, max: 50)","type":"number"},"path":{"description":"Filter to specific file or directory","type":"string"},"ref":{"description":"Git ref — branch, tag, or commit (default: HEAD)","type":"string"}},"type":"object"},"name":"smart_log"},{"description":"Run tests and return structured summary: total/passed/failed/skipped + failure details. 200 lines of raw output → 10-15 lines. Parsers: vitest, jest, pytest, phpunit, go test, cargo test, node --test (rspec/mocha fall back to generic patterns). The command runs through the shell (env prefixes and && work) in the server's environment (normally your terminal's) minus CLAUDE_PLUGIN_* / TOKEN_PILOT_* variables, with CI=1, NO_COLOR=1 and FORCE_COLOR=0 set so runners print plain output and skip watch mode (an env prefix in the command overrides them); on timeout the command and everything it started are killed (its process group; `taskkill /T` on Windows) and the result says TIMEOUT.","inputSchema":{"properties":{"command":{"description":"Test command to run (e.g., \"npm test\", \"pytest\", \"go test ./...\")","type":"string"},"runner":{"description":"Force specific parser (auto-detected if omitted)","enum":["vitest","jest","pytest","phpunit","go","cargo","rspec","mocha"],"type":"string"},"timeout":{"description":"Timeout in ms (default: 60000, max: 300000)","type":"number"}},"required":["command"],"type":"object"},"name":"test_summary"},{"description":"Capture current session state as a compact markdown block (<200 tokens). Call before compaction, when switching direction, or periodically in long sessions. Model provides the facts, tool formats them. Writes the block to .token-pilot/snapshots/<timestamp>.md (last 10 kept) and .token-pilot/snapshots/latest.md, which the next session start points to; pass persist=false to only return it.","inputSchema":{"properties":{"blocked":{"description":"Current blocker or obstacle","type":"string"},"confirmed":{"description":"Established facts (what has been verified)","items":{"type":"string"},"type":"array"},"decisions":{"description":"Key decisions made and why (e.g., \"removed sysfee step — caused double counting\"). Prevents revisiting rejected approaches.","items":{"type":"string"},"type":"array"},"files":{"description":"Relevant file paths","items":{"type":"string"},"type":"array"},"goal":{"description":"Session goal — what and why","type":"string"},"next":{"description":"Next step to take","type":"string"},"persist":{"description":"Save to .token-pilot/snapshots/ (default: true). false = return the block only.","type":"boolean"}},"required":["goal"],"type":"object"},"name":"session_snapshot"},{"description":"META / info-only: reports Read-hook pressure for this session (suppressed tokens, reference budget, burn fraction, effective denyThreshold). Does NOT save tokens itself — this is diagnostic, use to decide when to tighten before a big read. NOTE: burnFraction measures hook activity, not actual context-window occupancy.","inputSchema":{"properties":{"sessionId":{"description":"Claude Code session_id (same id that appears in hook-events.jsonl). Pass \"\" to read with no session filter.","type":"string"}},"required":["sessionId"],"type":"object"},"name":"session_budget"}]}}}
