Loading...
Loading...
Compare original and translation side by side
smart_search(query="<topic>", path="./src") -- discover files + symbols across a directory
smart_outline(file_path="<file>") -- structural skeleton of one file
smart_unfold(file_path="<file>", symbol_name="<name>") -- full source of one symbolsmart_searchsmart_search(query="<topic>", path="./src") -- discover files + symbols across a directory
smart_outline(file_path="<file>") -- structural skeleton of one file
smart_unfold(file_path="<file>", symbol_name="<name>") -- full source of one symbolsmart_searchsmart_search(query="shutdown", path="./src", max_results=15)-- Matching Symbols --
function performGracefulShutdown (services/infrastructure/GracefulShutdown.ts:56)
function httpShutdown (services/infrastructure/HealthMonitor.ts:92)
method WorkerService.shutdown (services/worker-service.ts:846)
-- Folded File Views --
services/infrastructure/GracefulShutdown.ts (7 symbols)
services/worker-service.ts (12 symbols)querypathmax_resultsfile_patternsmart_search(query="shutdown", path="./src", max_results=15)-- Matching Symbols --
function performGracefulShutdown (services/infrastructure/GracefulShutdown.ts:56)
function httpShutdown (services/infrastructure/HealthMonitor.ts:92)
method WorkerService.shutdown (services/worker-service.ts:846)
-- Folded File Views --
services/infrastructure/GracefulShutdown.ts (7 symbols)
services/worker-service.ts (12 symbols)querypathmax_resultsfile_patternsmart_outline(file_path="services/worker-service.ts")file_pathsmart_outline(file_path="services/worker-service.ts")file_pathsmart_unfold(file_path="services/worker-service.ts", symbol_name="shutdown")file_pathsymbol_namesmart_unfold(file_path="services/worker-service.ts", symbol_name="shutdown")file_pathsymbol_nameensureWorkerStartedensureWorkerStarted1. smart_search(query="shutdown", path="./src")
-> 14 symbols across 7 files, full picture in one call
2. smart_unfold(file_path="services/infrastructure/GracefulShutdown.ts", symbol_name="performGracefulShutdown")
-> See the core implementation1. smart_outline(file_path="services/worker-service.ts")
-> 1,466 tokens: 12 functions, WorkerService class with 24 members
2. smart_unfold(file_path="services/worker-service.ts", symbol_name="startSessionProcessor")
-> 1,610 tokens: the specific method you need
Total: ~3,076 tokens vs ~12,000 to Read the full file1. smart_search(query="feature name", path="./src") -- discover all relevant files and symbols
2. smart_outline on key files -- understand structure
3. smart_unfold on important functions -- get implementation details
4. Read on small config/markdown/plan files -- get non-code context1. smart_search(query="session", path="./src", max_results=10)
-> 10 ranked symbols: SessionMetadata, SessionQueueProcessor, SessionSummary...
2. Pick the relevant one, unfold it1. smart_search(query="shutdown", path="./src")
-> 单次调用就得到7个文件中的14个符号,获取全局全貌
2. smart_unfold(file_path="services/infrastructure/GracefulShutdown.ts", symbol_name="performGracefulShutdown")
-> 查看核心实现1. smart_outline(file_path="services/worker-service.ts")
-> 1466 Token:12个函数,包含24个成员的WorkerService类
2. smart_unfold(file_path="services/worker-service.ts", symbol_name="startSessionProcessor")
-> 1610 Token:你需要的特定方法
总计:约3076 Token,而Read完整文件需要约12000 Token1. smart_search(query="feature name", path="./src") -- 查找所有相关文件和符号
2. 对核心文件执行smart_outline -- 理解结构
3. 对重要函数执行smart_unfold -- 获取实现细节
4. Read小型配置/markdown/规划文件 -- 获取非代码上下文1. smart_search(query="session", path="./src", max_results=10)
-> 10个排序后的符号:SessionMetadata、SessionQueueProcessor、SessionSummary...
2. 选择相关的符号,展开查看| Approach | Tokens | Use Case |
|---|---|---|
| smart_outline | ~1,000-2,000 | "What's in this file?" |
| smart_unfold | ~400-2,100 | "Show me this function" |
| smart_search | ~2,000-6,000 | "Find all X across the codebase" |
| search + unfold | ~3,000-8,000 | End-to-end: find and read (the primary workflow) |
| Read (full file) | ~12,000+ | When you truly need everything |
| Explore agent | ~39,000-59,000 | Cross-file synthesis with narrative |
| 方案 | Token消耗 | 适用场景 |
|---|---|---|
| smart_outline | ~1000-2000 | "这个文件里有什么?" |
| smart_unfold | ~400-2100 | "给我看这个函数" |
| smart_search | ~2000-6000 | "在代码库中查找所有X" |
| 搜索+展开 | ~3000-8000 | 端到端:查找并阅读(核心工作流) |
| Read(完整文件) | ~12000+ | 当你确实需要全部内容时 |
| Explore Agent | ~39000-59000 | 带描述的跨文件综合分析 |