get_context_for_task β
One call, one right answer. Given a symbol and the task you are about to do, returns the exact mix of dependencies, dependents, history, and complexity that matters for that task -- packed into your token budget. Stop assembling context by hand across four tools.
Start here
This is the recommended first call for any coding task. It replaces a chain of get_logic_slice + get_blast_radius + get_why_context + get_change_intelligence with a single, task-weighted result.
Parameters β
| Name | Type | Required | Description |
|---|---|---|---|
symbolId | string | yes | Fully-qualified symbol id (<file>::<name>::<kind>) |
taskType | "fix" | "extend" | "refactor" | "understand" | yes | Weighting strategy applied to the candidate pool |
tokenBudget | number (min 100) | no | Target size of the assembled context. Default 4000 |
Weighting by taskType β
| Task | Emphasizes |
|---|---|
fix | Direct deps + git history + anti-pattern signals |
extend | Direct deps + reverse dependents (blast radius) |
refactor | Reverse dependents + complexity + churn |
understand | Interfaces / types + direct deps |
Example β
json
{
"symbolId": "packages/cli/src/adapters/storage/sqlite.ts::SqliteStorageAdapter::class",
"taskType": "refactor",
"tokenBudget": 6000
}Response β
json
{
"target": {
"symbolId": "packages/cli/src/adapters/storage/sqlite.ts::SqliteStorageAdapter::class",
"name": "SqliteStorageAdapter",
"kind": "class"
},
"taskType": "refactor",
"context": [
{
"symbolId": "packages/cli/src/ports/i-storage-port.ts::IStoragePort::interface",
"name": "IStoragePort",
"kind": "interface",
"file": "packages/cli/src/ports/i-storage-port.ts",
"relevanceScore": 0.92,
"reason": "direct dependency (interface)",
"lines": 42,
"tokens": 180
}
],
"totalTokens": 3820,
"tokenBudget": 6000,
"warnings": [],
"_meta": { "totalItems": 12, "returnedItems": 12, "truncated": false }
}Symbol missing:
json
{ "found": false, "hint": "Symbol not found. Run \"ctxo index\"." }When to use β
- Fixing a bug --
taskType: "fix"pulls deps plus revert/anti-pattern history fromget_why_context. - Adding a feature --
taskType: "extend"gives you what the symbol needs and who will be affected. - Refactoring --
taskType: "refactor"surfaces importers and complexity hotspots fromget_change_intelligence. - Onboarding --
taskType: "understand"returns types and interfaces so you learn the shape, not the plumbing.
Notes β
Token budget
Entries are packed greedily by relevance score until tokenBudget is reached. Lower the budget for quick orientation, raise it for deep refactors.
- Requires
ctxo indexto have run at least once. - Still use
get_pr_impactwhen reviewing a diff -- that tool aggregates across every changed symbol.