kimi_analyze
Understand large codebases by sending a prompt; receive a structured analysis report with key findings and code insights.
Instructions
Send a prompt to Kimi Code for codebase analysis. Kimi reads the codebase (256K context) and returns a compressed, structured report.
CACHE BEHAVIOR: If session_id is not provided, the MCP server will automatically use cached sessions when available.
First call: Creates cache (may take 60-120s for large codebases)
Subsequent calls: Reuses cached session (faster, ~10s)
Cache auto-expires after 30 minutes or when files change
Use kimi_cache_status to view cache statistics
Output is budget-controlled: Kimi reads 200K+ tokens of source but returns a 5-15K token analysis (configurable via detail_level). Use kimi_resume to drill deeper into specific areas. Takes 1-5 minutes for large codebases.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The analysis prompt for Kimi (be specific about what to analyze) | |
| work_dir | Yes | Absolute path to the codebase root directory | |
| session_id | No | Resume a specific Kimi session by ID (from kimi_list_sessions). If not provided, cached session will be used when available. | |
| thinking | No | Enable thinking mode for deeper analysis (default: true) | |
| detail_level | No | Output verbosity. summary: ~2-5K tokens (file index + key findings). normal (default): ~5-15K tokens (structured analysis). detailed: ~15-40K tokens (with code snippets). | |
| max_output_tokens | No | Max tokens in response (~4 chars/token). Default: 15000. Use 3000-5000 for quick scans, 30000+ for detailed analysis. | |
| include_thinking | No | Include Kimi internal reasoning in output. Default: false (saves 10-30K tokens). Enable only for debugging. | |
| use_cache | No | Enable automatic session caching (default: true). Set to false to bypass cache and create fresh session. |