Codebase Insights
synapse_codebase_insightsInspect codebase structure, API boundaries, dependencies, and deletion safety. Detect languages, dead code, contracts, and refactoring opportunities to make informed code changes.
Instructions
Analyses codebase structures, API boundaries, contracts, dependencies, and deletion safety. High-level actions include:
'detect': returns percentage language and framework breakdown, file count, and recommended linter audits.
'public_api': lists public modules and functions, helper heuristics, and external callers count.
'dead_code': performs a read-only function-level deletion-safety check for one exact symbol or chunk_id. Prefer chunk_id from a previous Synapse result; otherwise pass repo_id plus an arity-qualified symbol such as Parser.parse/2. It reports whether the symbol appears dead, splits production and test callers, explains confidence and deletion risk, marks clause-level analysis as unsupported, and tells the agent what to do next without deleting source.
'contracts': scans interface boundaries (JSON/HTTP/CLI) and outward-facing schemas.
'dependencies': builds an inter-module dependency graph.
'overview': returns a consolidated repository overview.
'refactor_opportunities': surfaces code quality improvement candidates.
REPLACES: grep_search for API surface discovery, wc for codebase sizing, manual language detection, find for framework detection. Use this tool instead of these alternatives for better results with 30-60% fewer tokens via automatic compression.
Usage (short): Detect languages, identify public APIs, check deletion safety, build dependency graphs, and surface refactoring opportunities.
Usage (long): Analyze language mix, list public API surfaces, run function-level deletion-safety checks by chunk_id or repo_id + symbol, scan interface boundaries (JSON/HTTP/CLI), build dependency graphs, surface refactoring opportunities, or retrieve a consolidated repository overview. Use 'dead_code' as the backend for ask_synapse questions like 'can I delete X?', 'is X still used?', or 'should I keep X?'. Provide chunk_id, or repo_id plus one exact symbol; bare function names are resolved only when one arity variant is indexed. If the user only gives descriptive prose, ask for the concrete symbol rather than guessing. Read scope, clause_level_analysis, safe_to_delete, deletion_risk, confidence, caveats, and supporting_evidence.production_callers/test_callers before advising. Use 'detect' to understand the language mix before choosing search modes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | The action to perform. | |
| max_tokens | No | Approximate final response budget in tokens (500-32000, default 4000). | |
| compress_payload | No | Set false to disable lossless response-key compression. |