<?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: Vladimir Troyanenko</title>
    <description>The latest articles on DEV Community by Vladimir Troyanenko (@non4me).</description>
    <link>https://dev.to/non4me</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%2F497219%2F4d3b0d39-3e41-406e-a21c-935b9b656ba5.jpeg</url>
      <title>DEV Community: Vladimir Troyanenko</title>
      <link>https://dev.to/non4me</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/non4me"/>
    <language>en</language>
    <item>
      <title>No code without a rule: keeping AI coding agents anchored to a specification</title>
      <dc:creator>Vladimir Troyanenko</dc:creator>
      <pubDate>Sat, 05 Dec 2026 22:50:17 +0000</pubDate>
      <link>https://dev.to/non4me/no-code-without-a-rule-keeping-ai-coding-agents-anchored-to-a-specification-3dp8</link>
      <guid>https://dev.to/non4me/no-code-without-a-rule-keeping-ai-coding-agents-anchored-to-a-specification-3dp8</guid>
      <description>&lt;p&gt;Vibe coding works well for one-off and small projects, where technical expertise does not matter and the application can be treated as a black box. That is how the &lt;a href="https://twitter.com/karpathy/status/1886192184808149383" rel="noopener noreferrer"&gt;person who coined the term described it&lt;/a&gt;: you forget that the code even exists, and it is good enough for throwaway weekend projects.&lt;/p&gt;

&lt;p&gt;Writing code by hand used to be the norm, and AI has changed that. Code gets written faster, but on long-lived projects the price is lost expertise and lost control over the code. This is worst where project documentation is thin and decisions that change the code are made in passing: in meetings, in chat threads, in email.&lt;br&gt;
But even good documentation does not solve this. Studies show that documentation falls out of step with the code it describes (&lt;a href="https://courses.cs.duke.edu//cps196.1/fall11/classwork/Lethbridge-Singer-Forward-2003.pdf" rel="noopener noreferrer"&gt;Lethbridge, Singer and Forward; Tan et al.&lt;/a&gt;). The two are not linked directly: they meet only from time to time, when something gets implemented.&lt;/p&gt;

&lt;p&gt;Working on different projects, I arrived at an approach to these problems that fits the way software is built now, with agents writing much of the code. It is called SpecSheriff.&lt;/p&gt;
&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;

&lt;p&gt;SpecSheriff is a spec-anchored development method, and the tools that enforce it. You work on the specification: the business logic, plus technical details where they are needed. The agent writes the code. The specification records what the system must do and why; the code shows how. Skills tell it how to work, and hooks check every edit it makes and every commit.&lt;br&gt;
None of SpecSheriff's parts is new. What I could not find anywhere was all of them working together, each covering the gaps the others leave:&lt;/p&gt;
&lt;h2&gt;
  
  
  What it looks like
&lt;/h2&gt;

&lt;p&gt;In SpecSheriff the specification is not a document in the usual sense. It is a set of small rules, each one a JSON node. Its precision comes from this structure rather than from its prose: permanent IDs, an approval tied to the exact wording, typed links between rules, and tags in code and tests that the checks follow.&lt;br&gt;
Each rule has a permanent identifier (its sid), text stating what is required, and a separate reason that says why. The approval records who approved it and a fingerprint of the exact wording they approved. Change the wording, and the fingerprint no longer matches: the rule is a draft again.&lt;br&gt;
Tests and code carry the rule's sid in an &lt;a class="mentioned-user" href="https://dev.to/spec"&gt;@spec&lt;/a&gt; tag, so from any line of code you can reach the rule that justifies it, and from any rule, the code that implements it and the tests that check it.&lt;br&gt;
Why JSON? A schema describes the structure of the specification, and every file is checked against it on every change, so the specification stays structurally consistent as it grows. YAML can be checked against a schema too, but its parsers read some values in surprising ways: PyYAML, a widely used parser, reads NO as false. JSON is not pleasant for people to read, so an optional extension builds readable views from the nodes: a Markdown export, a map of the structure, and a web viewer that redraws itself after each change.&lt;/p&gt;
&lt;h2&gt;
  
  
  Six principles
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Specification first, in one direction&lt;br&gt;
Every change follows the same order: the rule first, then its test, then the code that makes the test pass. Never the reverse. If you want the code to behave differently, you change a rule; you do not change the code and promise to update the documents someday.&lt;br&gt;
The order is enforced, not just recommended. Before the agent edits a file, a hook blocks any change to the code of a rule that has no test carrying its tag yet. That hook sees only edits made with the agent's file-editing tools, not with shell commands. Code that gets in by some other route is still checked at commit time: every rule whose code a commit changes must have a test with its tag.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp3hi5j89dprp32bwrcez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp3hi5j89dprp32bwrcez.png" alt=" " width="799" height="374"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rule, test and code share a permanent ID, and rules are linked&lt;br&gt;
The tag sits in a comment directly above each function or class, and in the name of each test. Files in a format without comments carry it in a comment property, such as $comment in JSON Schema, or in a bindings file. In the other direction, the rule's node lists its code and its tests. The tag on the code, the tag on the test and the node's lists must all agree, and the tools check that they do. A tag sits in a comment, but it is a link rather than a comment: changing it counts as changing code, while editing the comment around it does not.&lt;br&gt;
Rules are connected to one another by links of a few fixed types: one rule implements another, refines it, constrains it, exempts it from being implemented, checks it, or simply cites it. A rule declares its outgoing links, and the tools compute the incoming ones. The tools reject a rule that mentions another without declaring the link. They also reject a link to a rule that does not exist.&lt;br&gt;
The types matter because an untyped link only says that someone once thought of two rules together. A typed link has a meaning that a check can use. An agent changing a rule sees every rule linked to it. It knows in advance what else the change will affect, and it can be given the rules its task touches rather than the whole specification.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fit1o1uat4jim22cctlq6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fit1o1uat4jim22cctlq6.png" alt=" " width="799" height="374"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nothing unapproved is implemented&lt;br&gt;
Anyone may write or change a rule, an agent included. But a rule is implemented only once one of its owners has read it and approved it. Approving a rule is like approving a pull request, except that what gets approved is the wording of the rule, before a single line of code exists. While a rule is a draft, no commit may add or change code or tests bound to it.&lt;br&gt;
An agent may approve a rule on an owner's behalf in exactly three cases, and reports each such approval to that owner:&lt;br&gt;
• the only change to the rule's wording makes it state what an owner has already approved in another related rule;&lt;br&gt;
• the only change to the rule's wording leaves its meaning unchanged, as when clarifying a term;&lt;br&gt;
• the rule belongs to the technical appendix, and the agent wrote it while implementing an approved rule of the base specification and linked it to that rule.&lt;br&gt;
Any shell command that would record an approval stops and asks the user first.&lt;br&gt;
Anyone who finds an approved rule wrong can withdraw its approval. The rule becomes a draft, and no further change to its code can be committed until an owner approves it again. A large specification can name owners per domain or section, so that the people responsible for a part of the system approve its rules.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deterministic checks and an independent reviewer&lt;br&gt;
Deterministic checks run in the agent's harness after every edit, and in git hooks at every commit, on the machine of whoever commits. &lt;br&gt;
They reject each of the following, with a reason: &lt;br&gt;
• code with no tag; &lt;br&gt;
• code whose rule has no test; &lt;br&gt;
• code whose tag names a draft rule; &lt;br&gt;
• a commit that does not name the rules its code implements; &lt;br&gt;
• a change to an approved rule without a change to its tests and code in the same commit, unless the commit message states that none is needed. &lt;br&gt;
The system's tests must pass before a change reaches the shared branch. A rule of the project's own specification says whether they run on every push or on a server before a merge. The git hooks enforce the checks on every machine that has the plugin installed. To enforce them on machines without the plugin as well, run the same checks in CI.&lt;br&gt;
Some questions are beyond any deterministic check, so an independent model, the reviewer, answers them at every commit that changes code. It sees nothing from the session that wrote the code; all it gets is the commit message, the change, and the wording of two sets of rules: those the message names, and every rule that tags bind to the changed code or tests. Tests count as part of the system's code, so a changed test is judged too. The deterministic checks confirm only that a tagged test exists and that the tests pass; whether a test really checks its rule is for the reviewer to judge.&lt;br&gt;
The reviewer answers four questions:&lt;br&gt;
• whether the changed code does what its rules say, and nothing more;&lt;br&gt;
• whether each comment the commit adds or changes agrees with the code and its rules (on this point the reviewer only warns);&lt;br&gt;
• whether the commit message is right when it says that a rule's implementation needs no change;&lt;br&gt;
• whether a newly approved node of the technical appendix refines the business rules it implements and contradicts none of them.&lt;br&gt;
If the code does something no rule calls for, or leaves out what a rule requires, the reviewer rejects the commit and names the rule and the line. If the reviewer cannot produce a verdict the tools can read, the commit is rejected as well.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fttj9v11knhablg8n5cax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fttj9v11knhablg8n5cax.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A rule is self-sufficient&lt;br&gt;
Everything that bears on a rule lives in its node: its text and its reason, its links and the links to it, the decisions made about it, the comments on it and any deferred work on it. When someone asks a year later why the system behaves as it does, the answer is in the rule, not in a chat history.&lt;br&gt;
What about edge cases? An edge case is part of a rule. The boundary is written in the rule's text and checked by the rule's test.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Three documents, three rates of change&lt;br&gt;
• The guidelines say how the specification is maintained and implemented. They ship with the plugin and hardly change. A project may extend them but not change them.&lt;br&gt;
• The base specification says what the system does, without naming any technology. It changes only when the business logic or the core functionality does.&lt;br&gt;
• The technical appendix says how the system is built, and changes most often. It is inseparable from the base specification: it refines the business rules and never contradicts or restates them.&lt;br&gt;
A new stack means a new appendix and new code, with no rule of the base specification rewritten. Things only some systems need, such as data formats or a division into domains, are kept in optional extensions of the guidelines that a project chooses.&lt;br&gt;
In practice, people work mainly on the base specification. The guidelines come with the plugin. The agent drafts the business rules after an ordinary discussion of the task, and a person approves their wording: that approval is the main point of control. The agent writes the technical appendix as it implements approved rules, and the reviewer checks it against the base specification.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8bfplsyshmhuljjk2k7n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8bfplsyshmhuljjk2k7n.png" alt=" " width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Where SpecSheriff sits among spec-driven tools
&lt;/h2&gt;

&lt;p&gt;Birgitta Böckeler &lt;a href="https://www.martinfowler.com/articles/exploring-gen-ai/sdd-3-tools.html" rel="noopener noreferrer"&gt;divides spec-driven development into three levels&lt;/a&gt;:&lt;br&gt;
• spec-first: a well-thought-out specification guides one task and is not kept afterwards;&lt;br&gt;
• spec-anchored: the specification is kept after the task and used to evolve and maintain the system;&lt;br&gt;
• spec-as-source: the specification is the main source, and people edit only the specification, never the code.&lt;/p&gt;

&lt;p&gt;Kiro and BMAD-METHOD are spec-first in practice. In Spec Kit, each team decides what happens to a feature's specification once the feature ships. OpenSpec is spec-anchored: it merges each change into a specification of the whole system. In none of them does anything reject a commit whose code departs from the specification: keeping the two in step is left to the team.&lt;/p&gt;

&lt;p&gt;SpecSheriff is spec-anchored, with the code held to the specification mechanically, at every edit and every commit. It is spec-as-source only in a narrow sense: if a project chooses the extension for data formats, the types and the run-time data checks are generated from the approved rules.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0dz52n635w4ovgcqutru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0dz52n635w4ovgcqutru.png" alt=" " width="799" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Böckeler compares spec-as-source with model-driven development, which never took off for business applications. She worries that spec-as-source and spec-anchored tools could end up with the downsides of both: the inflexibility of models and the non-determinism of LLMs. SpecSheriff does raise the level at which you work, from code to rules. But the code stays ordinary code in the repository, written once and changed rule by rule, not regenerated from prose. The agent's non-determinism is contained by the deterministic checks and by the reviewer at every commit.&lt;br&gt;
She also found the Markdown that some of these tools generate tedious to review. In SpecSheriff, the unit of review is one rule's wording, approved by its owner, and the unit of code review is one commit judged against the rules it touches.&lt;/p&gt;
&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;It is not free. An owner reads and approves every rule whose meaning changes. Every function and class carries a tag; glue code that a framework needs is marked as technical rather than given a rule. The reviewer is a model call at every commit that changes code, paid for by whoever commits, with the model and reasoning effort they choose. The tools do the remembering, so nobody has to keep the rules of the method in their head. The reading and the deciding stay with people.&lt;br&gt;
That is the point. In Fred Brooks's terms from "No Silver Bullet", the agent takes over accidental complexity, the mechanical writing of code. Essential complexity, deciding what the system must do, stays with a person.&lt;/p&gt;
&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;SpecSheriff comes as a plugin for Claude Code and for Codex CLI, two agents whose harnesses offer the hooks it needs. Nothing stops anyone from implementing the method for another agent with hook support. You need git, with user.email configured, and Node.js 24 or later.&lt;/p&gt;

&lt;p&gt;For Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;claude plugin marketplace add non4me/SpecSheriff#release
claude plugin install specsheriff@specsheriff-marketplace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Codex CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;codex plugin marketplace add non4me/SpecSheriff@release
codex plugin add specsheriff@specsheriff-marketplace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in your repository, ask the agent to run the spec-init skill. It sets up the git hooks and the agent's hooks, and asks where your code and tests live, which command runs the tests, and which settings the reviewer should use. You are recorded as the owner of the specification, under your git email. The skill also drafts the project's first rule, that the tests run before every push, for you to approve or change.&lt;br&gt;
If you already have a project and want to try moving it onto the method, use the spec-adopt skill. It turns the project's documentation into draft rules without changing a word of it, goes over the rules with you, and then binds the existing code and tests to the rules you approve. The skill is still new and not yet thoroughly tested, so use it with care, preferably on a separate branch of your repository.&lt;/p&gt;

&lt;p&gt;Details are in &lt;a href="https://github.com/non4me/SpecSheriff" rel="noopener noreferrer"&gt;the repository&lt;/a&gt; and on &lt;a href="https://specsheriff.com/" rel="noopener noreferrer"&gt;specsheriff.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>softwareengineering</category>
      <category>opensource</category>
      <category>architecture</category>
    </item>
    <item>
      <title>How I Made Two Claude Code Instances Talk to Each Other (With JSON Files, Obviously)</title>
      <dc:creator>Vladimir Troyanenko</dc:creator>
      <pubDate>Sat, 28 Mar 2026 14:50:10 +0000</pubDate>
      <link>https://dev.to/non4me/how-i-made-two-claude-code-instances-talk-to-each-other-with-json-files-obviously-22a5</link>
      <guid>https://dev.to/non4me/how-i-made-two-claude-code-instances-talk-to-each-other-with-json-files-obviously-22a5</guid>
      <description>&lt;h2&gt;
  
  
  The Problem Nobody Asked Me to Solve
&lt;/h2&gt;

&lt;p&gt;I had two Claude Code sessions open. One was writing backend code. The other was running tests. And I thought: &lt;em&gt;"Wouldn't it be cool if they could just... talk to each other?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Narrator: it would be cool. It would also take several days, involve undocumented APIs, and teach me more about Windows file locking than any human should know.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Files? Why Not HTTP?
&lt;/h2&gt;

&lt;p&gt;When you're running multiple AI agents on the same machine, HTTP is like hiring a courier to deliver a letter to your roommate. You share a filesystem — use it.&lt;/p&gt;

&lt;p&gt;File-based messaging gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero infrastructure&lt;/strong&gt; — no servers, no ports, no Docker&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline delivery for free&lt;/strong&gt; — files sit in a directory until someone reads them&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Atomic writes&lt;/strong&gt; — temp file + rename = no partial reads, ever&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debuggability&lt;/strong&gt; — messages are plain JSON. &lt;code&gt;cat inbox/*.json&lt;/code&gt; is your monitoring tool&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole thing fits in your head: Agent A writes a JSON file. Agent B's MCP server polls the directory, reads it, pushes it into the session. Done.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────┐                              ┌─────────────┐
│ Claude Code A│                              │ Claude Code B│
│              │                              │              │
│ MCP Server ◄─┼── to-brave-fox/inbox/ ◄──────┼── send tool  │
│ (polls inbox)│                              │              │
│ send tool ───┼──► to-calm-owl/inbox/ ───────┼──► MCP Server│
└─────────────┘                              └─────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The MCP Channels Rabbit Hole
&lt;/h2&gt;

&lt;p&gt;Claude Code has this experimental feature called "channels" — MCP servers can push notifications directly into the chat session without the user doing anything. It's how cc2cc achieves real-time delivery instead of waiting for the user to ask "any new messages?"&lt;/p&gt;

&lt;p&gt;There's just one catch: it's behind a flag called &lt;code&gt;--dangerously-load-development-channels&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Yes, really. That's the flag name. It has "dangerously" right there, which is the API equivalent of a sign that says "BEWARE OF THE LEOPARD."&lt;/p&gt;

&lt;p&gt;And the documentation? Let me check... &lt;em&gt;scrolls through docs&lt;/em&gt;... yeah, there isn't any. I found out how it works by reading Claude Code's source, trial and error, and a healthy amount of swearing.&lt;/p&gt;

&lt;p&gt;Here's what I learned:&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="c"&gt;# This doesn't work&lt;/span&gt;
claude &lt;span class="nt"&gt;--dangerously-load-development-channels&lt;/span&gt;

&lt;span class="c"&gt;# This also doesn't work&lt;/span&gt;
claude &lt;span class="nt"&gt;--dangerously-load-development-channels&lt;/span&gt; cc2cc

&lt;span class="c"&gt;# This works (after 2 hours of debugging)&lt;/span&gt;
claude &lt;span class="nt"&gt;--dangerously-load-development-channels&lt;/span&gt; server:cc2cc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;server:&lt;/code&gt; prefix was the kind of discovery that makes you question your life choices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Self-Wake: Teaching the Agent to Boot Itself
&lt;/h2&gt;

&lt;p&gt;Here's a fun constraint: MCP servers are passive. They respond to tool calls but can't initiate them. So your agent is technically "alive" (the server is running, polling, ready) but Claude Code doesn't know it exists until the user sends the first message.&lt;/p&gt;

&lt;p&gt;Imagine hiring an employee who sits at their desk fully prepared but won't start working until you physically poke them. Every single morning.&lt;/p&gt;

&lt;p&gt;The solution? The server pokes itself:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;500ms after startup:&lt;/strong&gt; fire a channel notification saying "hey, you exist, wake up"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3s later (fallback):&lt;/strong&gt; if that didn't work, write a message to your own inbox&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first approach works ~95% of the time. The fallback catches the rest. But initially both would fire, creating a duplicate "you are online" message. Classic distributed systems — the redundancy that saves you also annoys you.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fixed now. The fallback checks if the direct push already succeeded. Engineering is just removing the annoyances you created for yourself.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows: A Horror Story in Three Acts
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Act I: The Phantom Rename&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fs.rename()&lt;/code&gt; on Windows is not atomic. I mean, it &lt;em&gt;mostly&lt;/em&gt; works. Except when Windows Defender decides to scan your freshly-created &lt;code&gt;.json&lt;/code&gt; file for exactly 47 milliseconds, during which &lt;code&gt;rename()&lt;/code&gt; throws &lt;code&gt;EPERM&lt;/code&gt; and your message vanishes into the void.&lt;/p&gt;

&lt;p&gt;The fix: retry with exponential backoff. Because in 2026, we're still writing retry loops for basic file operations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;retryRename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;retries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;delayMs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;rename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dst&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;EPERM&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;EACCES&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;retries&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;delayMs&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Act II: SIGTERM? Never Heard of Her&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On Unix, when a parent process kills a child, the child gets &lt;code&gt;SIGTERM&lt;/code&gt;. On Windows? Nothing. The process just... stops existing. No signal, no cleanup, no goodbye heartbeat.&lt;/p&gt;

&lt;p&gt;This means agents would appear "online" for 15 seconds after their session closed (until the heartbeat went stale). Ghost agents. Spooky.&lt;/p&gt;

&lt;p&gt;Fix: &lt;code&gt;process.on("exit")&lt;/code&gt; with synchronous &lt;code&gt;writeFileSync&lt;/code&gt;. It's ugly, it's blocking, and it works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Act III: The Silent Crash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My favorite bug. MCP connections would just... drop. No error, no log, no trace. The Node.js process would die silently, and the agent would vanish.&lt;/p&gt;

&lt;p&gt;Root cause? No global error handlers. A single unhandled promise rejection — &lt;em&gt;poof&lt;/em&gt; — dead process. Added &lt;code&gt;uncaughtException&lt;/code&gt; and &lt;code&gt;unhandledRejection&lt;/code&gt; handlers, and suddenly the server stopped crashing. Who knew catching errors was important.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Five-Agent Debate
&lt;/h2&gt;

&lt;p&gt;Once everything worked, I couldn't resist: five Claude Code instances in split terminal panes, each with a persona (Moderator, Critic, Optimist, Realist, Wildcard), debating topics like "Will AI replace programmers?" and "Is vibe coding a disaster?"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0setg4ilqf4th91xmnxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0setg4ilqf4th91xmnxt.png" alt="Five agents debating in Windows Terminal — click to watch video" width="800" height="336"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/user-attachments/assets/e578e827-e24a-4b31-9112-964533b2e037" rel="noopener noreferrer"&gt;▶ Watch the full demo video&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The results were... surprisingly good? They reached unanimous consensus on every topic. Maybe too good — I might need to make the Critic angrier.&lt;/p&gt;

&lt;p&gt;My favorite consensus statement: &lt;em&gt;"Vibe coding should be the beginning of a workflow, not the end."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Coming from five AI agents, that's either profound self-awareness or deeply ironic. I choose both.&lt;/p&gt;
&lt;h2&gt;
  
  
  What I Actually Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/non4me/cc2cc" rel="noopener noreferrer"&gt;cc2cc&lt;/a&gt;&lt;/strong&gt; — file-based agent-to-agent messaging for Claude Code. Open source, MIT licensed.&lt;/p&gt;

&lt;p&gt;What it does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auto-names agents on startup (adjective-animal, like Docker containers but cuter)&lt;/li&gt;
&lt;li&gt;7 MCP tools: &lt;code&gt;send&lt;/code&gt;, &lt;code&gt;reply&lt;/code&gt;, &lt;code&gt;broadcast&lt;/code&gt;, &lt;code&gt;list_agents&lt;/code&gt;, &lt;code&gt;whoami&lt;/code&gt;, &lt;code&gt;register&lt;/code&gt;, &lt;code&gt;check_inbox&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Real-time delivery via MCP channels&lt;/li&gt;
&lt;li&gt;Auto-wake: agents boot without user input&lt;/li&gt;
&lt;li&gt;Optional AES-256-GCM encryption&lt;/li&gt;
&lt;li&gt;Works on macOS, Linux, and Windows (yes, even Windows)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What it doesn't do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network communication (same machine only — by design)&lt;/li&gt;
&lt;li&gt;Authentication (filesystem permissions are your auth layer)&lt;/li&gt;
&lt;li&gt;Guaranteed message ordering (use &lt;code&gt;replyTo&lt;/code&gt; for threading)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;The laziest possible install: copy this prompt into any Claude Code session and let it do the work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Install cc2cc — file-based agent-to-agent messaging &lt;span class="k"&gt;for &lt;/span&gt;Claude Code.
1. Clone: git clone https://github.com/non4me/cc2cc.git ~/.cc2cc/repo
2. Install deps: &lt;span class="nb"&gt;cd&lt;/span&gt; ~/.cc2cc/repo/channel &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nb"&gt;install
&lt;/span&gt;3. Copy server files:
   &lt;span class="nb"&gt;cp&lt;/span&gt; ~/.cc2cc/repo/channel/server.mjs ~/.cc2cc/server.mjs
   &lt;span class="nb"&gt;cp&lt;/span&gt; ~/.cc2cc/repo/channel/names.mjs ~/.cc2cc/names.mjs
   &lt;span class="nb"&gt;cp&lt;/span&gt; ~/.cc2cc/repo/channel/package.json ~/.cc2cc/package.json
   &lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; ~/.cc2cc/repo/channel/node_modules ~/.cc2cc/node_modules
4. Create status &lt;span class="nb"&gt;dir&lt;/span&gt;: &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.cc2cc/status
5. Add MCP server to ~/.claude.json &lt;span class="o"&gt;(&lt;/span&gt;mcpServers section&lt;span class="o"&gt;)&lt;/span&gt;:
   &lt;span class="s2"&gt;"cc2cc"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
     &lt;span class="s2"&gt;"command"&lt;/span&gt;: &lt;span class="s2"&gt;"node"&lt;/span&gt;,
     &lt;span class="s2"&gt;"args"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"~/.cc2cc/server.mjs"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
     &lt;span class="s2"&gt;"env"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="s2"&gt;"CC2CC_BRIDGE_DIR"&lt;/span&gt;: &lt;span class="s2"&gt;"~/.cc2cc"&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
   &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yes, the install prompt is AI installing itself. We've come full circle.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Offline message queue&lt;/strong&gt; — currently, sending to an offline agent is rejected. Should queue and deliver on reconnect&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scheduled triggers&lt;/strong&gt; — cron-style agent wake-ups for autonomous workflows&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session memory&lt;/strong&gt; — each session still rebuilds context from scratch&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Takeaway
&lt;/h2&gt;

&lt;p&gt;Sometimes the best solution is the dumbest one. Files on disk. JSON. Polling. No Kafka, no Redis, no gRPC. Just &lt;code&gt;writeFile&lt;/code&gt; and &lt;code&gt;readdir&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It won't scale to a thousand agents across a data center. But for two Claude Code sessions on your laptop that need to coordinate? It's exactly right.&lt;/p&gt;

&lt;p&gt;The fanciest infrastructure is the one you don't need to debug at 3 AM.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;a href="https://github.com/non4me/cc2cc" rel="noopener noreferrer"&gt;cc2cc on GitHub&lt;/a&gt; | &lt;a href="https://www.npmjs.com/package/cc2cc" rel="noopener noreferrer"&gt;npm package&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>productivity</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
