<?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: Leonardo Rossi</title>
    <description>The latest articles on DEV Community by Leonardo Rossi (@leonardobybyte).</description>
    <link>https://dev.to/leonardobybyte</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3828045%2F695ace5a-d494-420c-9b8a-e84d31736e75.png</url>
      <title>DEV Community: Leonardo Rossi</title>
      <link>https://dev.to/leonardobybyte</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leonardobybyte"/>
    <language>en</language>
    <item>
      <title>Beyond the Single Repo: How I Use Claude Code Across Microservices</title>
      <dc:creator>Leonardo Rossi</dc:creator>
      <pubDate>Mon, 16 Mar 2026 20:28:02 +0000</pubDate>
      <link>https://dev.to/leonardobybyte/beyond-the-single-repo-how-i-use-claude-code-across-microservices-hl5</link>
      <guid>https://dev.to/leonardobybyte/beyond-the-single-repo-how-i-use-claude-code-across-microservices-hl5</guid>
      <description>&lt;p&gt;As a backend engineer, I spend most of my time inside microservice architectures. And if you've worked in this world, you know the point: you're deep into one service and suddenly you need to understand how your changes ripple across the system. Which services consume this event? What breaks downstream if I change this contract?&lt;/p&gt;

&lt;p&gt;When everything lives in a single repository, Claude Code handles this beautifully — you drop a &lt;code&gt;CLAUDE.md&lt;/code&gt; file at the root and it has all the context it needs.&lt;/p&gt;

&lt;p&gt;But microservices live in separate repos. That's where things get interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;The idea starts with a parent folder containing all your microservice repositories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;platform/
├── CLAUDE.md          ← high-level system overview
├── user-service/
│   └── CLAUDE.md      ← service-specific context
├── order-service/
│   └── CLAUDE.md      ← service-specific context
├── notification-service/
│   └── CLAUDE.md      ← service-specific context
└── ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each microservice keeps its own &lt;code&gt;CLAUDE.md&lt;/code&gt; — minimal, focused: what the service does, its API surface, key domain concepts, tech stack specifics. On the other hand, the root-level &lt;code&gt;CLAUDE.md&lt;/code&gt; describes the system as a whole: how services interact, which events flow where, shared conventions, the big architectural picture.&lt;/p&gt;

&lt;p&gt;This layered structure enables two distinct ways of working with Claude Code, depending on where you launch it from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working inside a single service
&lt;/h2&gt;

&lt;p&gt;When you &lt;code&gt;cd&lt;/code&gt; into a service directory and run Claude Code, it automatically picks up the parent &lt;code&gt;CLAUDE.md&lt;/code&gt; in addition to the service's own file. Claude immediately knows your service doesn't exist in isolation — it understands the neighbors, the contracts, the event flows. You're fixing a bug in one service and Claude can already warn you: "the notification-service subscribes to this event — your change might break that contract."&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing cross-service features
&lt;/h2&gt;

&lt;p&gt;Sometimes you need to zoom out. That's when you run Claude from the root folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 claude &lt;span class="nt"&gt;--add-dir&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;/&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--add-dir&lt;/code&gt; flag grants Claude Code read access to additional directories beyond the one you launched it from. The &lt;code&gt;$(ls -d */)&lt;/code&gt; part expands to all subdirectories — every microservice repo in your workspace — so Claude can navigate into any service, read the code, and reason about it.&lt;/p&gt;

&lt;p&gt;The environment variable &lt;code&gt;CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD&lt;/code&gt; completes the picture. By default, &lt;code&gt;--add-dir&lt;/code&gt; only gives file access — it doesn't load the &lt;code&gt;CLAUDE.md&lt;/code&gt; files from those directories into context. Setting it to &lt;code&gt;1&lt;/code&gt; changes that: Claude picks up every service's &lt;code&gt;CLAUDE.md&lt;/code&gt;, giving it the full architectural map. You're pair-programming at the system level.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Keep the service-level &lt;code&gt;CLAUDE.md&lt;/code&gt; files lean — think "elevator pitch," not architecture decision records. The root file is the glue: relationships, flows, shared language that no single service owns.&lt;/p&gt;

&lt;p&gt;This isn't a silver bullet — you still need to keep those files up to date, and there's a balance with context window size. But as a pattern, it's been a significant upgrade. The setup takes minutes. The payoff is immediate.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
