marm_code_context
Get task-relevant code symbols, source, and memory in one call. Understand how something works, where it's handled, or what a change would affect.
Instructions
🧩 Composed code context for a task: ranked symbols + source + memory, in ONE call.
Prefer this over marm_code_lookup when the question is "how does X work",
"where is X handled", or "what would changing X affect" -- it answers with
the symbols that matter, their source read from disk, and what memory
records about them, instead of leaving you to fetch each part yourself.
Ranking is personalised PageRank over the call graph seeded from `task`, so
a result is central *to this task* rather than globally popular or merely
word-matching. Read `markdown` and stop; the structured fields are the same
content for programmatic callers.
Parameters:
- task: what you are trying to do or understand
- project: code-graph project name or repo path; omit to resolve from cwd
- cwd: directory to resolve the project from (optional)
- budget: character budget for the returned source, 500-100000 (default 12000)
- include_graph: also return the ranked call neighbourhood as `graph_edges`;
off by default because it is several KB of JSON only a visualiser reads
- answer: also answer the task from the composed context with a local
model, citing the symbols it used. Off by default -- it is the slow step,
and for an agent that reads code the ranked context IS the answer.
`answer_status` is "ok" only when its citations resolve to composed
symbols and none name anything else, otherwise "unverified" with
`answer_unresolved`; "unavailable" rather than a failure when
generation is off or no model is up
- detail: how much to return. 1 is markdown only and is the default,
because `markdown` already contains the source and the memory text --
asking for 3 means paying for the same bytes twice. 2 adds symbol and
memory metadata without repeating bodies; 3 adds them. 0 means "use the
server default" (MARM_CODE_CONTEXT_DETAIL)
Returns: status, project, markdown, symbols, memories, links, graph_nodes,
notes -- or a no_project/unavailable status carrying the next step to take.
Each symbol carries `label` (the code KIND) and, when it arrived through the
call graph rather than by matching the task, a `provenance` object with hop,
strategy, confidence and risk; `provenance` is null for a seeded symbol
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| task | Yes | ||
| answer | No | ||
| budget | No | ||
| detail | No | ||
| project | No | ||
| include_graph | No |