code_trace
code_trace follows the call graph from a starting symbol, either downward (what it calls) or upward (what calls it). Use it to understand how a function fits into the larger system.
code_trace(name="OrderService.checkout", direction="down")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | required | Starting symbol |
direction | "up" | "down" | "down" | Follow callees or callers |
depth | number | 5 | Max hops to follow |
Output
Section titled “Output”OrderService.checkout (src/services/order.ts:42) └─ PaymentService.charge (src/services/payment.ts:18) └─ stripe.charges.create (external) └─ InventoryService.reserve (src/services/inventory.ts:91) └─ db.query (src/db/client.ts:7) └─ orders_table (postgres) └─ NotificationService.send (src/services/notify.ts:33)Route tracing
Section titled “Route tracing”For HTTP routes, use code_route_trace which combines route lookup with full call tracing:
code_route_trace(route="/api/orders", method="POST")→ Router → OrderController.create → OrderService.checkout → ...