<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Makra Gergő</title>
    <description>The latest articles on DEV Community by Makra Gergő (@makra_gerg_8b963cb7a1cfd).</description>
    <link>https://dev.to/makra_gerg_8b963cb7a1cfd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4236793%2F6489b63d-75c5-4cd6-9c62-389225616d11.jpg</url>
      <title>DEV Community: Makra Gergő</title>
      <link>https://dev.to/makra_gerg_8b963cb7a1cfd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/makra_gerg_8b963cb7a1cfd"/>
    <language>en</language>
    <item>
      <title>Stop letting your AI agent read whole files: a code map for Claude Code, Cursor and MCP</title>
      <dc:creator>Makra Gergő</dc:creator>
      <pubDate>Tue, 10 Nov 2026 10:16:16 +0000</pubDate>
      <link>https://dev.to/makra_gerg_8b963cb7a1cfd/stop-letting-your-ai-agent-read-whole-files-a-code-map-for-claude-code-cursor-and-mcp-k9k</link>
      <guid>https://dev.to/makra_gerg_8b963cb7a1cfd/stop-letting-your-ai-agent-read-whole-files-a-code-map-for-claude-code-cursor-and-mcp-k9k</guid>
      <description>&lt;p&gt;When an AI coding agent needs to change one method, it usually reads the whole file first. Then the next file. Then it greps, and reads a few more.&lt;br&gt;
Most of those tokens are spent on &lt;em&gt;finding the way&lt;/em&gt;, not on the task.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;callgraph&lt;/strong&gt; to give the agent a map instead: the structure of a file, every call labelled by kind, who calls a method across the project, and only then the one method body it actually needs.&lt;/p&gt;
&lt;h2&gt;
  
  
  What the agent sees
&lt;/h2&gt;

&lt;p&gt;Take a 400-line Laravel service. Instead of reading all of it, the agent asks for the outline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ callgraph.sh app/Services/OrderService.php
class OrderService  L30-412
  constants (1):
    MAX_ITEMS = 100
  properties (7):
    OrderRepository $orders [readonly]
    PaymentService $payments [readonly]
    …
  updateOrders()  L44-109
    framework_use     Illuminate\Support\Facades\DB::transaction
    internal_helper   updateOrder
    model_use         App\Models\Order::query
    static_call       App\Values\OrderUpdateResult::make
    💬 A single-order update keeps the old values of empty optional fields.
  …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every method with its line range, and every call grouped by what it is: ORM / model use, framework facade, internal helper, static call. The comments that explain intent stay. If the agent needs the code of one method, it asks for exactly that: &lt;code&gt;callgraph.sh app/Services/OrderService.php::updateOrders --body&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Who calls this?"
&lt;/h2&gt;

&lt;p&gt;Before changing &lt;code&gt;updateOrders&lt;/code&gt;, the agent wants to know what depends on it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ callgraph.sh app --grep '(^|::|\.|-&amp;gt;)updateOrders$'
app/Http/Controllers/OrderController.php
  class OrderController  L18-80
    update()  L45-66
      L52 │ $result = $this-&amp;gt;orderService-&amp;gt;updateOrders($request-&amp;gt;orders, $request-&amp;gt;toDto());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The caller, its line, and the call itself — no file read needed. &lt;code&gt;--depth 2&lt;/code&gt; follows the chain one level further (impact analysis), and calls through interfaces, traits and parent classes are found too.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Where do I start?"
&lt;/h2&gt;

&lt;p&gt;For a task description, &lt;code&gt;locate&lt;/code&gt; takes the names and words from it and ranks the few files worth opening first, each with the reason:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ callgraph.sh locate CheckoutController applyCoupon coupon
1. app/Http/Controllers/CheckoutController.php  ★★★
   class CheckoutController  L16-74  ← "CheckoutController" (exact class)
   apply()  L38  calls CouponService::applyCoupon  ← "applyCoupon" (call)
2. resources/js/types.d.ts  ★
   interface Coupon  L120-131  ← "coupon" (exact interface)
…
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And for an unfamiliar project, &lt;code&gt;callgraph.sh profile&lt;/code&gt; describes the architecture in about 15 lines: which folder holds which layer (controllers, services, models, Vue components, stores…), the patterns in use, and the direction the layers call each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AST analysis, not regex:&lt;/strong&gt; PHP (Laravel, Yii), JavaScript / TypeScript, Vue, Rust and Swift, plus CSS / SCSS, JSON and Markdown outlines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A project map&lt;/strong&gt; in &lt;code&gt;.callgraph/&lt;/code&gt;, updated file by file, so "who calls this?" across a large project is answered from one read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local and read-only.&lt;/strong&gt; Your code never leaves your machine. No PHP, Node or Rust toolchain needed: it is one static binary for macOS, Linux and Windows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three ways to use it:&lt;/strong&gt; a Claude Code skill, plain CLI from any terminal, or an MCP server for Cursor, VS Code, Claude Desktop and any MCP client.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Honest about gaps:&lt;/strong&gt; a file with a syntax error is still outlined up to the broken part, and the output says so instead of silently returning nothing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# download the package for your OS from https://callgraph.eu/ , unzip, then:&lt;/span&gt;
bash callgraph/install.sh
bash ~/.claude/skills/callgraph/callgraph.sh --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installer can also register the MCP server for Claude Code. Setup recipes for Cursor, VS Code and Claude Desktop are on &lt;a href="https://callgraph.eu/mcp?utm_source=DevTo" rel="noopener noreferrer"&gt;callgraph.eu/mcp&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Free and open source (MIT): &lt;a href="https://github.com/GeRiY/callgraph?utm_source=DevTo" rel="noopener noreferrer"&gt;github.com/GeRiY/callgraph&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;How does your agent find its way around a large codebase today?&lt;/strong&gt; I'd love to hear what works for you — and which languages or frameworks you'd want next.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claudecode</category>
      <category>mcp</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
