---
title: "Discussion on \"Why a Coding Agent Needs Three Different Ways to \"Read\" Code\" | Hashnode"
description: "Discussion on \"Why a Coding Agent Needs Three Different Ways to \"Read\" Code\". How LLMs make sense of code"
url: "https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why a Coding Agent Needs Three Different Ways to "Read" Code](https://blog.iresharma.com/why-a-coding-agent-needs-three-different-ways-to-read-code?utm_source=hashnode&utm_medium=feed)

How LLMs make sense of code

Aug 18 · 8 min read · blog.iresharma.com  
Read the article

-   [#llm](https://hashnode.com/tag/llm)
-   [#claude](https://hashnode.com/tag/claude)
-   [#claude-code](https://hashnode.com/tag/claude-code)
-   [#codex](https://hashnode.com/tag/codex)
-   [#tools](https://hashnode.com/tag/tools)

## Written by

[Iresh Sharma](https://hashnode.com/@Iresharma)

@Iresharma · bengaluru

  
[View profile](https://hashnode.com/@Iresharma)

Building Voice @ Salesforce

Engineering building native Voice infra for salesforce by day, and hacking around awesome products by night

## Responses 9

Markdown supported · ⌘↵ to post

[Julian Neagu](https://hashnode.com/@julianneagulab)

[Aug 20](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a86f775ca8d1027ff7552b1)

The “cheapest tool that answers the question” idea is the part I’d keep. Agents waste a lot of context when they treat every code lookup like a file read. Tree-sitter for local stuff and LSP for relationships feels like the right split.

[Evelyn Wyatt](https://hashnode.com/@Evelynwyatt)

[Aug 19](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a85ac5cc3b55d86e8a7eadc)

The “cheapest tool that answers the question” principle is probably the most practical takeaway here. An agent doesn't need deeper semantic understanding for every lookup, and using an expensive project-wide tool for simple symbol discovery can waste both latency and context. Treating code navigation as an escalation path, from local structure to project relationships, feels like a much better fit for agent workflows.

[Shubhojyoti Ganguly](https://hashnode.com/@sgang007)

[Aug 19](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a85a8fc8860085c8225e429)

The entire approach is an older style of navigating codebase. A MCP server like repowise or graphify is replacing the LSP server these days. The MCPs use an indexing algorithm to expose entities to any LLM tool.

The entire process totally depends on the sophistication in the indexing layer.

Also, would love to hear your thoughts on AST vs code-specific embeddings like voyage3 in crawling the codebase?

[Iresh Sharma](https://hashnode.com/@Iresharma)

[Aug 19](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a85a8fc8860085c8225e429#reply-6a860399b6905b626e04ded8)

Thanks for reading, and for the thoughtful comment!

I'd push back a little on "replacing" though. I think it's less an upgrade path and more different tools for different jobs. My main hesitation with precomputed index approaches like Graphify is that without an LSP in the loop, the relationships are basically heuristic guesses over the AST, not resolved by an actual compiler. That's literally why Graphify needs those EXTRACTED/INFERRED/AMBIGUOUS confidence tags, it's grading its own guesses. My current setup trades that whole-repo convenience for something narrower but deterministic. When goto\_definition or find\_references gives me an answer, it's backed by real type and scope resolution, not pattern matching or similarity. For refactors, or anything where I need "every caller, no exceptions," that guarantee matters more to me right now than being able to ask aggregate questions about the whole codebase.

On voyage-code-3, that's a genuinely interesting angle and not something I'd brush off. The real gap in my current setup is that everything needs you to already know a name or a position. There's no way to just ask "find the thing that handles retry logic" without brute force scanning and hoping the LLM stumbles onto it. That's exactly the kind of problem embeddings are good at.

So honestly, I'm already thinking about a next version that isn't either/or. Something like voyage3 for coarse semantic recall to figure out what's roughly relevant, tree-sitter and LSP for precise resolution once things are narrowed down, and some kind of local memory or graph layer (basically a Graphify alternative) so structure persists across sessions instead of getting rebuilt from scratch every time.

Appreciate you pushing on this, it's genuinely helpful for figuring out where to take it next.

[Sanoary Istiaque](https://hashnode.com/@istyy)

[Aug 19](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a8579ec365e5d9dcde9a3c6)

Really interesting perspective on how coding agents understand and work with code. The idea that different levels of code reading are needed for better reasoning, navigation, and problem-solving highlights the complexity behind building truly useful AI developer tools. I enjoyed how you broke down the importance of context and depth when analyzing code. Great insights for anyone interested in the future of AI-assisted programming!

[tushar vashishth](https://hashnode.com/@tus055)

[Aug 19](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a85794ea079f3b9e04a1474)

interesting perspective , most of the similar things i have read in one more course called RAMP, where A stands for agentic or agents,

[Skillselion](https://hashnode.com/@skillselion)

[Aug 18](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a84c93db026905aac9e2406)

The detail I want to underline is find\_symbol returning a 1-based position "specifically so that position can be fed straight into goto\_definition". Models really are bad at deriving line/column from a text dump, and making the cheap tool emit coordinates for the expensive one is the cleanest fix I have seen written down. One more property of tree-sitter worth naming for this use case: its error recovery. Mid-edit files parse to a tree with error nodes instead of failing, so find\_symbol keeps working while the agent is halfway through a refactor, exactly when the language server starts complaining. On your open question about invalidation: pyright republishes diagnostics on didChange without a didOpen round trip, so a thin didChange with a debounce may get you fresh diagnostics cheaper than reopening files. Did you consider caching find\_references results, or is the staleness risk after edits too high to bother?

[Iresh Sharma](https://hashnode.com/@Iresharma)

[Aug 19](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a84c93db026905aac9e2406#reply-6a8604fa60844a1b2991e313)

This is what I want to do next, some sort of local memory plus from [Shubhojyoti Ganguly](https://hashnode.com/@sgang007 "Shubhojyoti Ganguly") comment I what to also try adding voyage3 for answering questions like "where is the retry logic"

[Kartik N V J K](https://hashnode.com/@kartik-nvj)

[Aug 18](https://hashnode.com/posts/why-a-coding-agent-needs-three-different-ways-to-read-code/6a8444e10f3c9d013e58eb01/comment/6a84a1da5ae98b2e9e778444)

The idea that a coding agent needs several different ways to read code matches what I see: keyword search, structural parsing, and semantic retrieval each catch what the others miss. I lean on the structural view most when the agent needs to reason about what calls what, and on retrieval when it needs intent. Nice articulation of why one representation is never enough.
