<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[cardene]]></title><description><![CDATA[cardene]]></description><link>https://cardene777.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 23:06:09 GMT</lastBuildDate><atom:link href="https://cardene777.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What I Changed When Parallel AI Coding Became Hard to Follow]]></title><description><![CDATA[HTML comparisons, reasoned recommendations, and a personal clone: how I organize the decisions that parallel AI coding sends back to me.]]></description><link>https://cardene777.hashnode.dev/what-i-changed-when-parallel-ai-coding-became-hard-to-follow</link><guid isPermaLink="true">https://cardene777.hashnode.dev/what-i-changed-when-parallel-ai-coding-became-hard-to-follow</guid><category><![CDATA[AI]]></category><category><![CDATA[tooling]]></category><dc:creator><![CDATA[Cardene]]></dc:creator><pubDate>Sat, 28 Nov 2026 11:11:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0797dc590e2c5f9de7854f/603d5953-8c69-4cab-9685-cf16e42a4db1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I develop software across multiple LLM coding sessions. As more work runs in parallel, more decisions come back to me. I find it harder to follow them carefully, and my own work becomes less deliberate.</p>
<p>I have been working on three ways to present that work: HTML comparisons, recommendations with their assumptions, and a personal “clone” that consults principles I have approved. Around them are procedures for routing questions, retaining decisions, checking operations, and maintaining those procedures themselves. This article examines what those mechanisms can take off my plate and what still comes back to me. I have not measured a reduction in cognitive load.</p>
<p>The HTML review sheets and personal clone are features of <code>ikkan</code>, my tool for organizing AI-assisted development into steps and keeping decisions and acceptance criteria. I manage agent settings and scheduled tasks on this PC in a separate repository, <code>agent-configs</code>.</p>
<img src="https://images.cardene.dev/ai-session-decision-load-pub-2edc46a-f00.webp" alt="A decision record connects a request, the current change, its checks, and the remaining choice." style="display:block;margin:0 auto" />

<h2>The checking work that parallel execution leaves behind</h2>
<img src="https://images.cardene.dev/ai-session-decision-load-pub-2edc46a-f01.webp" alt="Parallel results still return as distinct things for the same person to check." style="display:block;margin:0 auto" />

<p>A session here is a conversation with a coding agent working on a request. Two agents can implement unrelated changes at once. When their results arrive, I still need to connect each one to its request.</p>
<p>Suppose one agent changes an article list while another edits wording on a different screen. A question about the wording arrives while I am checking the list. Answering means recovering the second task's assumptions, then returning to the first. This is an illustrative situation, not a record of an incident I measured.</p>
<p>The underlying difficulty predates coding agents. Bainbridge's <em>Ironies of Automation</em> discusses the supervision and intervention left to people after automation. Leroy's research describes attention remaining on an earlier task after a switch. More recently, a survey by Lee and colleagues reported work shifting toward verification and integration among generative-AI users. That survey concerns self-reported behavior, rather than a causal experiment on coding-session counts. The position paper <em>AI Agents Push Humans Out of the Loop</em> also asks what enables a person to exercise judgment, beyond placing them in an approval path.</p>
<p>None of these sources establishes an optimal session count or measures the effects of my setup.</p>
<p>To make the setup concrete, I will use one fictional change throughout: an article list should show only published articles, in their existing order. The procedures below exist in the current local instructions and implementation. Their presence is evidence of a design, not proof that every session follows it or that it improves my performance.</p>
<h2>Putting the comparison where I make the decision</h2>
<img src="https://images.cardene.dev/ai-session-decision-load-pub-2edc46a-f02.webp" alt="The fictional list change removes B while preserving the order of A and C." style="display:block;margin:0 auto" />

<p>A written report can leave most of the comparison in my head. “Drafts are now hidden” does not show whether the remaining articles moved, whether the screenshot is current, or which conditions were checked.</p>
<p>My review-sheet procedure can put the request, the current state, the proposed state, and the choices into one HTML document. For the running example, the before view contains A, B, and C. A and C are published; B is a draft. The after view should contain A followed by C. A view that merely removes B while sorting C ahead of A fails the same request.</p>
<h3>Comparing before and after</h3>
<p>The comparison needs a common frame. I want to inspect the same list, at the same relevant viewport, with the publication states visible. A table can establish the expected membership and order; the actual screens let me judge appearance. Neither replaces tests for conditions that the screens cannot expose.</p>
<table>
<thead>
<tr>
<th>Article</th>
<th>Publication state</th>
<th>Before</th>
<th>Expected after</th>
</tr>
</thead>
<tbody><tr>
<td>Article A</td>
<td>Published</td>
<td>First</td>
<td>First</td>
</tr>
<tr>
<td>Article B</td>
<td>Draft</td>
<td>Second</td>
<td>Absent</td>
</tr>
<tr>
<td>Article C</td>
<td>Published</td>
<td>Third</td>
<td>Second</td>
</tr>
</tbody></table>
<p>When a sheet covers several decisions, tabs separate the questions. A question I can answer from one sentence stays in chat. Opening another document has a cost too; making an HTML page for everything would add a new queue.</p>
<p>The sheet also needs to identify the change it represents. A comparison built from an old revision can show the wrong state, even when its layout is clear.</p>
<h3>Keeping the decision and the place to resume</h3>
<p>The decision should stay attached to the acceptance conditions and the result I inspected. For the list example, “published articles only” is too little to resume from. The record also needs to say whether order was checked, against which revision, and what remains unverified. A changed diff does not inherit an earlier passing result automatically.</p>
<p>My environment has rules for retaining approved decisions, changes and their reasons, unfinished work, and the next action when a conversation is condensed. An installed repository-progress tool can gather work and stalls into one view. An unavailable state remains unknown rather than becoming “nothing to do.” These are ways to leave a path back to the work without relying on my memory of a conversation's closing message.</p>
<p>Research on a “ready-to-resume” plan provides related context. Its tested effects concern the interrupting task; I cannot turn that finding into a measured reduction in my own time to resume the original task. Here, I want to check whether the record contains enough to resume the review.</p>
<h2>Giving a recommendation its assumptions</h2>
<img src="https://images.cardene.dev/ai-session-decision-load-pub-2edc46a-f03.webp" alt="Filtering data before delivery and hiding a delivered item satisfy different requirements." style="display:block;margin:0 auto" />

<p>An HTML sheet can make alternatives visible while leaving their evaluation entirely to me. The local decision rules therefore ask for a recommendation with reasons, effects, and risks. Its rating ranks the choices. It is not a calibrated probability of correctness.</p>
<p>For the list change, an agent might propose filtering articles when selecting data, or hiding draft entries in the rendered interface. Those options answer different requirements. If unpublished data must never reach the browser, hiding an entry after delivery is insufficient. If the question concerns only appearance, that additional requirement has not yet been established. The recommendation needs to make its assumption visible before asking me to accept it.</p>
<p>I want the alternative's useful condition alongside the favored choice. That gives me something to challenge: “Do we actually require this data boundary?” A long explanation alone does not show that its premise was checked.</p>
<p>Explanations can also increase trust in a wrong output. Microsoft's HAX guidance explicitly warns about this risk. A high rating and a plausible paragraph can become a shortcut to agreement rather than a basis for judgment.</p>
<p>There is another coupling in my setup. The current rules tell the agent to align its recommendation with the option the clone predicts I would choose. Technical suitability and personal preference are different questions, but this presentation links them. Their agreement is not independent corroboration. I still need to know which requirement supports the recommendation and which personal principle supports the prediction.</p>
<h2>Consulting my principles without treating a prediction as permission</h2>
<img src="https://images.cardene.dev/ai-session-decision-load-pub-2edc46a-f04.webp" alt="Approved principles support a prediction; an unavailable prediction still leaves a question for the person." style="display:block;margin:0 auto" />

<p>Repeated choices often involve priorities I have already explained. For those, the clone consults approved principles and returns the option I am likely to choose, with a reason and a reference to the supporting section. It is a decision aid, rather than another account of what is technically true.</p>
<h3>Approved principles and examples</h3>
<p>An approved principle and a proposed addition have different roles. Producing a draft of a principle does not make it my position. The prediction uses the approved definition.</p>
<p>The implementation also separates retrieving examples from asking a model to predict a choice. The <code>recall</code> path retrieves matching examples without calling an LLM. The <code>ask</code> path makes a model call under its own conditions. This is not a claim that every question loads all of my history.</p>
<p>Consider whether the list change needs an HTML sheet for a single text question. A principle about avoiding unnecessary interactions could help explain the likely choice. That is an example of the kind of question the system can support, not an answer obtained by running the clone for this article.</p>
<p>The reference matters more than a bare prediction. It lets me check whether the earlier principle applies to this decision, or whether the situation is a reason to change it.</p>
<h3>When the prediction is unavailable or out of scope</h3>
<p>A normal prediction requires the feature to be enabled and an approved definition to be available. The review-sheet path can continue without a prediction when those conditions are absent. The question and evidence still need to reach me.</p>
<p>Remembered principles cannot establish the current contents of a screen. A new policy also needs my judgment. Predicting what I would select does not authorize an operation on my behalf.</p>
<p>The separate stand-in-answer path has additional measurement and model conditions. I have not inspected private definitions, current activation flags, or its operating accuracy for this article. The implementation's existence does not establish that it is active or reliable in my present environment.</p>
<p>I want fewer repeated explanations of my priorities while retaining a usable question when prediction is absent, the evidence is incomplete, or I want to choose differently.</p>
<h2>Organizing the work around the decision</h2>
<img src="https://images.cardene.dev/ai-session-decision-load-pub-2edc46a-f05.webp" alt="A parent conversation routes an answer back to the task that asked the question." style="display:block;margin:0 auto" />

<p>Comparison and prediction do little for the work of visiting conversations, remembering precautions, and noticing a stopped routine. The surrounding procedures address those jobs separately.</p>
<h3>A question channel and separate work areas</h3>
<p>The parallel-work procedure can collect questions in a parent conversation and route my answers back to the relevant worker. Each question still needs a task identity: an answer about the list must not become an answer about another screen. When the available tools cannot support the delegated arrangement, the documented fallback is sequential work in one conversation.</p>
<p>Separate working areas address a different problem. Changes integrate one at a time, and a later change incorporates the earlier one before checks run on the combined result. A rule against overlapping Codex runs in one working area does not provide a universal lock against every writer.</p>
<p>Routing and isolation still leave failure modes. A summary can omit a condition; two working areas can change the same requirement. Task identities and integration dependencies therefore belong in the record, alongside the answer itself.</p>
<h3>Shared instructions and operation checks</h3>
<p>Common instructions give recurring procedures one source. They reduce the amount I have to restate across agents, although each product can load instructions and enforce permissions differently.</p>
<p>Hooks address conditions that a program can check at an operation boundary, such as a restricted file access or a dangerous command. Their protection covers the events and routes they actually inspect. Passing those checks does not settle whether a proposed product change matches my intent.</p>
<p>The useful division is between a repeatable condition that a tool can check and a decision whose purpose or impact I need to understand. Moving the first into a check can remove a memory burden without pretending that the second has disappeared.</p>
<h3>Detecting stops and changing a failed approach</h3>
<p>Installed maintenance procedures can inspect expected artifacts and termination states, and a status tool can collect recent runs and upcoming times. A failed inspection must remain distinguishable from a healthy result. I have not verified the current registration or recent success of those scheduled routines here.</p>
<p>Implementation failures have a separate debugging procedure. After repeated failure with the same approach—twice in the documented case—the procedure turns to recording symptoms, building a minimal reproduction, and testing a hypothesis. If drafts remain in the list, that means examining the input and executed path before adding another condition.</p>
<p>Checking whether the automation is running and checking whether the list change works are separate responsibilities. Neither result can stand in for the other.</p>
<h2>Reviewing the cost of the remedies</h2>
<img src="https://images.cardene.dev/ai-session-decision-load-pub-2edc46a-f06.webp" alt="A detected duplicate becomes a candidate for review, not an automatic deletion." style="display:block;margin:0 auto" />

<p>Every mechanism above becomes something to maintain. The HTML can go stale. Recommendations can arrive faster than I read them. Instructions can accumulate exceptions, and checks can generate more reports to inspect.</p>
<h3>Pruning rules and choosing checks</h3>
<p>The installed pruning procedure examines instruction size, duplication, changes over time, and broken references. Its interactive review starts when I invoke it and returns candidates to remove or relocate. A separate periodic command can measure size without an LLM and issue notices under its deployment conditions. It does not make instruction bytes a measurement of my cognitive load, or turn a duplicate into an automatic deletion.</p>
<p>I apply the same distinction to verification work. The article procedure scopes checks to the change and uses a defined review round; an article-only change does not call for unrelated application-wide tests. A shorter report still needs to identify the change, the checks that ran, and the conditions left unverified.</p>
<p>The reporting rule also puts the result first and links back to its evidence. That leaves an entry point for inspecting the detail rather than reconstructing it from a long summary.</p>
<h3>What returns to me and how much runs at once</h3>
<p>Before asking me, an agent should investigate facts it can establish itself. A question that depends on an earlier answer should wait for that answer. Progress inside an approved scope does not need a fresh permission request at every step; a change of purpose or impact returns to me. Explicitly delegated autonomous work also needs limits and stopping conditions. Neither my absence nor a clone's prediction supplies an extra authorization.</p>
<p>Fewer interactions are not automatically better. Buçinca and colleagues' experiment on interventions intended to reduce overreliance found a trade-off with participants' subjective preferences. I cannot transfer its effect size into coding work, but it gives me a reason to preserve opportunities to think rather than remove every pause.</p>
<p>One operating change I would try is starting less new work when decisions accumulate. I have not verified such an automatic control on this PC.</p>
<p>To evaluate it, I would record pending decisions and the time needed to resume comparable tasks, alongside reversed decisions and missed acceptance conditions. Those measurements have not been made. I have no improvement percentage or safe session count to report.</p>
<h2>Conclusion</h2>
<p>For the next list change, the record I want is concrete: the request, A–B–C before the change, A–C afterward, the inspected revision, the condition behind the recommendation, and any decision still waiting for me. If those decisions keep accumulating, I can reduce incoming work instead of asking a more polished interface to make the queue disappear.</p>
<h2>References</h2>
<ul>
<li>Lisanne Bainbridge — Ironies of Automation (1983)</li>
</ul>
<p><a href="https://tc.ifac-control.org/4/1/newsletter/ironies-of-automation/@@download/file/Bainbridge1983_Automatica_Ironies%20of%20automation.pdf">https://tc.ifac-control.org/4/1/newsletter/ironies-of-automation/@@download/file/Bainbridge1983_Automatica_Ironies%20of%20automation.pdf</a></p>
<ul>
<li>Sophie Leroy — Attention-residue research</li>
</ul>
<p><a href="https://www.uwb.edu/faculty/sophie-leroy/">https://www.uwb.edu/faculty/sophie-leroy/</a></p>
<ul>
<li>Lee et al. — The Impact of Generative AI on Critical Thinking (CHI 2025)</li>
</ul>
<p><a href="https://www.microsoft.com/en-us/research/publication/the-impact-of-generative-ai-on-critical-thinking-self-reported-reductions-in-cognitive-effort-and-confidence-effects-from-a-survey-of-knowledge-workers/">https://www.microsoft.com/en-us/research/publication/the-impact-of-generative-ai-on-critical-thinking-self-reported-reductions-in-cognitive-effort-and-confidence-effects-from-a-survey-of-knowledge-workers/</a></p>
<ul>
<li>AI Agents Push Humans Out of the Loop — A position paper</li>
</ul>
<p><a href="https://www.microsoft.com/en-us/research/publication/ai-agents-push-humans-out-of-the-loop/">https://www.microsoft.com/en-us/research/publication/ai-agents-push-humans-out-of-the-loop/</a></p>
<ul>
<li>University of Washington — A ready-to-resume plan and interruptions</li>
</ul>
<p><a href="https://www.washington.edu/news/2018/01/16/task-interrupted-a-plan-for-returning-helps-you-move-on/">https://www.washington.edu/news/2018/01/16/task-interrupted-a-plan-for-returning-helps-you-move-on/</a></p>
<ul>
<li>Microsoft HAX Toolkit — Make clear why the system did what it did</li>
</ul>
<p><a href="https://www.microsoft.com/en-us/haxtoolkit/guideline/make-clear-why-the-system-did-what-it-did/">https://www.microsoft.com/en-us/haxtoolkit/guideline/make-clear-why-the-system-did-what-it-did/</a></p>
<ul>
<li>Buçinca et al. — To Trust or to Think (2021)</li>
</ul>
<p><a href="https://arxiv.org/abs/2102.09692">https://arxiv.org/abs/2102.09692</a></p>
]]></content:encoded></item><item><title><![CDATA[Why musubi Stores Both a Version Range and a Fingerprint]]></title><description><![CDATA[How musubi detects changes to shared skill instructions, formats, and checks even when a version range still matches.]]></description><link>https://cardene777.hashnode.dev/why-musubi-stores-both-a-version-range-and-a-fingerprint</link><guid isPermaLink="true">https://cardene777.hashnode.dev/why-musubi-stores-both-a-version-range-and-a-fingerprint</guid><category><![CDATA[AI]]></category><category><![CDATA[tooling]]></category><dc:creator><![CDATA[Cardene]]></dc:creator><pubDate>Fri, 27 Nov 2026 02:19:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0797dc590e2c5f9de7854f/fd8e2990-79d6-4b0c-a916-9f47eda4dd59.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<img src="https://images.cardene.dev/musubi-fingerprint-experiment-f00-2a2910b61112.webp" alt="Consumer range ^1.0.0 accepts provider 1.0.0 while stored and edited fingerprints differ; curves compare values, not data transfer." style="display:block;margin:0 auto" />

<p>A shared design format can change without its declared version changing. In my agent-shuriken project, the <code>contract-design</code> skill depends on a format supplied by another skill, <code>design-doc</code>. It also uses a separate script from that skill to check the finished design before implementation and testing. Both references in <code>musubi.json</code> accept <code>^1.0.0</code>, but they store separate fingerprints.</p>
<p>musubi is the CLI that checks these declared dependencies. The design skill instructs the agent to run <code>musubi check</code> before reading the shared content if the command is available, and to stop if the check fails.</p>
<p><a href="https://github.com/cardene777/agent-shuriken">https://github.com/cardene777/agent-shuriken</a></p>
<p>If the shared format changes but its declared version stays at 1.0.0, the consumer's range still accepts it. The agent may nevertheless read instructions that have never been checked with that consumer. I designed musubi to keep the accepted version range and the fingerprint of the previously checked content together.</p>
<p><a href="https://github.com/cardene777/musubi">https://github.com/cardene777/musubi</a></p>
<p>To follow that decision, the examples below use musubi's smaller design-document fixture at commit <code>88a82fefd5b234f8f7fd7cae2ab4a82861722715</code>. The version range expresses which versions the consumer accepts; the fingerprint records the exact inputs it checked. The consumer's examples then help decide whether to accept changed inputs.</p>
<p>The experiments were run for this article in disposable directories, not in a deployed service or a coding-agent session. The test results come from actual Node.js processes.</p>
<h2>A compatible version can still contain a change</h2>
<img src="https://images.cardene.dev/musubi-fingerprint-experiment-f01-feb788ecfa86.webp" alt="Sample versions 1.0.0, 1.0.1 and 1.9.9 are inside the accepted ^1.0.0 boundary; 2.0.0 is outside; fingerprints are checked separately." style="display:block;margin:0 auto" />

<p>The example repository has a <code>design-doc</code> skill that provides a format called <code>design</code>. Its consumer, <code>api-design</code>, follows that format when producing API design documents. Here, the provider supplies shared content, while the consumer declares which content it follows. The provider declares the version, format path and JSON check path in its own <code>musubi.json</code> under <code>provides.design</code>.</p>
<pre><code class="language-text">skills/
├── design-doc/
│   ├── SKILL.md
│   ├── musubi.json
│   ├── formats/design.md
│   └── checks/design.json
└── api-design/
    ├── SKILL.md
    ├── musubi.json
    └── examples/orders-api.md
</code></pre>
<p>The consumer records the accepted range and checked fingerprint together in <code>examples/skills/api-design/musubi.json</code>. It also names the example document to check against the provider's rules.</p>
<pre><code class="language-json">{
  "musubi": "2026-11-19",
  "follows": {
    "design-doc/design": {
      "version": "^1.0.0",
      "integrity": "sha256-yNSwpBT+xXEV5bGBqedpHmjWIHVi+JaAnRATAJ0s7wM=",
      "examples": [
        "examples/orders-api.md"
      ]
    }
  }
}
</code></pre>
<p>The range <code>^1.0.0</code> accepts declared versions from 1.0.0 up to, but excluding, 2.0.0. The range is a compatibility policy, not proof of semantic compatibility. The fingerprint is the SHA-256 digest, encoded in base64, of the provider content as musubi defines it. A different fingerprint does not establish whether a change is harmful; it identifies a difference in the hashed inputs.</p>
<h3>Content-level dependencies</h3>
<p>The reference identifies one content item, <code>design-doc/design</code>, rather than accepting everything that happens to live in the provider's directory. The provider's <code>provides.design</code> entry selects the format and its check; the consumer's <code>follows</code> entry records the range, fingerprint and example files for that item. Here, <code>examples/orders-api.md</code> belongs to the consumer. It is a maintained example of what that particular skill should produce, so different consumers can check different examples against the same format.</p>
<p>The two references in the real <code>contract-design</code> introduction use this separation for another reason. Reading the design format and running the finished-document verification script are different operations, even though both resources come from <code>design-doc</code>. Separate content entries let a consumer identify the exact file it needs for each operation. Because the provider's loading instructions are shared, however, those separate entries do not necessarily have independent fingerprint inputs; a common <code>SKILL.md</code> edit can affect both.</p>
<h3>Version policy and checked content</h3>
<p>The project's architecture decision record (ADR) 0003 records the design decision and rejected alternatives, including three ways to store dependency information. A range alone would miss a rewrite inside the range. A fingerprint alone would block even compatible fixes until the digest was rewritten, without expressing a version policy. Putting the range in <code>musubi.json</code> and the checked versions and fingerprints in a separate <code>musubi.lock</code> would give consumers two places to read. I chose to keep the range and the fingerprint side by side.</p>
<p>Consider the routine case of an added heading in the shared format. Keeping version 1.0.0 would not trigger a range rejection, but it could make a consumer's example incomplete. Changing the declared version to 1.0.1 would still be accepted by <code>^1.0.0</code>; the content change would still need checking. The stored fingerprint makes that review depend on the files that changed, rather than on whether the provider remembered to change a version string.</p>
<p>Changing the version string alone has the opposite effect. In a CLI experiment for this article, changing only the provider's declaration from 1.0.0 to 1.0.1 left the fingerprint unchanged and ordinary check passed. The provider's <code>musubi.json</code> is not itself one of the three hashed files in this example. The range evaluates its declared version, while the fingerprint evaluates the selected content; neither substitutes for the other.</p>
<p>A package manager may still lock the installed skill or its source revision. musubi instead tracks the content a consumer follows and has checked. An installer can change files after an earlier check, which is why ADR 0003 also calls for a check before the agent reads the content, when the command is available. This is an instruction to the agent, not a runtime access-control mechanism.</p>
<h2>Hash the instructions and the check, not just the template</h2>
<img src="https://images.cardene.dev/musubi-fingerprint-experiment-f02-0053a7c9d076.webp" alt="Independent newline edits to SKILL.md, formats/design.md and checks/design.json produce different whole-digest prefixes; restoring bytes restores the original." style="display:block;margin:0 auto" />

<p>The provider's <code>SKILL.md</code> tells the agent which file supplies the format. The format contains the required headings and table. The JSON check defines what the CLI looks for in consumer examples. Changing any of these can affect how a consumer uses the content.</p>
<p>That is why <code>fingerprintFiles</code> in <code>src/skills.ts</code> builds a path list that includes the provider's <code>SKILL.md</code>, the referenced content file and the check file if one is declared. <code>fingerprint</code> in <code>src/fingerprint.ts</code> hashes those files in order. For this example the inputs are <code>SKILL.md</code>, <code>formats/design.md</code>, and <code>checks/design.json</code>, in that order.</p>
<p>The hashing procedure is equivalent to the following pseudocode.</p>
<pre><code class="language-text">for each path in [SKILL.md, content file, optional check file]:
    hash.update(path + "\n" + byte_length + "\n")
    hash.update(file_bytes)
    hash.update("\n")
integrity = "sha256-" + base64(digest)
</code></pre>
<p>Including paths and byte lengths gives the input an explicit framing. A newline is a byte too. There is no normalization of Markdown formatting before hashing. The check is deliberately conservative: even a wording-only change that has no effect on the final document can require rechecking. Since the whole provider <code>SKILL.md</code> is included, editing shared loading instructions can also invalidate fingerprints for more than one content item.</p>
<h3>Paths, bytes and selected inputs</h3>
<p>The framing makes each file boundary part of the input. The digest is built from a relative path, a decimal byte count, the file bytes and a separator, repeated in the specified order. It therefore identifies more than the concatenated prose of a template. Moving identical bytes to a different relative path produces a different input, even if a reader sees the same text after opening the file.</p>
<p>The pinned fingerprint function confirmed that distinction in an isolated experiment. Renaming the copied format from <code>formats/design.md</code> to <code>formats/renamed.md</code>, then hashing the new path with the unchanged file bytes, changed the result. This was a function-level experiment, not a complete provider migration: the instructions and declaration were not rewritten to use the new name. It isolates what the path contributes to the digest.</p>
<p>The input list is also a limit on what the fingerprint can detect. Adding a separate <code>notes.md</code> beside the provider files left the selected-input digest unchanged in another experiment. musubi does not hash every file in the directory or automatically follow every Markdown link. If a shared instruction depends on additional material, a matching fingerprint alone does not establish that the additional material is unchanged.</p>
<h3>What the experiments establish</h3>
<p>To separate byte changes from structural changes, the experiment appended one newline to a copied provider file, calculated the fingerprint, then restored the original bytes. Each row below is a separate edit to one of the three selected files, using the pinned <code>fingerprint.ts</code> implementation.</p>
<table>
<thead>
<tr>
<th>Changed file</th>
<th>Fingerprint prefix after change</th>
<th>Matches recorded integrity?</th>
</tr>
</thead>
<tbody><tr>
<td>Original provider files</td>
<td>yNSwpBT+</td>
<td>Yes</td>
</tr>
<tr>
<td><a href="http://SKILL.md">SKILL.md</a>, one newline added</td>
<td>pYObObpG</td>
<td>No</td>
</tr>
<tr>
<td>formats/design.md, one newline added</td>
<td>aNXx0Oif</td>
<td>No</td>
</tr>
<tr>
<td>checks/design.json, one newline added</td>
<td>vAI2pkXr</td>
<td>No</td>
</tr>
<tr>
<td>Original bytes restored</td>
<td>yNSwpBT+</td>
<td>Yes</td>
</tr>
</tbody></table>
<p>The prefixes are shortened for readability; musubi compares the full value. The original digest matched the value already recorded by the repository's consumer, and restoring the bytes restored that value. The pinned range function also accepted the three 1.x examples in the version diagram and rejected 2.0.0 for <code>^1.0.0</code>.</p>
<p>These newline edits deliberately leave the required headings and table columns intact. They separate change detection from the later decision to accept the changed content. A mismatch is expected even for such a small edit; whether the consumer's examples still satisfy the rules is a separate question. The experiment does not measure whether the resulting design documents are useful or whether an agent interprets the prose correctly.</p>
<p>The command-level cases below used the actual pinned CLI with disposable copies of its example files. Source and fixture bytes were checked against the pinned Git blob IDs before execution. The supported-runtime run used Node.js v24.22.1: nine function assertions, seven CLI cases, six additional boundary cases and all 27 tests in <code>tests/check.test.ts</code> passed. An earlier run on Node.js v22.16.0 was below the declared minimum of 22.18; the supported run supersedes it. The full upstream suite and an actual coding-agent session were not run.</p>
<h2>A mismatch is a review checkpoint</h2>
<img src="https://images.cardene.dev/musubi-fingerprint-experiment-f03-360061397f7e.webp" alt="With an accepted version, JSON rules and named examples, check reports a mismatch; update checks examples before per-reference rewrites. Overall exit 1 can coexist with a write." style="display:block;margin:0 auto" />

<h3>Mismatch and example failures</h3>
<p>The actual control flow in <code>src/check.ts</code> first resolves the referenced content and checks its version. It calculates the current fingerprint only after the version is accepted. When the fingerprint differs, ordinary <code>musubi check</code> reports a problem and skips the changed reference's example rules.</p>
<p>With <code>--update</code>, the checker applies the provider's current JSON rules to the consumer's designated examples when both exist. For a changed fingerprint, it queues a rewrite if checking that reference adds no problems. The table describes the design-document example, which has both JSON rules and a designated example.</p>
<table>
<thead>
<tr>
<th>Condition</th>
<th>Ordinary check</th>
<th>Check with --update</th>
</tr>
</thead>
<tbody><tr>
<td>Version outside accepted range</td>
<td>Reject reference</td>
<td>Reject reference</td>
</tr>
<tr>
<td>Matching fingerprint</td>
<td>Check designated examples</td>
<td>Check designated examples</td>
</tr>
<tr>
<td>Changed fingerprint, examples pass</td>
<td>Report mismatch, skip rules</td>
<td>Queue new fingerprint</td>
</tr>
<tr>
<td>Changed fingerprint, example fails</td>
<td>Report mismatch, skip rules</td>
<td>Report rule failure; keep old fingerprint</td>
</tr>
</tbody></table>
<p>For a changed reference, <code>--update</code> is the explicit request to evaluate examples against new inputs and consider recording them. It does not decide whether a change in the instructions is desirable. That decision still requires reading the provider's diff and the consumer's example.</p>
<p>The newline experiments show the successful update path: each ordinary check returned exit 1 for a mismatch, while <code>--update</code> accepted the edit and the subsequent check passed. The failure path depends on the example's structure. Its JSON rules require a <code>## Decisions</code> heading with a table containing <code>Option</code>, <code>Chosen</code> and <code>Why</code> columns. Removing that heading made <code>--update</code> fail and left the old fingerprint in place; changing the provider's declared version to 2.0.0 also prevented the update.</p>
<p>A matching fingerprint does not bypass those example rules. In a separate CLI case, the required heading was removed from the consumer example without changing the provider files. The fingerprint still matched, but ordinary check returned exit 1 for the missing heading. This distinguishes a changed dependency from a consumer example that no longer satisfies an unchanged dependency.</p>
<h3>Per-reference rewrites</h3>
<p>One consumer's failed example does not prevent another consumer from accepting an update. In the two-consumer experiment, a copy of the example consumer had its required heading removed, then the shared format was edited. The CLI returned exit 1, but the valid consumer's digest had been rewritten while the invalid consumer kept its old digest. At this commit, updates are per reference, not an all-or-nothing transaction.</p>
<p>The implementation explains the partial update. Before applying a reference's rules, <code>check</code> remembers the current number of reported problems. If checking that reference adds no problems, its changed fingerprint is queued for rewriting. After processing references and checking for cycles, the CLI writes the queued changes before deciding its overall exit status.</p>
<p>Inspect the declaration diff even after exit 1. The error output identifies what still needs work; the diff shows which references have already accepted new bytes. Fix the failed examples and recheck without assuming that the previous command left every declaration untouched.</p>
<h3>Updates without structural checks</h3>
<p>ADR 0004 limits <code>musubi check</code> to declarative JSON rules rather than allowing it to execute arbitrary provider scripts. It checks the structure of the specified examples, not every document an agent generates. In agent-shuriken, <code>design-doc/verify</code> is a separate reference: the design skill explicitly runs that script against a completed design document. A passing musubi check does not certify that script's safety, the provider's authenticity or the correctness of the generated design. If there are no designated examples or no JSON rules, this step performs no example-based verification. A changed fingerprint can still be updated when no new problems are recorded.</p>
<p>Two CLI experiments illustrate what an update means when these checks are absent. In the first case, the example file was left with its required heading removed, but the declaration no longer named any examples. Baseline check passed because that broken file was not selected for checking. After a newline edit to the provider format, normal check reported the mismatch, while <code>--update</code> accepted the new fingerprint and the subsequent check passed.</p>
<p>In the second case, the provider declared no JSON check. The baseline fingerprint was recalculated for the resulting two-file input list, while the consumer's named example was left structurally broken. Again, a later format edit caused a mismatch, but update succeeded because there were no JSON rules to apply. This does not show a validator being defeated: no structural validation had been configured for that reference.</p>
<p>An <code>integrity</code> field without representative examples cannot establish that a changed template still fits the consumer's output. Even with examples, a headings-and-columns check can establish those structural properties only. A complete-looking decision table may still contain a poor decision, which requires reviewing the example or using a separate domain-specific check.</p>
<h2>Try the decision on a disposable checkout</h2>
<img src="https://images.cardene.dev/musubi-fingerprint-experiment-f04-26758fae44f8.webp" alt="Provider digest changes first; consumer integrity stays old until review and update, then matches. Actual check exits are 0, 1, then update and recheck 0." style="display:block;margin:0 auto" />

<h3>The disposable fixture</h3>
<p>Use Node.js 22.18 or later and a disposable checkout. The pinned check command has no external runtime dependencies. The clone and checkout commands below set up the reader's environment; the experiment used copies of the same pinned source and example files.</p>
<pre><code class="language-bash">git clone https://github.com/cardene777/musubi.git
cd musubi
git checkout 88a82fefd5b234f8f7fd7cae2ab4a82861722715
node --experimental-strip-types src/cli.ts check examples/skills
</code></pre>
<p>After confirming the baseline, add a newline to one provider file. The content's declared version is unchanged, but the fingerprint must differ, as the direct experiment showed. Before accepting the edit, inspect it with <code>git diff -- examples/skills/design-doc</code> and read the consumer's example.</p>
<pre><code class="language-bash"># In a disposable checkout of the pinned repository:
printf '\n' &gt;&gt; examples/skills/design-doc/formats/design.md
node --experimental-strip-types src/cli.ts check examples/skills
# Observed: exit 1 (fingerprint mismatch).
# Review the changed file and the consumer example before accepting it.
node --experimental-strip-types src/cli.ts check examples/skills --update
git diff -- examples/skills/api-design/musubi.json
node --experimental-strip-types src/cli.ts check examples/skills
</code></pre>
<h3>The final declaration diff</h3>
<p>Before running <code>--update</code>, review both the provider's diff and the example; if the change is not intended, do not accept it. Afterward, inspect the consumer's declaration and check again. For a real skill repository, review the format changes and the corresponding integrity changes in the same pull request. Discard the disposable checkout when finished.</p>
<p>For example, if the provider's rules gained a required heading or column, update the maintained example only after deciding what that requirement means for the consuming skill. Removing the example from the declaration merely to obtain a passing update would remove the check that makes the result useful. If the declared version is outside the range, reconsider the compatibility decision before widening it.</p>
<p>This declaration is useful when several skills share instructions and their consumers need a record of which content they accepted. A self-contained skill with no shared content may not need that extra dependency bookkeeping. When accepting a shared-format update, commit the new integrity value with any example changes needed to demonstrate the intended output.</p>
<p>For the broader declaration and discovery model, see the existing musubi guide on Bitsumi.</p>
<p><a href="https://cardene.dev/en/articles/8e731a9c42b6d0">https://cardene.dev/en/articles/8e731a9c42b6d0</a></p>
<h2>References</h2>
<ul>
<li>ADR 0003: Range and fingerprint without a lockfile</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/docs/adr/0003-range-and-fingerprint-without-a-lockfile.md">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/docs/adr/0003-range-and-fingerprint-without-a-lockfile.md</a></p>
<ul>
<li>ADR 0004: JSON rules rather than scripts</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/docs/adr/0004-checks-are-json-rules.md">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/docs/adr/0004-checks-are-json-rules.md</a></p>
<ul>
<li>Fingerprint implementation</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/src/fingerprint.ts">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/src/fingerprint.ts</a></p>
<ul>
<li>Version range implementation</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/src/semver.ts">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/src/semver.ts</a></p>
<ul>
<li>Check implementation</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/src/check.ts">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/src/check.ts</a></p>
<ul>
<li>Check tests</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/tests/check.test.ts">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/tests/check.test.ts</a></p>
<ul>
<li>Consumer example declaration</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/examples/skills/api-design/musubi.json">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/examples/skills/api-design/musubi.json</a></p>
<ul>
<li>Definition at the checked revision</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/spec/musubi.md">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/spec/musubi.md</a></p>
<ul>
<li>agent-shuriken: contract-design's shared content declaration</li>
</ul>
<p><a href="https://github.com/cardene777/agent-shuriken/blob/bba868ce550d08c0e67b4543319c08b0ef0d47e3/plugins/evm-dev/skills/contract-design/musubi.json">https://github.com/cardene777/agent-shuriken/blob/bba868ce550d08c0e67b4543319c08b0ef0d47e3/plugins/evm-dev/skills/contract-design/musubi.json</a></p>
<ul>
<li>Provider file selection and declaration validation</li>
</ul>
<p><a href="https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/src/skills.ts">https://github.com/cardene777/musubi/blob/88a82fefd5b234f8f7fd7cae2ab4a82861722715/src/skills.ts</a></p>
<ul>
<li>agent-shuriken: contract-design instructions</li>
</ul>
<p><a href="https://github.com/cardene777/agent-shuriken/blob/bba868ce550d08c0e67b4543319c08b0ef0d47e3/plugins/evm-dev/skills/contract-design/SKILL.md">https://github.com/cardene777/agent-shuriken/blob/bba868ce550d08c0e67b4543319c08b0ef0d47e3/plugins/evm-dev/skills/contract-design/SKILL.md</a></p>
]]></content:encoded></item><item><title><![CDATA[Stop Duplicating Your Claude Code and Codex Configurations]]></title><description><![CDATA[Why shared skills can use symlinks, why rules need managed blocks, and how agent-shared preserves local configuration and separates hook approval from…]]></description><link>https://cardene777.hashnode.dev/stop-duplicating-your-claude-code-and-codex-configurations</link><guid isPermaLink="true">https://cardene777.hashnode.dev/stop-duplicating-your-claude-code-and-codex-configurations</guid><category><![CDATA[AI]]></category><category><![CDATA[ClaudeCode]]></category><category><![CDATA[codex]]></category><category><![CDATA[tooling]]></category><dc:creator><![CDATA[Cardene]]></dc:creator><pubDate>Thu, 26 Nov 2026 08:07:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0797dc590e2c5f9de7854f/60cc4772-ed68-4991-929f-17d31beaa1bd.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Claude Code looks for personal skills in <code>~/.claude/skills</code>; Codex uses <code>~/.agents/skills</code>. If you use both, there's no need to keep a separate copy of every skill. Both directories can contain a symlink to the same skill directory.</p>
<p>This article and its diagrams were generated with AI assistance. The technical claims and code examples were checked against the pinned source and the test results described below.</p>
<p>Rules are trickier. Claude Code reads individual Markdown files, whereas Codex reads instructions from <code>AGENTS.md</code>. Hooks need separate treatment because the two agents don't support exactly the same events.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f00-overview-v2.webp" alt="One shared source maps to Claude Code and Codex skill links, rules and native hook files." style="display:block;margin:0 auto" />

<p>I built <a href="https://github.com/cardene777/agent-shared">agent-shared</a> to handle these differences without maintaining separate configurations for every agent. It links skill directories, writes shared rules into the appropriate files, and adds hook declarations to each agent's configuration. The examples use v0.3.0 and distinguish what the tool writes from what the agent actually does.</p>
<p>On November 26, 2026, the personal-scope filesystem and CLI checks passed using agent-shared 0.3.0 at the pinned commit. The checks covered placement, rule updates, source approval, switches, and removal.</p>
<p>The test used macOS (Darwin arm64), Python 3.15.2, uv 0.9.7, a temporary <code>HOME</code>, and <code>AGENT_SHARED_STATE</code>. Separate repository-scope checks confirmed file placement and recorded what fresh agent sessions reported. Personal-scope fresh-session loading and runtime hook execution were not tested.</p>
<h2>Why copying configuration becomes a maintenance problem</h2>
<p>Suppose the shared review workflow consists of a skill, a rule requiring tests, and a hook attached to shell operations.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f01-copy-drift.webp" alt="Independent copies can drift; a shared skill can instead be read through two symlinks." style="display:block;margin:0 auto" />

<p>With separate copies, every change to the review skill or testing rule requires two edits. The hook may also need different event or settings syntax. Add a third agent and you have another destination to maintain, even if the review procedure itself stays the same.</p>
<p>Stale instructions are hard to spot. If you add a requirement to check the test's exit status in one copy but forget the other, both Markdown files still look valid. You might not notice the difference until you read the review results.</p>
<p>Instead, keep one copy of the review procedure and let the deployment tool handle the differences between agents. Think of it as generating service configuration from a template, except that you can skip generation entirely when a symlink will do.</p>
<p>Check the files on disk after deployment, then open a fresh agent session to check what the agent actually loads. These tests answer different questions. A hook declaration in the right settings file does not prove that a prohibited tool call will be blocked.</p>
<h2>What can be shared and what must stay agent-specific</h2>
<p>The review skill describes how to perform a particular task: inspect a diff, trace the affected code, collect evidence, and report findings. A testing rule belongs outside that skill if it should also apply when the agent implements a feature. Even then, a rule is an instruction, not proof that any test ran.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f02-responsibilities.webp" alt="Rules span tasks, a skill defines a task, and a hook command runs at a runtime event." style="display:block;margin:0 auto" />

<p>Hooks work at a different level. Rather than asking the model to remember an instruction, a hook declares a command for the agent's runtime to execute at a particular event. A pre-tool-use hook can inspect a proposed call; a later event may expose its result. The available events, matchers, inputs, and decisions vary between runtimes. Identical hook JSON doesn't necessarily give you identical enforcement.</p>
<p>The agent table in v0.3.0 defines these destinations for personal configuration:</p>
<table>
<thead>
<tr>
<th>Component</th>
<th>Claude Code</th>
<th>Codex</th>
<th>GitHub Copilot CLI</th>
</tr>
</thead>
<tbody><tr>
<td>Skill directory</td>
<td>~/.claude/skills</td>
<td>~/.agents/skills</td>
<td>Reads the shared agents skill directory</td>
</tr>
<tr>
<td>Rules</td>
<td>Individual files in ~/.claude/rules</td>
<td>Managed block in ~/.codex/AGENTS.md</td>
<td>Managed block in ~/.copilot/copilot-instructions.md</td>
</tr>
<tr>
<td>Hooks</td>
<td>~/.claude/settings.json</td>
<td>~/.codex/hooks.json</td>
<td>~/.copilot/hooks/agent-shared.json</td>
</tr>
</tbody></table>
<p>For Copilot, agent-shared writes rules and hooks only if it finds <code>copilot</code> on <code>PATH</code>. Its agent table lists the events each agent supports and the versions against which the tool was checked. If a hook's event is missing from an agent's supported list, the tool skips that hook for that agent and reports the omission. An agent that reads the common skills directory doesn't necessarily have its own rules or hooks adapter.</p>
<p>Copying the entire configuration directory would put the Claude Code rules in the wrong format for Codex. The source files are reusable; the destination layout is not.</p>
<p>Why not use symlinks for everything? A symlink can point to a file or directory, but it cannot insert the contents of several Markdown files into one existing <code>AGENTS.md</code> while leaving the instructions already in that file alone. That is why agent-shared uses two representations for rules. Linking avoids another copy where the destination supports it; a managed block lets the tool update only its own section where it does not. The cost is that Codex needs another deployment when a rule changes.</p>
<h2>Design a source of truth before installing anything</h2>
<p>For this example, the personal source directory contains just one skill and one rule. The source has no credentials, project secrets, private prompts, or plugin trust settings.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f03-ownership.webp" alt="Personal workflow and repository requirements are separate from secrets and agent permissions." style="display:block;margin:0 auto" />

<pre><code class="language-text">~/.shared/
├── skills/
│   └── review-change/
│       └── SKILL.md
└── rules/
    └── testing.md
</code></pre>
<p>Neither file needs to be tied to Claude Code or Codex. The <code>review-change</code> skill contains the review procedure; <code>testing.md</code> holds the testing convention both agents should follow.</p>
<p>Leave API keys and provider credentials in a secret store. Keep model selection and permissions for private repositories in each agent's own configuration. Sharing a review skill does not itself grant repository access. Review the instructions in imported skills and rules as well as any scripts they reference: those instructions can influence an agent that already has tool permissions.</p>
<p>Before putting this directory in Git, decide which files are safe to commit. Markdown, small review scripts, and public examples can be reviewed like application code. Credentials and machine-specific absolute paths should not become Git history. If a script requires local configuration, give it a documented input rather than hard-coding a secret in the shared source.</p>
<p>A preference for the format of review findings can live in your personal rules. The command that everyone must run before merging a change belongs in the repository. That way, another contributor can follow the project's workflow without inheriting your personal settings.</p>
<h2>Create and inspect the shared configuration</h2>
<p>You'll need macOS or Linux, Python 3.11 or later, and <code>uv</code>. For the first run, use a disposable VM or container with no production credentials. Changing <code>HOME</code> alone is not a security boundary: deployment can modify agent configuration and invoke agent commands if they are installed.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f04-check-deploy-inspect-v2.webp" alt="Structural checks and placement inspection precede a distinct fresh-session test." style="display:block;margin:0 auto" />

<p>Install the revision used in this article rather than whatever happens to be on the default branch today:</p>
<pre><code class="language-bash">uv tool install "git+https://github.com/cardene777/agent-shared@02fb752d62b72506ef7085d9623a8aa8d1612002"
agent-shared --version
</code></pre>
<p>Expect <code>agent-shared 0.3.0</code> from the version command. Inspect the pinned source before installing it. The Git installation needs network access, although <code>pyproject.toml</code> declares no third-party Python runtime dependencies.</p>
<p>Create the review skill and testing rule in a fresh lab home directory.</p>
<pre><code class="language-bash">mkdir -p ~/.shared/skills/review-change ~/.shared/rules

cat &gt; ~/.shared/skills/review-change/SKILL.md &lt;&lt;'EOF'
---
name: review-change
description: Review a proposed code change for defects and missing tests.
---

# Review a change

1. Read the diff and the relevant surrounding code.
2. Identify changed behavior and affected tests.
3. Report findings with evidence and impact.
4. State which checks could not be performed.
EOF

cat &gt; ~/.shared/rules/testing.md &lt;&lt;'EOF'
# Testing

Run relevant tests after changing business logic.
Report the command, result, and any checks that could not run.
EOF
</code></pre>
<p>The commands overwrite files of the same name, which is why they belong in a fresh environment. On your real machine, inspect existing files and merge the instructions deliberately.</p>
<p>The front matter of the skill identifies the skill and describes its intended use. The body defines the actual task. The testing rule is separate because it applies when implementing a change, not just when reviewing one.</p>
<p>Now check the source without writing destination files.</p>
<pre><code class="language-bash">agent-shared check --source ~/.shared
</code></pre>
<p><code>check</code> can detect a skill with an invalid name or a hook declaration without a command. Exit status 0 means the source passed its structural checks. It says nothing about whether the review skill finds bugs.</p>
<p>Apply the configuration and inspect what was placed.</p>
<pre><code class="language-bash">agent-shared deploy
agent-shared placed --source ~/.shared
</code></pre>
<p><code>placed</code> reports the entries from that source that are still present in the agent configurations. To check the filesystem directly, inspect the links and the generated rule block:</p>
<pre><code class="language-bash">ls -l ~/.claude/skills/review-change
ls -l ~/.agents/skills/review-change
ls -l ~/.claude/rules/testing.md
cat ~/.codex/AGENTS.md
</code></pre>
<p>In a clean lab with both agents eligible for placement, no conflicting files or plugins, and no active switches, expect three links and one generated rule block. The links cover each agent's skill plus the Claude Code rule, and Codex receives the block in <code>AGENTS.md</code>.</p>
<p>If a link is missing, check the deployment messages before creating it manually. agent-shared may skip a skill already supplied by a plugin or an agent below its checked minimum version. A version above the checked range, or one the tool cannot read, produces a message but does not stop placement on its own. In this walkthrough, Claude Code 2.1.332 exceeded the checked maximum of 2.1.330, so the deployment printed that message and continued.</p>
<p>The repository-scope fresh-session result appears in the repository section below. Personal-scope runtime sessions remain unverified, so repeat the same check in a harmless test repository before relying on your personal setup.</p>
<h2>Follow an update through links and generated blocks</h2>
<p>Once the links are in place, change <code>testing.md</code> and read it through the link in Claude Code's configuration directory. The link points to the source file, so reading it should return the new text immediately.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f05-link-vs-block.webp" alt="On disk, a symlink reflects v2 after editing; the generated block remains v1 until deploy." style="display:block;margin:0 auto" />

<p>Codex is different: agent-shared copies the rule's text into a managed block in <code>AGENTS.md</code>. That block won't change until you run <code>deploy</code> again.</p>
<p>Add a new instruction to the source rule:</p>
<pre><code class="language-bash">printf '\nInclude the exit status when reporting a test result.\n' \
  &gt;&gt; ~/.shared/rules/testing.md
</code></pre>
<p>Before running <code>deploy</code> again, read the two destinations. Expect the new sentence in the linked Claude Code rule but not in Codex's generated block.</p>
<pre><code class="language-bash">cat ~/.claude/rules/testing.md
cat ~/.codex/AGENTS.md
agent-shared deploy
cat ~/.codex/AGENTS.md
</code></pre>
<p>After deployment, the managed block should contain the updated rule. An active agent might cache instructions or require a new session, depending on its loader. Do not infer live reload support from the fact that a file changed.</p>
<p>You can reproduce the filesystem behavior without installing any agent. The following Python example creates one source file, a symbolic link, and a separate generated copy in a temporary directory. It changes the source and then tests the two different views.</p>
<pre><code class="language-python">import tempfile
from pathlib import Path

with tempfile.TemporaryDirectory() as folder:
    root = Path(folder)
    source = root / "testing.md"
    link = root / "linked.md"
    generated = root / "AGENTS.md"
    source.write_text("Run tests.\n")
    link.symlink_to(source)
    generated.write_text(source.read_text())

    source.write_text("Run tests.\nReport exit status.\n")
    assert link.read_text() == source.read_text()
    assert "Report exit status." not in generated.read_text()

    generated.write_text(source.read_text())
    assert generated.read_text() == source.read_text()
</code></pre>
<p>All three assertions passed on Linux with Python 3.13.5. That verifies the filesystem behavior, but it doesn't test agent-shared's block generation or either agent's instruction loader. Those need separate checks.</p>
<p>Rollback works the same way: revert the source file and the link exposes the previous text. Run <code>deploy</code> to regenerate the Codex block. If the rollback also changes a hook or script, recheck its trust status and runtime behavior.</p>
<p>How does agent-shared know which lines in <code>AGENTS.md</code> belong to a particular source? It wraps its generated rules in markers that contain a source ID. The ID is the first 12 hexadecimal characters of the SHA-256 digest of the source's resolved path. Editing the rule leaves the ID unchanged; moving the source to a different location may require removing its old placements.</p>
<p>The distinction matters when updating a managed block. If the ID were a hash of the rule contents, editing the rule would change the ID before the next deployment could find the old block by that ID. A path-based ID lets the tool find the same source across edits. It is an ownership label, not a checksum of the files or proof that their contents are safe. Moving a source has the opposite trade-off: its old path may still identify placements that need cleaning up.</p>
<p>For example, a generated block uses the same ID in its opening and closing markers:</p>
<pre><code class="language-text">&lt;!-- agent-shared begin source=0123456789ab --&gt;
&lt;!-- agent-shared rule testing.md --&gt;
# Testing
Run relevant tests.
&lt;!-- agent-shared end source=0123456789ab --&gt;
</code></pre>
<p>The ID in this example is illustrative. On redeployment, the markers tell the tool where its own block begins and ends, so it can update that block without replacing unrelated instructions. Symlinks can't carry markers in the same way, so agent-shared keeps a record of the links it created.</p>
<p>Edit the source, not the generated block. A hand edit inside that block may disappear the next time you deploy.</p>
<h2>Add a hook without confusing deployment with permission</h2>
<p>To test hook placement, use a shell script that discards its input and exits with status 0. This is a fixture, not a security hook: it neither blocks operations nor logs their contents.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f06-hook-approval.webp" alt="Skills and rules remain eligible without approval, but hooks need source approval before placement and runtime checks." style="display:block;margin:0 auto" />

<p>Put the script in a separate source so you can test approval without changing the already-approved personal directory.</p>
<pre><code class="language-bash">mkdir -p ~/review-lab-extension/hooks

cat &gt; ~/review-lab-extension/hooks/observe.sh &lt;&lt;'EOF'
#!/bin/sh
cat &gt;/dev/null
exit 0
EOF
</code></pre>
<p>Create its hook declaration:</p>
<pre><code class="language-json">{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "sh ${CLAUDE_PLUGIN_ROOT}/hooks/observe.sh",
            "tools": ["Claude Code"]
          }
        ]
      }
    ]
  }
}
</code></pre>
<p>Save this as <code>hooks.json</code> in the extension directory. During deployment, agent-shared substitutes the source path for the placeholder and uses <code>tools</code> to select the agent. It leaves <code>tools</code> out of the generated native configuration. The sample command assumes a lab path without spaces; quote paths correctly in real scripts.</p>
<p>Run a deployment with the new source:</p>
<pre><code class="language-bash">agent-shared check --source ~/review-lab-extension
agent-shared deploy --source ~/review-lab-extension
agent-shared placed --source ~/review-lab-extension
</code></pre>
<p>For this new source, expect an empty <code>hooks</code> array for Claude Code and Codex in the output from <code>placed</code>. agent-shared requires approval before placing its hooks; skills and rules from an unapproved source can still be placed. The default personal source, <code>~/.shared</code>, already counts as approved. Approval is recorded once per source, not once per hook invocation or script revision. Review later changes to the approved scripts, too.</p>
<p>For a source that is not already approved, the approval command prints its hook commands and asks <code>Approve them, so deploy places this source's hooks in every agent? [y/N]</code>. Read the scripts and the printed commands. Answer <code>y</code> or <code>yes</code> only if you approve them; other answers leave the approval record unchanged and exit with status 1. A script can change without its file name changing, so inspecting the command string is not enough.</p>
<pre><code class="language-bash">agent-shared approve --source ~/review-lab-extension
agent-shared deploy --source ~/review-lab-extension
agent-shared placed --source ~/review-lab-extension
</code></pre>
<p>Once you approve the source and deploy again, expect to find the declaration in Claude Code's settings file. Codex should receive nothing from this hook because <code>tools</code> names only Claude Code.</p>
<p>Codex has its own hook trust mechanism, separate from the source approval above. agent-shared can call <code>codex app-server</code> to register trust for deployed personal hooks. If the command is unavailable or doesn't respond, the tool reports the problem and asks you to review hooks in Codex. Repository hooks require a separate trust step.</p>
<p>Consider a shared source from a teammate. You may want its review instructions without allowing its shell scripts to run on your machine. The source approval gate lets you deploy the instructions without approving hooks. It does not review those instructions for safety. Codex then has its own trust rules for the hooks it receives. Neither gate turns the script into sandboxed code, and source approval does not pin a particular revision of that script.</p>
<p>Review the hook script and its matcher together. Permission settings, operating-system restrictions, restricted credentials, and the actual tool runtime remain separate security controls.</p>
<h2>Manage multiple sources and remove only what you own</h2>
<p>You can deploy application-provided settings alongside your personal ones by repeating <code>--source</code>. Each source has its own identity and recorded placements.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f07-multiple-sources.webp" alt="Removing source A preserves source B and manual instructions." style="display:block;margin:0 auto" />

<p>This makes it possible to uninstall one source without clearing the entire settings file. Managed rules have source markers, managed hooks carry a source marker in their command, and managed links are identified through the record. The removal operation uses that information to target entries associated with the selected source.</p>
<p>What if two user-level sources in the same deployment both contain a rule called <code>testing.md</code>? The implementation checks for duplicate names among those sources before making the planned writes and refuses the conflicting deployment. The same check applies to skill names. Repository-scoped configuration is placed separately. Decide which source should own the rule, rename the other if necessary, and retry. Don't solve the collision by deleting unrelated agent files.</p>
<p>For a smaller exception, suppose Codex should not receive the personal testing rule. The switch commands record a per-agent omission without modifying the source itself.</p>
<pre><code class="language-bash">agent-shared off --source ~/.shared --agent Codex rules/testing.md
agent-shared deploy
agent-shared on --source ~/.shared --agent Codex rules/testing.md
agent-shared deploy
</code></pre>
<p><code>off</code> and <code>on</code> change the switch list, not the destination files. The next <code>deploy</code> applies the change. Record why Codex should omit this rule so another developer doesn't mistake the omission for a deployment failure.</p>
<p>When the review-lab extension is no longer needed, remove its managed entries:</p>
<pre><code class="language-bash">agent-shared remove --source ~/review-lab-extension
</code></pre>
<p>Check the Claude Code settings afterward. The extension's hook should be gone, while unrelated manually configured entries should remain. If the settings file has no remaining entries, agent-shared may remove the file itself. The tool also documents removing a source after its directory has been deleted, using its record and markers. Still, keep a backup before altering your real configuration; manual edits to managed files, damaged markers, or missing records can complicate recovery.</p>
<p>By default, agent-shared stores its placement and switch records under <code>~/.local/share/agent-shared/</code>. Set <code>AGENT_SHARED_STATE</code> to use another location. Back up the record before troubleshooting: without it, the tool loses information about which links it placed.</p>
<h2>Keep team configuration close to the repository</h2>
<p>The same source layout can be used at repository scope. A repository can keep a project-specific review skill and testing rule in <code>.shared</code>. <code>agent-shared deploy --repo .</code> creates the relative skill links and manages the rules block in <code>AGENTS.md</code>; it does not create <code>CLAUDE.md</code>. After deployment, the relevant files should look like this:</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f08-team-config-v2.webp" alt="Relative skill links and a managed AGENTS.md block stay within the repository." style="display:block;margin:0 auto" />

<pre><code class="language-text">example-service/
├── .shared/
│   ├── skills/
│   │   └── service-review/
│   │       └── SKILL.md
│   └── rules/
│       └── service-testing.md
├── .agents/
│   └── skills/
│       └── service-review -&gt; ../../.shared/skills/service-review
├── .claude/
│   └── skills/
│       └── service-review -&gt; ../../.shared/skills/service-review
└── AGENTS.md
</code></pre>
<p>At repository scope, agent-shared uses relative links for skills and writes a managed rules block in the repository's <code>AGENTS.md</code>. If you want Claude Code to import those instructions through <code>@AGENTS.md</code>, write that <code>CLAUDE.md</code> file yourself. Repository hooks still need source approval and any trust configuration required by the receiving agent.</p>
<p>To try this in the disposable environment, create a new repository and populate its <code>.shared</code> directory before running the deployment commands below:</p>
<pre><code class="language-bash">mkdir -p example-service
cd example-service
git init -q
mkdir -p .shared/skills/service-review .shared/rules
cat &gt; .shared/skills/service-review/SKILL.md &lt;&lt;'EOF'
---
name: service-review
description: Review changes to this service.
---

# Service review

Inspect the diff and identify affected tests.
EOF
printf '%s\n' 'Run the service tests before merging.' &gt; .shared/rules/service-testing.md
</code></pre>
<pre><code class="language-bash">agent-shared check --source .shared
agent-shared deploy --repo .
</code></pre>
<p>The <code>--repo</code> option selects the repository, but it doesn't disable the personal source: <code>deploy</code> also processes <code>~/.shared</code> when that directory exists. The walkthrough confirmed both relative skill links and the managed rule block. Claude Code 2.1.332, started with project settings only and without a <code>CLAUDE.md</code> file, reported the skill and quoted the rule before and after redeployment. Codex 0.171.0 was checked after redeployment and reported the skill and both rule sentences. These answers show what the sessions reported, not an inspection of their internal context or a test of actual hook execution.</p>
<p>Before committing the repository changes, inspect the new files with <code>git status --short</code> and review their contents. Once staged for review, inspect <code>git diff --cached</code>. Relative links should survive a clone because their targets belong to the repository, not to another developer's home directory.</p>
<p>Repository hook declarations deserve particular care because distributing executable configuration affects everyone who enables it. Review changes to the script and to the event that runs it. Require a harmless test fixture and a clear explanation of what happens if the script fails. An approval of one source on your computer is not authorization on behalf of every teammate.</p>
<p>Keep personal and project configuration separate even if both are versioned. The project owns the requirements for its service. A developer's own workflow can adapt how those requirements are presented, but it should not silently change the project's intended behavior.</p>
<h2>Choose the smallest approach that solves your problem</h2>
<p>There is no need to introduce a dedicated deployment layer if you only use one agent or share one compatible skill file. A repository containing a common instruction and the agent-specific import may already be enough.</p>
<img src="https://images.cardene.dev/shared-agent-configuration-f09-choose-approach.webp" alt="Manual configuration, symlinks or deployment fit different sharing needs; teams can keep project requirements in the repository." style="display:block;margin:0 auto" />

<p>If two agents read the same file format, a manual symlink may be all you need. You can inspect it with <code>ls -l</code> without learning a new tool. The more formats, managed blocks, event filters, and trust settings you need to maintain, the more work a link-only approach leaves to you.</p>
<table>
<thead>
<tr>
<th>Approach</th>
<th>Good fit</th>
<th>Main limitation</th>
</tr>
</thead>
<tbody><tr>
<td>Manual configuration</td>
<td>One agent or a few independent settings</td>
<td>Changes must be repeated across copies</td>
</tr>
<tr>
<td>Direct symbolic links</td>
<td>Identical files read by several tools</td>
<td>Does not translate differing settings formats</td>
</tr>
<tr>
<td>Shared source plus deployment</td>
<td>Several agents with skills, rules and hooks</td>
<td>Adds a tool and a managed-state lifecycle</td>
</tr>
<tr>
<td>Repository-owned instructions</td>
<td>Teams that need reproducible project conventions</td>
<td>Does not replace personal settings or runtime permissions</td>
</tr>
</tbody></table>
<p>There are already tools for sharing agent configuration. <a href="https://rulesync.dyoshikawa.com/reference/cli-commands">Rulesync</a> generates tool-specific files from its source trees, with configurable targets and features. <a href="https://microsoft.github.io/apm/reference/cli/install/">Microsoft APM</a> focuses on agent packages and dependency management: its install command resolves packages and records the result in a lockfile. Rulesync also documents a lockfile-based installation workflow. Both are worth looking at if those are the problems you need to solve.</p>
<p>The narrower question in this article is what happens to files already on your machine when you edit or remove one local source. agent-shared defines a common source layout and ownership marks in its public specification. Its path-based source IDs help preserve unrelated settings, but they are not a substitute for locking package versions. The comparison here is based on the documented models, not a benchmark or a claim that other tools cannot perform similar operations.</p>
<p>If your only shared asset is <code>SKILL.md</code>, try a link first. A deployment tool becomes more useful when you also need generated rules, agent-specific hooks and a way to remove one source. Before adopting one, check supported agent versions, inspect the generated files and test rollback.</p>
<p>When <code>deploy</code> refuses a change, don't start deleting destination files. Run <code>check</code> against the source, inspect <code>placed</code>, and read the reported refusal. A duplicate rule name and a malformed hook declaration require different fixes. If the file was written but a hook doesn't run, check the event, matcher, runtime trust, and agent version instead.</p>
<p>Check the exit status as well as the messages. <code>check</code> returns 1 when it finds a source validation problem. <code>deploy</code> returns 1 when it refuses a deployment. Both return 2 for the documented usage or input errors. Even a deployment that returns 0 can print warnings.</p>
<p>Use a symlink when every consumer reads an identical format. Add a deployment layer only when you need generated rules, agent-specific hooks, or ownership-aware removal; then inspect its files and test its runtime behavior separately.</p>
<h2>References</h2>
<ul>
<li><a href="https://github.com/cardene777/agent-shared/blob/02fb752d62b72506ef7085d9623a8aa8d1612002/README.md">agent-shared README (pinned)</a></li>
<li><a href="https://github.com/cardene777/agent-shared/blob/02fb752d62b72506ef7085d9623a8aa8d1612002/spec/agent-shared.md">agent-shared definition (pinned)</a></li>
<li><a href="https://github.com/cardene777/agent-shared/blob/02fb752d62b72506ef7085d9623a8aa8d1612002/src/agent_shared/agents.json">Agent table (pinned)</a></li>
<li><a href="https://github.com/cardene777/agent-shared/blob/02fb752d62b72506ef7085d9623a8aa8d1612002/src/agent_shared/cli.py">CLI implementation (pinned)</a></li>
<li><a href="https://github.com/cardene777/agent-shared/blob/02fb752d62b72506ef7085d9623a8aa8d1612002/src/agent_shared/deploy.py">Deployment implementation (pinned)</a></li>
<li><a href="https://github.com/cardene777/agent-shared/blob/02fb752d62b72506ef7085d9623a8aa8d1612002/pyproject.toml">Package metadata (pinned)</a></li>
</ul>
]]></content:encoded></item></channel></rss>