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.
garden code search Parse # find symbols by name, container, path, docgarden code def ParseConfig # definition, with source inlinedgarden code refs ParseConfig # every referencegarden code callers ParseConfig # just the functions that call itgarden code hover ParseConfig # signature and doc commentWhy an agent should prefer it
Section titled “Why an agent should prefer it”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.
Scoping a query
Section titled “Scoping a query”Every subcommand takes the same scope flags:
garden code refs Handler --pr 42 # that PR's latest revisiongarden code refs Handler --commit abc123 # a specific commitgarden code def Handler --path backend/ # disambiguate by pathgarden code search Handler --kind class # filter by symbol kindgarden code refs Handler --json # structured outputRelated
Section titled “Related”garden code- Virtual filesystem checkout — why scanning is expensive