<?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>Finding the code to change in a Laravel app, without reading every file</title>
      <dc:creator>Makra Gergő</dc:creator>
      <pubDate>Wed, 25 Nov 2026 12:15:14 +0000</pubDate>
      <link>https://dev.to/makra_gerg_8b963cb7a1cfd/finding-the-code-to-change-in-a-laravel-app-without-reading-every-file-5dio</link>
      <guid>https://dev.to/makra_gerg_8b963cb7a1cfd/finding-the-code-to-change-in-a-laravel-app-without-reading-every-file-5dio</guid>
      <description>&lt;p&gt;I use Claude Code a lot on Laravel projects. What bugs me is not the code it writes, it's how much it reads before it writes anything. Open the controller, open the model, grep for the relation, open a Vue page, grep again.&lt;/p&gt;

&lt;p&gt;So I built callgraph, a small tool that indexes the project once and then answers short questions about it. I want to show what that looks like on a real project instead of explaining it. I used &lt;a href="https://github.com/inertiajs/pingcrm" rel="noopener noreferrer"&gt;pingcrm&lt;/a&gt;, the Laravel + Inertia demo app, because anyone can clone it and check.&lt;/p&gt;

&lt;h2&gt;
  
  
  The task
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;When an organization is deleted, its contacts should be soft deleted too. Restoring the organization should bring them back.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Small task, but you need to know a few things first: where organizations get deleted, how the relation to contacts is defined, and who else touches that relation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: where do I start?
&lt;/h2&gt;

&lt;p&gt;The agent passes the words from the task to &lt;code&gt;locate&lt;/code&gt;:&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 organization delete contacts
locate: 3 terms · 275 matches in 24 files · start here ↓
1. app/Models/Organization.php  ★★★
   class Organization  L10-37  ← "organization" (exact class)
   contacts()  L20-23  callers: 1 (OrganizationsController::edit) · +5? by name  ← "contacts" (exact method)
   file name  ← "organization" (file name)
2. resources/js/Pages/Organizations/Edit.vue  ★★★
   property organization  L92  ← "organization" (exact property)
   'This organization has been deleted.'  L9  ← "organization", "delete" (string)
   'Contacts'  L32  ← "contacts" (string)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;275 raw matches would be a lot of grep output. Instead it gets a short ranked list with the reason for each file. The model and its &lt;code&gt;contacts()&lt;/code&gt; relation are on top, and it already shows the relation is only called from &lt;code&gt;OrganizationsController::edit&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: what is in the model?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ callgraph.sh app/Models/Organization.php
FILE  app/Models/Organization.php  NS:App\Models

class Organization extends Illuminate\Database\Eloquent\Model uses Illuminate\Database\Eloquent\Factories\HasFactory, Illuminate\Database\Eloquent\SoftDeletes  L10-37
  table: organizations · id, account_id:int, name, email?, phone?, address?, city?, region?, country?, postal_code?, timestamps, softDeletes
  resolveRouteBinding()  L15-18
    external_call     firstOrFail, withTrashed
    internal_helper   where
  contacts()  L20-23
    model_use         App\Models\Contact (ref)
    orm_relation      hasMany → Contact
  scopeFilter()  L25-36
    external_call     onlyTrashed, when, where, withTrashed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the part I like most. Without opening the file you see it uses &lt;code&gt;SoftDeletes&lt;/code&gt;, the table columns from the migration, and that &lt;code&gt;contacts()&lt;/code&gt; is a &lt;code&gt;hasMany&lt;/code&gt;. Route binding already includes trashed rows, which matters for restore.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: the controller, but only the outline
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ callgraph.sh app/Http/Controllers/OrganizationsController.php
FILE  app/Http/Controllers/OrganizationsController.php  NS:App\Http\Controllers

class OrganizationsController extends App\Http\Controllers\Controller  L13-107
  index()  L15-32
    route: GET /organizations (organizations)
  ...
  destroy()  L94-99
    route: DELETE /organizations/{organization} (organizations.destroy)
    external_call     with
    framework_use     Illuminate\Support\Facades\Redirect::back
    model_use         App\Models\Organization::delete
  restore()  L101-106
    route: PUT /organizations/{organization}/restore (organizations.restore)
    external_call     with
    framework_use     Illuminate\Support\Facades\Redirect::back
    model_use         App\Models\Organization::restore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every method has its route next to it, so there is no need to open &lt;code&gt;routes/web.php&lt;/code&gt; either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: just the two methods
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ callgraph.sh app/Http/Controllers/OrganizationsController.php::destroy,restore --body
== app/Http/Controllers/OrganizationsController.php  OrganizationsController::destroy()  L94-99
    94      public function destroy(Organization $organization): RedirectResponse
    95      {
    96          $organization-&amp;gt;delete();
    98          return Redirect::back()-&amp;gt;with('success', 'Organization deleted.');
    99      }

== app/Http/Controllers/OrganizationsController.php  OrganizationsController::restore()  L101-106
   101      public function restore(Organization $organization): RedirectResponse
   102      {
   103          $organization-&amp;gt;restore();
   105          return Redirect::back()-&amp;gt;with('success', 'Organization restored.');
   106      }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: who else uses &lt;code&gt;contacts()&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;Before changing anything around the relation it's good to know who calls 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;)contacts$'
FILE  app/Http/Controllers/OrganizationsController.php  NS:App\Http\Controllers

class OrganizationsController extends App\Http\Controllers\Controller  L13-107
  edit()  L57-74
    model_use         App\Models\Organization::contacts
    L71 │ 'contacts' =&amp;gt; $organization-&amp;gt;contacts()-&amp;gt;orderByName()-&amp;gt;get()-&amp;gt;map-&amp;gt;only('id', 'name', 'city', 'phon…
---
FILE  app/Http/Controllers/ContactsController.php  NS:App\Http\Controllers

class ContactsController extends App\Http\Controllers\Controller  L14-132
  index()  L16-35
    external_call     contacts
    L20 │ 'contacts' =&amp;gt; Auth::user()-&amp;gt;account-&amp;gt;contacts()
  store()  L49-69
    external_call     contacts
    L51 │ Auth::user()-&amp;gt;account-&amp;gt;contacts()-&amp;gt;create(
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;ContactsController&lt;/code&gt; hits are &lt;code&gt;Account::contacts()&lt;/code&gt;, a different relation with the same name, so nothing there changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the agent knew at this point
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Organization uses SoftDeletes and &lt;code&gt;hasMany&lt;/code&gt; contacts&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;destroy()&lt;/code&gt; and &lt;code&gt;restore()&lt;/code&gt; are two tiny methods, with their routes&lt;/li&gt;
&lt;li&gt;the relation is only read in &lt;code&gt;edit()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's enough to write the change: delete and restore the contacts in &lt;code&gt;destroy()&lt;/code&gt; and &lt;code&gt;restore()&lt;/code&gt; (or with model events on &lt;code&gt;Organization&lt;/code&gt;, if you prefer that style). It read two short methods and a few outlines, not the controller, the model, the routes file and a page of grep output.&lt;/p&gt;

&lt;p&gt;On a demo app this size the difference is small, honestly. Where it starts to matter is a real project with 2000-line services and a name like &lt;code&gt;save&lt;/code&gt; that shows up in 300 places.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it
&lt;/h2&gt;

&lt;p&gt;callgraph is free and MIT licensed, one binary for macOS, Linux and Windows. It runs locally and doesn't send your code anywhere. In Claude Code it's a skill, and for Cursor, Codex or VS Code there's an MCP server with the same queries. Besides PHP and Laravel it handles JS/TS, Vue, React, Python, Go, Rust, Swift and Kotlin.&lt;/p&gt;

&lt;p&gt;Install and docs: &lt;a href="https://callgraph.eu/?utm_source=DevTo" rel="noopener noreferrer"&gt;callgraph.eu&lt;/a&gt; · source: &lt;a href="https://github.com/GeRiY/callgraph" rel="noopener noreferrer"&gt;github.com/GeRiY/callgraph&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you try it on your own Laravel project I'm curious where it gets things wrong, that's the feedback that helps me most.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>claudecode</category>
      <category>ai</category>
    </item>
    <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>
