Skip to content

Code intelligence

garden indexes your code. garden code answers structural questions — definitions, references, callers, signatures — against that index instead of by scanning files.

That matters more here than elsewhere: a checkout is a virtual filesystem, so a repo-wide grep pulls a large fraction of the repository over the network. The index answers the same question without materialising anything.

Terminal window
garden code search Parse # find symbols by name, container, path, doc
garden code def ParseConfig # definition, with source inlined
garden code refs ParseConfig # every reference
garden code callers ParseConfig # just the functions that call it
garden code hover ParseConfig # signature and doc comment

An agent asked to “find everywhere we validate tokens” reaches for recursive grep by default. That is slow and expensive here, and it returns string matches rather than symbols — comments, unrelated identifiers, the word in a changelog. garden code refs returns actual references, resolved by the language’s semantics.

The agent guide that garden skill install writes into Claude Code, Cursor, and Codex says exactly this, which is the most reliable way to get the behaviour.

Every subcommand takes the same scope flags:

Terminal window
garden code refs Handler --pr 42 # that PR's latest revision
garden code refs Handler --commit abc123 # a specific commit
garden code def Handler --path backend/ # disambiguate by path
garden code search Handler --kind class # filter by symbol kind
garden code refs Handler --json # structured output