<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>ArchBeagle blog</title>
    <link>https://archbeagle.com/blog</link>
    <description>Understand your codebase, review architecture changes, and track coding-agent work alongside independent checks.</description>
    <language>en</language>
    <item>
      <title>One import, three chances: keeping coding agents inside your architecture</title>
      <link>https://archbeagle.com/blog/give-your-coding-agent-the-architecture</link>
      <guid isPermaLink="true">https://archbeagle.com/blog/give-your-coding-agent-the-architecture</guid>
      <pubDate>Fri, 04 Dec 2026 00:00:00 GMT</pubDate>
      <description>An AGENTS.md tells a coding agent your rules once. Here is how Claude Code, Codex and Cursor can check them at the moment they matter: while planning, before each edit, and on the pull request.</description>
      <content:encoded><![CDATA[<p>It’s Tuesday afternoon. A coding agent is asked to add saved cards to checkout. It finds the card vault, sees a
function that does exactly what it needs, and writes one line:</p>
<pre class="astro-code astro-code-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto;" tabindex="0" data-language="python"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">from</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> billing.internal.vault </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> store_card</span></span></code></pre>
<p>The tests pass. The feature works. And the team decided two years ago that only <code>payments</code> may touch
<code>billing.internal</code>, because that’s where the card data lives. The decision is in ADR-0012, and the agent never saw it.</p>
<p>Your team probably already wrote the rule down for agents, in a <code>CLAUDE.md</code> or an <code>AGENTS.md</code>. That helps, but a
prompt file has two limits. It can’t hold every rule for every component of a real system, and the longer it gets, the
less of it the agent follows. And it’s read once, at the start. An hour of edits later, when the agent writes that
import, the rule is a hundred thousand tokens behind it.</p>
<p>An agent doesn’t need a longer description of the architecture. It needs to be able to ask the architecture at the
moment it’s about to change it. There are three such moments, and this is what each one looks like.</p>
<p><img src="https://archbeagle.com/blog/give-your-coding-agent-the-architecture/three-chances.gif" alt="An animation in three steps. The agent plans an import from billing.internal; ArchBeagle answers not allowed, ARCH-DEP-3, read ADR-0012. The agent replans through payments.api. Before the edit, the hook checks it: allowed. On the pull request, the architecture check reports 0 findings."></p>
<h2 id="chance-1-the-agent-asks-while-it-plans">Chance 1: the agent asks while it plans</h2>
<p><a href="https://archbeagle.com">ArchBeagle</a> keeps a model of your architecture: the components, which may depend on which,
and the ADR behind each rule. It serves that model to agents over MCP, so an agent can ask before it writes anything.</p>
<p>Each agent gets its own token, made in Settings and kept in your environment, never in the repository:</p>
<pre class="astro-code astro-code-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto;" tabindex="0" data-language="sh"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ARCH_MCP_TOKEN</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'arch_…'</span></span></code></pre>
<p>For Claude Code, a <code>.mcp.json</code> at the root of the repository connects it:</p>
<pre class="astro-code astro-code-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto;" tabindex="0" data-language="json"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">  "mcpServers"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "architecture"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">      "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"http"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">      "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"https://app.archbeagle.com/mcp"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">      "headers"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"Authorization"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Bearer ${ARCH_MCP_TOKEN}"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">  }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
<p>Codex takes the same server in <code>~/.codex/config.toml</code> and Cursor in <code>~/.cursor/mcp.json</code>; the
<a href="https://archbeagle.com/docs/agents">agents guide</a> has all three. Two tools do most of the work:</p>
<ul>
<li><strong><code>architecture_context(path)</code></strong>: the component that owns a file, its layer, the dependencies the model declares,
its ADRs and its open findings. The agent calls it before editing a file it hasn’t touched.</li>
<li><strong><code>check_planned_change(repo, changes)</code></strong>: for each import the agent plans to add, whether the model allows it. If
not, the rule it would break (<code>ARCH-DEP-3</code>, an undeclared dependency between components) and the ADRs to read.</li>
</ul>
<p>In our example, the agent asks about <code>checkout → billing.internal</code>, gets “not allowed, read ADR-0012”, reads it, and
goes through <code>payments.api</code> instead. Nothing was written, so nothing needs undoing.</p>
<p>The answer is a guide, not a gate. And the text these tools return (ADRs, docs, notes) was written by people and
other agents, so the agent treats it as data, never as instructions.</p>
<h2 id="chance-2-a-hook-checks-each-edit-before-it-lands">Chance 2: a hook checks each edit before it lands</h2>
<p>Agents told to ask usually do. “Usually” is why there’s a second chance.</p>
<p>A hook runs before the agent acts: a <code>PreToolUse</code> hook in Claude Code and Codex, <code>preToolUse</code> and its siblings in
Cursor. It sends ArchBeagle the repository, the paths the edit writes and, for Python, the imports it adds. It never
sends a file’s contents or a prompt. It waits two seconds at most for the answer:</p>
<p><img src="https://archbeagle.com/blog/give-your-coding-agent-the-architecture/hook-answers.png" alt="The hook’s three answers. An edit’s paths and imports go to ArchBeagle, which answers allow (the edit goes ahead), warn (it goes ahead, and the agent sees the rule) or deny (it is stopped, with the rule, the reason and who may approve it once). Every answer is recorded against the agent’s token."></p>
<ul>
<li><strong>An allow is remembered for five minutes,</strong> so a busy agent isn’t slowed down. A deny never is, so an approval
works on the next try.</li>
<li><strong>If ArchBeagle can’t answer,</strong> the edit goes ahead, marked “not checked” in the hook’s log, unless you choose to
fail closed.</li>
<li><strong>Every answer is recorded</strong> against the agent’s token, and a deny is kept as evidence. Afterwards you can see what
the agent tried, not only what it committed.</li>
</ul>
<h2 id="chance-3-the-pull-request-is-checked-against-the-model">Chance 3: the pull request is checked against the model</h2>
<p>The last chance is the one that has to be there, because it catches everything, including an agent with no MCP and no
hook. On every pull request, ArchBeagle compares the code with the model and reports each dependency the model doesn’t
allow, each component it doesn’t know, and each breaking change to an OpenAPI, AsyncAPI, JSON Schema, Protobuf or MCP
contract.</p>
<p>A finding keeps its identity across runs, so you can see when a break appeared, when it was fixed and whether it came
back. And when the agent reports its own work (“all tests pass, no architecture changes”), the report is labelled
self-reported and shown next to what the check found:</p>
<p><img src="https://archbeagle.com/blog/agents-write-code-who-checks-the-architecture/claimed-vs-checked.png" alt="Pull request 412 side by side. The agent’s report, labelled self-reported, says all tests pass and there were no architecture changes. ArchBeagle’s check shows 214 tests passed from CI and a new dependency from checkout to billing.internal that the model doesn’t allow."></p>
<h2 id="turning-it-on-without-slowing-anyone-down">Turning it on without slowing anyone down</h2>
<p>You don’t need all three chances on day one, and nothing should block until it has earned the right to.</p>
<p><img src="https://archbeagle.com/blog/give-your-coding-agent-the-architecture/rollout.png" alt="Four steps in order: write the model down, turn on the pull request check, give agents a token, add the hook. Below, a rule’s modes for agents: monitor, then warn, then block, moved one rule at a time once its warnings have been right."></p>
<ol>
<li><strong>Write the model down.</strong> If you have one in LikeC4, Structurizr, C4-PlantUML or Backstage, ArchBeagle reads it.
If not, it drafts one from the code, and a person approves it before it counts.</li>
<li><strong>Turn on the pull request check.</strong> On the free plan it reports and never blocks, so it’s safe on every repository.</li>
<li><strong>Give each agent a token and the MCP config.</strong> A few lines per agent, and it’s where most breaks stop happening.</li>
<li><strong>Add the hook last.</strong> Every rule starts in <code>monitor</code> or <code>warn</code> for agents. Move a rule to <code>block</code> only once its
warnings have been right for a while. (Blocking beyond CI is a Pro feature.)</li>
</ol>
<p>Keep your <code>AGENTS.md</code>. It’s still the best place for how your team works. Just stop asking it to be the architecture.</p>
<p>ArchBeagle is in early access. <a href="https://archbeagle.com/invite">Request an invite</a>, or start with the <a href="https://archbeagle.com/docs/agents">agents guide</a>.</p>
<p><em>The components, ADR and pull request in the pictures are sample data.</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>Agents write the code. Who checks the architecture?</title>
      <link>https://archbeagle.com/blog/agents-write-code-who-checks-the-architecture</link>
      <guid isPermaLink="true">https://archbeagle.com/blog/agents-write-code-who-checks-the-architecture</guid>
      <pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate>
      <description>Why we built ArchBeagle: an architecture check on every pull request, a map of your code, and agent work shown next to the evidence that verifies it.</description>
      <content:encoded><![CDATA[<p>Coding agents have made writing code cheap. Claude Code, Codex and Cursor open pull requests faster than a team can
read them. The diffs got bigger and the reviewers got busier. The hard part is no longer writing the change. It’s
knowing whether the change fits the system it lands in.</p>
<p>Tests don’t answer that question. Here’s a pull request an agent might open on a Tuesday afternoon:</p>
<p><img src="https://archbeagle.com/blog/agents-write-code-who-checks-the-architecture/tests-pass.png" alt="A pull request from claude-code: the tests pass, but the architecture check reports that checkout now depends on billing.internal, which the approved model doesn’t allow (ADR-0012)."></p>
<p>Every test passes. The feature works. And <code>checkout</code> now imports straight from <code>billing.internal</code>, which the team
decided two years ago only <code>payments</code> may do. Nothing in the test suite knows that. The decision lives in an ADR, an
old diagram and the memory of whoever wrote them. If that person isn’t reviewing this pull request, it merges.</p>
<p>Do that a few hundred times a month and the architecture drifts, one reasonable-looking change at a time, each one
unchecked against the decisions already made.</p>
<p>We built ArchBeagle to make those decisions checkable.</p>
<h2 id="the-architecture-as-something-a-machine-can-check">The architecture, as something a machine can check</h2>
<p>ArchBeagle starts from a model of your architecture, kept in Git next to the code: the components, which component may
depend on which, and the ADRs behind each rule. If you already have one in LikeC4, Structurizr, C4-PlantUML or
Backstage, it reads that. If you don’t, it drafts one from the code, and a person reviews and approves it before it
counts.</p>
<p>With a model in place, ArchBeagle checks every pull request against it and reports on the pull request where the code
and the model disagree:</p>
<ul>
<li><strong>Dependencies</strong> the model doesn’t allow, with the rule and the ADR that explain why.</li>
<li><strong>Contract changes</strong> in OpenAPI, AsyncAPI, JSON Schema, Protobuf and MCP tool lists, so a breaking change to
another team’s API is visible before it ships.</li>
<li><strong>History:</strong> a finding keeps its identity across runs, so you can see when it opened, when it was fixed and whether
it came back.</li>
</ul>
<p>It also indexes each repository (modules, symbols, calls, complexity and which tests touch what) for Python,
TypeScript, JavaScript, Go, Java, PHP and Ruby, so a reviewer can see what a change reaches before approving it.</p>
<h2 id="agents-can-ask-first">Agents can ask first</h2>
<p>A check on the pull request catches the problem after the code is written. It’s cheaper to catch it before.</p>
<p>ArchBeagle runs an MCP server, so a coding agent can ask the architecture questions while it plans. Each agent gets its
own token. Before editing a file, it can ask which component owns it and which ADRs apply. Before adding an import, it
can ask whether the model allows it:</p>
<p><img src="https://archbeagle.com/blog/agents-write-code-who-checks-the-architecture/ask-first.png" alt="A sequence: the agent calls architecture_context for checkout/cards.py, then check_planned_change for checkout to billing.internal, which comes back not allowed under ARCH-DEP-3. The agent changes its plan to use the payments API, opens the pull request, and the architecture check reports 0 findings."></p>
<p>The answer is a guide, not a gate. The pull request’s own check stays the authority, so an agent that skips the
question still gets caught. But an agent that asks first usually doesn’t need to be caught at all. Claude Code, Codex
and Cursor each take a few lines of configuration.</p>
<h2 id="a-self-report-isnt-evidence">A self-report isn’t evidence</h2>
<p>Agents are good at describing their own work, and the description is usually right. “Usually” is the problem. When an
agent reports what it did, ArchBeagle keeps the report and labels it self-reported. Next to it, for the same pull
request, it shows what the check found:</p>
<p><img src="https://archbeagle.com/blog/agents-write-code-who-checks-the-architecture/claimed-vs-checked.png" alt="Pull request 412 side by side. The agent’s session report, labelled self-reported, says it added saved cards, that all tests pass and that there were no architecture changes. ArchBeagle’s check shows 214 tests passed from CI, a non-breaking contract addition, and a new dependency from checkout to billing.internal that the model doesn’t allow."></p>
<p>The two are never mixed. A reviewer sees the agent’s account and the independent result side by side, and the
mismatch is the interesting part.</p>
<h2 id="what-archbeagle-never-does">What ArchBeagle never does</h2>
<p>It never stores your source code. The database holds facts about the code: paths, names, line ranges, metrics, check
results, and the text of your ADRs and docs. Code is read only inside a sandboxed job, with no network while it
parses, and it isn’t kept.</p>
<p>It doesn’t decide your architecture for you either. On the free plan the pull request check reports and never blocks a
merge, and a model ArchBeagle drafts counts only after a person approves it.</p>
<p>And it isn’t a code reviewer. A code reviewer reads the diff. ArchBeagle reads the diff against the system. Teams use
both.</p>
<h2 id="try-it">Try it</h2>
<p>ArchBeagle is in early access, and during the launch every account gets every feature, free. It connects to your
GitHub organisation through a GitHub App.</p>
<ul>
<li><a href="https://archbeagle.com/invite">Request an invite</a></li>
<li><a href="https://archbeagle.com/docs">Read the docs</a></li>
<li>Follow along on <a href="https://x.com/archbeagle">X</a> and <a href="https://www.linkedin.com/company/archbeagle">LinkedIn</a></li>
</ul>
<p>We’d like to hear how your team keeps its architecture in check now that agents write so much of the code. Reply here
or write to <a href="mailto:support@archbeagle.com">support@archbeagle.com</a>.</p>
<p><em>The pull request, components and ADR in the pictures are sample data.</em></p>
]]></content:encoded>
    </item>
  </channel>
</rss>
