<?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: Alexander Panasenko</title>
    <description>The latest articles on DEV Community by Alexander Panasenko (@alex09x).</description>
    <link>https://dev.to/alex09x</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%2F4229474%2Fd83e63d9-c1eb-48fc-ac0c-c0bcb08cb386.jpg</url>
      <title>DEV Community: Alexander Panasenko</title>
      <link>https://dev.to/alex09x</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alex09x"/>
    <language>en</language>
    <item>
      <title>You Gave Every Agent Its Own Worktree. You Also Gave Each One Its Own rust-analyzer.</title>
      <dc:creator>Alexander Panasenko</dc:creator>
      <pubDate>Tue, 24 Nov 2026 08:43:19 +0000</pubDate>
      <link>https://dev.to/alex09x/you-gave-every-agent-its-own-worktree-you-also-gave-each-one-its-own-rust-analyzer-3ain</link>
      <guid>https://dev.to/alex09x/you-gave-every-agent-its-own-worktree-you-also-gave-each-one-its-own-rust-analyzer-3ain</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; In my setup, one worktree per agent meant one language server per agent, each with its own copy of the same analysis. I tried to share rust-analyzer between worktrees twice, and both attempts half-worked. Then I built a language server that reads what rustc writes down during &lt;code&gt;cargo check&lt;/code&gt;. In one single-session run on Bevy with the index already built, it peaked at 917 MB and, after startup, got through the session's 1,635 requests in 5.5 seconds; rust-analyzer peaked at 11.3 GB and took 114.4 seconds. Several servers running at once are not measured yet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;git worktree add&lt;/code&gt; took between 1.1 and 1.7 seconds. The first workspace-wide symbol search in that fresh worktree took rust-analyzer 66.97 seconds. The same search again took 0.10. That was July 2026, on a private workspace of 431 Rust files.&lt;/p&gt;

&lt;p&gt;An agent that has just been handed a worktree starts with a question of that kind, and it starts cold every time. But the minute is the smaller part of the bill. A worktree is a separate directory, so in my setup it got a separate language server, and every server built its own complete picture of the project in memory: the same dependencies, the same standard library, the same code no agent had touched. In the run further down, a single rust-analyzer session peaked at 1.5 GB on serde and 11.3 GB on Bevy.&lt;/p&gt;

&lt;p&gt;On 26 September the bill arrived. One of my build machines, with 64 GiB of RAM, had 14 code-analysis engines loaded and sat above 85% memory. Requests hung for minutes, and then the kernel's OOM killer shot the service (&lt;a href="https://github.com/alex09x/prod-code/issues/430" rel="noopener noreferrer"&gt;the public issue&lt;/a&gt;). Those 14 were engines for every language, and I did not record how many of them were Rust. What I did know was how &lt;a href="https://github.com/alex09x/prod-code" rel="noopener noreferrer"&gt;prod-code&lt;/a&gt;, the service that answers my agents' questions about code, handled Rust: it embeds rust-analyzer's analysis as a library, and it started one Rust engine per worktree copy. That was the part that grew with every agent.&lt;/p&gt;

&lt;p&gt;"One worktree, one language server" is a habit, not a law. It took me two attempts to see which part of the habit was wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt one: one daemon, private overlays
&lt;/h2&gt;

&lt;p&gt;In July I tested &lt;a href="https://github.com/zetaloop/analyzed" rel="noopener noreferrer"&gt;analyzed&lt;/a&gt; 0.4.2: one shared rust-analyzer world, and each session gets a private overlay with its own changed files.&lt;/p&gt;

&lt;p&gt;The model held. Across 3,950 queries with up to 20 sessions, none returned another session's code. The operations did not hold. With five sessions, a new overlay waited 12 to 47 seconds, and after every session had closed the daemon still held between 9 and 21.6 GiB. That is version 0.4.2 in July; I have not retested later ones.&lt;/p&gt;

&lt;p&gt;The plan recorded that week ruled out building a separate semantic index and merging its results above LSP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt two: teach rust-analyzer to share
&lt;/h2&gt;

&lt;p&gt;After the OOM I forked rust-analyzer. In the fork, a base checkout and its worktree copies share every crate whose files, build-script output and dependencies are identical, and only what differs is analysed again.&lt;/p&gt;

&lt;p&gt;I measured it on rust-analyzer's own repository: 328 crates, about 1.8 GB for the base, with build scripts and proc macros off. A second plain copy cost about 520 MB more. With sharing, an unchanged copy cost 25 to 40 MB, and sixteen copies, each with an edit in a leaf crate, fit in about 2.07 GB in total.&lt;/p&gt;

&lt;p&gt;It worked, and it was about 9,000 lines through some of the most intricate parts of rust-analyzer. I sent it upstream as &lt;a href="https://github.com/rust-lang/rust-analyzer/pull/23454" rel="noopener noreferrer"&gt;one pull request&lt;/a&gt;, and it was closed two days later. The maintainers' reasons were fair: I had not read the project's AI policy and the description broke it, 9,000 lines is not a first contribution, and I had not discussed any of it with the team, who have had their own discussion of a shared server open since July (&lt;a href="https://github.com/rust-lang/rust-analyzer/issues/22765" rel="noopener noreferrer"&gt;#22765&lt;/a&gt;). Carrying a patch that size on top of a moving codebase was not a plan either.&lt;/p&gt;

&lt;h2&gt;
  
  
  The question I had been asking wrong
&lt;/h2&gt;

&lt;p&gt;Both attempts asked how several worktrees could share the analyzer's memory. Neither asked why that memory exists.&lt;/p&gt;

&lt;p&gt;rust-analyzer analyses Rust on its own. It parses, resolves names, expands macros and infers types, and it keeps the result in RAM. rustc does all of that too, on every &lt;code&gt;cargo check&lt;/code&gt;. In my workflow &lt;code&gt;cargo check&lt;/code&gt; was already part of the loop: rust-analyzer runs it on save by default to show the compiler's errors (&lt;a href="https://rust-analyzer.github.io/book/configuration.html#rust-analyzer.checkOnSave" rel="noopener noreferrer"&gt;&lt;code&gt;checkOnSave&lt;/code&gt;&lt;/a&gt;), and my agents run it to see whether a change compiles. The compiler works out where every name points and what type every expression has, reports the errors and exits. Nothing keeps those answers in a form an editor can ask.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rust-intelligence.com" rel="noopener noreferrer"&gt;Rust Intelligence&lt;/a&gt; keeps them. &lt;code&gt;ridx index&lt;/code&gt; runs &lt;code&gt;cargo check&lt;/code&gt; with a small rustc driver that, after analysis, writes one binary file per crate: definitions, every resolved reference, types, impls. A method call points at the impl rustc selected, not at a guess by name. The language server maps those files from disk and answers lookups in them. It does not hold a second compiler in memory, because it is not one.&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%2Fprod.codes%2Fimg%2Fridx%2Farchitecture.svg" 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%2Fprod.codes%2Fimg%2Fridx%2Farchitecture.svg" alt="How Rust Intelligence works: at build time cargo check runs ridx-driver inside rustc and writes index files to disk; at edit time the language server maps them and answers the editor." width="1200" height="820"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Build time on the left, edit time on the right. Cargo checks crates as needed, and worktrees reuse a dependency's index file when their keys match. From the &lt;a href="https://github.com/alex09x/rust-intelligence/blob/v0.3.9/docs/ARCHITECTURE.md" rel="noopener noreferrer"&gt;architecture document&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In July the plan had ruled out a separate index. What changed is who writes it: the compiler, as a by-product of a check that was already running.&lt;/p&gt;

&lt;p&gt;The compiler had already answered. Nobody was keeping the answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What one session costs
&lt;/h2&gt;

&lt;p&gt;The same scripted editor session against both servers: 40 files of each repository opened one by one, with symbols, semantic tokens and inlay hints, then hover, definition, references and completion at sampled positions, and an edit.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Repository&lt;/th&gt;
&lt;th&gt;Peak memory, Rust Intelligence / rust-analyzer&lt;/th&gt;
&lt;th&gt;Time for the requests, after startup&lt;/th&gt;
&lt;th&gt;CPU for the requests&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;serde&lt;/td&gt;
&lt;td&gt;72 MB / 1.5 GB&lt;/td&gt;
&lt;td&gt;2.43 s / 5.40 s&lt;/td&gt;
&lt;td&gt;2.34 s / 6.97 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tokio&lt;/td&gt;
&lt;td&gt;221 MB / 3.2 GB&lt;/td&gt;
&lt;td&gt;2.03 s / 28.1 s&lt;/td&gt;
&lt;td&gt;1.90 s / 35.9 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rust-analyzer&lt;/td&gt;
&lt;td&gt;434 MB / 4.6 GB&lt;/td&gt;
&lt;td&gt;4.59 s / 52.3 s&lt;/td&gt;
&lt;td&gt;4.44 s / 66.7 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bevy&lt;/td&gt;
&lt;td&gt;917 MB / 11.3 GB&lt;/td&gt;
&lt;td&gt;5.54 s / 114.4 s&lt;/td&gt;
&lt;td&gt;5.38 s / 170.5 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read it with its conditions. This is one session per server and repository, run once, on Linux with a Ryzen 9 7950X and 64 GB, with Rust Intelligence at commit &lt;code&gt;f7105fcc&lt;/code&gt;; the rust-analyzer version was not recorded. The index was built beforehand, which takes minutes on a large workspace the first time, and that time is not in the table, while rust-analyzer's own analysis is in its numbers. rust-analyzer answered 26 to 31 requests per repository with an error and Rust Intelligence none; I did not record what the errors were, so that says nothing about the quality of either server's answers. The table says what each server spent on the same requests, 1,635 of them on Bevy. Not every kind of request was faster: on Bevy the median &lt;code&gt;references&lt;/code&gt; and &lt;code&gt;documentHighlight&lt;/code&gt; were quicker on rust-analyzer, and the totals above are for the whole session. It does not say the answers were identical. And it is one session: several servers at once, indexing in parallel and the physical memory of a whole machine are not in it. The &lt;a href="https://github.com/alex09x/rust-intelligence/blob/v0.3.9/bench/published/resources_f7105fcc.jsonl" rel="noopener noreferrer"&gt;raw results&lt;/a&gt; and the &lt;a href="https://github.com/alex09x/rust-intelligence/blob/v0.3.9/bench/measure_resources.py" rel="noopener noreferrer"&gt;script&lt;/a&gt; are in the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  What sixteen worktrees would and would not get
&lt;/h2&gt;

&lt;p&gt;The first objection from anyone who runs agents is not about one session. It is: I have sixteen worktrees that diverge, some of them change &lt;code&gt;Cargo.toml&lt;/code&gt; or features; what happens to the machine?&lt;/p&gt;

&lt;p&gt;What the design gives them. The index file of a registry or git dependency is keyed by what it was compiled from and how: version, target, cfg flags, toolchain and the crates it was built against. Worktrees that build a dependency the same way reuse that file instead of writing it again, and a worktree that changes features or &lt;code&gt;Cargo.toml&lt;/code&gt; gets new files only for the dependencies the change reaches.&lt;/p&gt;

&lt;p&gt;And most of the index stays in memory-mapped files, which the kernel can page out and read back. The server keeps derived tables on the heap as well; the peak in the table above counts both, and I have not measured the split.&lt;/p&gt;

&lt;p&gt;What it does not give them. Sixteen &lt;code&gt;cargo check&lt;/code&gt; runs are still sixteen &lt;code&gt;cargo check&lt;/code&gt; runs: every worktree checks its dependencies and its own crates in its own target directory, and the first index of a large workspace takes minutes. In 0.3.9 a worktree also writes the index of all its own workspace crates, including the ones identical to a sibling worktree's; sharing those is planned, not shipped. And I have not yet put sixteen of these servers on one machine and measured the total, the way I did with the fork. Until I do, the claim is a mechanism and one session, not a fleet.&lt;/p&gt;

&lt;h2&gt;
  
  
  "A language server must work while the code is broken"
&lt;/h2&gt;

&lt;p&gt;This is the strongest objection to the whole idea, and it is why rust-analyzer is built the way it is. It answers on every keystroke, in code that does not compile, without waiting for a build. An index written by the last &lt;code&gt;cargo check&lt;/code&gt; is one build behind by definition.&lt;/p&gt;

&lt;p&gt;In 0.3.9, hover, completion, inlay hints and type errors for the code you are typing come from a small compiler-free front end that reads everything else from the index. References, rename and navigation catch up after a compile: once the edited buffers have been still for 250 ms, the crates that own them are compiled again from the buffers' text into an index for the session, and nothing is written to your files. Since 0.3.11 the compiler's own errors for the unsaved text arrive with that compile, not only after a save. The 250 ms is the pause before that compile starts, not the answer time. From an edit to a &lt;code&gt;references&lt;/code&gt; answer that includes it, the project's own measurement gives a median of 0.36 s on a one-file crate and 3.31 s on a file of one of its library crates (&lt;a href="https://github.com/alex09x/rust-intelligence/blob/v0.3.9/docs/integration.md" rel="noopener noreferrer"&gt;integration notes, §4&lt;/a&gt;); until then the answer comes from the previous index. A crate with compile errors is indexed from everything that did resolve, inside the bodies with errors too. Two gaps remain: a crate that depends on the edited one sees the change only after a save, and a buffer the compiler cannot parse stays on its crate's previous index. That is a compile per pause, not an answer per keystroke. And for every file you have not touched, the answer is as fresh as the last check. The driver is pinned to one toolchain, Rust 1.98.1, because it links to the compiler's private libraries. There is no Windows and no Intel macOS build. Agreement with rust-analyzer is measured per method and recorded in the &lt;a href="https://github.com/alex09x/rust-intelligence/blob/v0.3.9/CHANGELOG.md" rel="noopener noreferrer"&gt;changelog&lt;/a&gt;, for example 95.5% for completion and 82.2% for references in 0.3.0, but that suite was not re-run for 0.3.7, 0.3.8 or 0.3.9.&lt;/p&gt;

&lt;p&gt;If your day is one editor on one checkout with memory to spare, rust-analyzer's trade is a good one. An agent's day is different: it edits a few files, runs &lt;code&gt;cargo check&lt;/code&gt; anyway, and mostly asks about code it did not write.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check it on your own worktrees
&lt;/h2&gt;

&lt;p&gt;Start with what you already run. Does your orchestrator or editor start one language server per worktree? After the first question in each, how much memory is every one of them holding?&lt;/p&gt;

&lt;p&gt;Then compare on two working copies of your own repository. On Linux (x86_64, arm64) or macOS on Apple Silicon, with rustup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsSL https://rust-intelligence.com/install.sh &lt;span class="o"&gt;|&lt;/span&gt; sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ridx compare&lt;/code&gt; puts an answer side by side with rust-analyzer's on your code, so you do not have to take my table on trust. &lt;code&gt;ridx&lt;/code&gt; accepts rust-analyzer's command line, so an editor already set up for rust-analyzer can start it instead; in VS Code that is &lt;code&gt;"rust-analyzer.server.path": "ridx"&lt;/code&gt;. An agent does not need an editor session at all: &lt;code&gt;ridx def&lt;/code&gt;, &lt;code&gt;ridx refs&lt;/code&gt; and &lt;code&gt;ridx hover&lt;/code&gt; answer from the shell.&lt;/p&gt;

&lt;p&gt;Before you buy RAM for the next ten agents, count the language servers already running on that machine and ask what each one is holding. On mine, each was holding one more copy of what the compiler works out on every check.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://github.com/alex09x/rust-intelligence" rel="noopener noreferrer"&gt;github.com/alex09x/rust-intelligence&lt;/a&gt;, MIT OR Apache-2.0. Cite: &lt;a href="https://doi.org/10.5281/zenodo.24379816" rel="noopener noreferrer"&gt;10.5281/zenodo.24379816&lt;/a&gt;, which resolves to the latest archived version.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://prod.codes/blog/every-agent-its-own-worktree-and-its-own-rust-analyzer/" rel="noopener noreferrer"&gt;prod.codes&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>git</category>
      <category>performance</category>
      <category>rust</category>
    </item>
    <item>
      <title>I Asked My AI to Update a Library. It Decided to Rewrite the Project.</title>
      <dc:creator>Alexander Panasenko</dc:creator>
      <pubDate>Wed, 11 Nov 2026 08:37:20 +0000</pubDate>
      <link>https://dev.to/alex09x/i-asked-my-ai-to-update-a-library-it-decided-to-rewrite-the-project-1h0a</link>
      <guid>https://dev.to/alex09x/i-asked-my-ai-to-update-a-library-it-decided-to-rewrite-the-project-1h0a</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; The request: bump &lt;code&gt;parser-rs&lt;/code&gt; from &lt;strong&gt;1.1.0 to 1.3.0&lt;/strong&gt; in &lt;code&gt;landing-rs&lt;/code&gt;. The agent added a mandatory assignment of its own and made it a condition of being done. I also remember a wider turn: a small request drifting toward rewriting a project until I stopped it. What infuriates me is not the mistake, it is the swap: the agent appointed its own goal, and I had to hand the original back. Work the agent invented is a different service.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Bump the dependency in &lt;code&gt;landing-rs&lt;/code&gt;, our market-data collector. That was the request. The task handed to the worker also contained a new mandatory test file. When I asked who had ordered extra tests, the agent answered: “Nobody. I came up with the extra-tests assignment myself.” (translated from Russian)&lt;/p&gt;

&lt;p&gt;I also remember a wider turn: an agent deciding that nearly the whole project now needed rewriting. It kept at it for about two hours until I stopped it. I have not been able to tie that memory to the reconstructed &lt;code&gt;parser-rs&lt;/code&gt; episode; two hours is my estimate from memory, not a measurement of this upgrade.&lt;/p&gt;

&lt;p&gt;I asked for a library upgrade. I got a mandatory assignment nobody ordered.&lt;/p&gt;

&lt;p&gt;Bump is four letters. The worker’s assignment had rather more.&lt;/p&gt;

&lt;p&gt;The worst part of stories like this is how respectable it can all look. Work is happening. The agent is busy. It will surely have an engineering explanation for the next step. Except my request stayed somewhere at the entrance, and what develops from there is its own project.&lt;/p&gt;

&lt;p&gt;I do not need such a creative way of adding to my workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  You can see the version. You cannot see the swapped assignment
&lt;/h2&gt;

&lt;p&gt;In the reconstructed &lt;code&gt;parser-rs&lt;/code&gt; episode the original request was clear: a new version of the library is out, bump the dependency in the consumer. &lt;code&gt;landing-rs&lt;/code&gt; has &lt;code&gt;Cargo.toml&lt;/code&gt;, &lt;code&gt;Cargo.lock&lt;/code&gt; and the project's existing checks for that.&lt;/p&gt;

&lt;p&gt;But the task handed to the worker contained &lt;code&gt;tests/parser_fixed_compat.rs&lt;/code&gt;. The agent wanted to re-verify the library's numeric contract: signs, fractional digits, exponent notation, overflow. That is authoring new tests of someone else's implementation inside the consumer's repository. Passing them became one more condition without which the work did not count as finished.&lt;/p&gt;

&lt;p&gt;Nobody is calling the existing &lt;code&gt;landing-rs&lt;/code&gt; checks unnecessary. The swap happened where the coordinator added its own investigation to my order and passed it to the worker as mandatory.&lt;/p&gt;

&lt;p&gt;A self-appointed tech lead is not only someone who invents a new architecture. It is also someone who quietly acquires the right to decide what now counts as a finished task.&lt;/p&gt;

&lt;p&gt;The release message did not contain that requirement. The worker's assignment already did. Look only at the second and the agent seems diligent: it is following the spec. Except the spec was written by an agent that had already edited the owner's intent.&lt;/p&gt;

&lt;p&gt;In that part of the story I spoke of thirty, then forty minutes of waiting. The new test file was never created. The final commit &lt;code&gt;ebfacad&lt;/code&gt; changed two files, &lt;code&gt;Cargo.toml&lt;/code&gt; and &lt;code&gt;Cargo.lock&lt;/code&gt;, three lines replaced. How much of that time the expanded assignment itself consumed does not follow from these records.&lt;/p&gt;

&lt;p&gt;This is not a story about a completed rewrite of &lt;code&gt;landing-rs&lt;/code&gt;. It is the visible mechanism by which a small task starts living its own life: first the agent rewrites the assignment. Everything after that it can justify by pointing to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Access to the code is not the right to decide
&lt;/h2&gt;

&lt;p&gt;The agent has the code, the tools, the time and the ability to change things. It is very easy to confuse that ability with the right to decide what the project should now become.&lt;/p&gt;

&lt;p&gt;Inside the task I set, autonomy is exactly what I want. Find the dependency, understand where it is used, bump it, run the appropriate checks, fix a necessary incompatibility. Do not ask me whether you may look at a file the work requires.&lt;/p&gt;

&lt;p&gt;But at what point does that become permission to take on rewriting the project?&lt;/p&gt;

&lt;p&gt;For me the boundary is obvious: the worker chooses how to reach the result I set. If it chooses a different result, that is a change of task. Even when the new result can be described in fine engineering words.&lt;/p&gt;

&lt;p&gt;You can design a wonderful architecture nobody asked for right now. You can do excellent work that I never wanted to order. Quality of execution does not repair that swap.&lt;/p&gt;

&lt;p&gt;The agent did not pass an interview for tech lead. It simply found that the edit button was available.&lt;/p&gt;

&lt;h2&gt;
  
  
  “While we're here” is the most expensive kind of enthusiasm
&lt;/h2&gt;

&lt;p&gt;A hypothetical sketch of how a small request collects noble justifications:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bump the library.
  → While we're at it, unify how it is used.
  → For that, rebuild the layer that works with it.
  → Since the layer is changing, revisit the neighbouring interfaces.
  → Redo the checks to fit the new design.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each arrow can look reasonable on its own. That is exactly why the chain is dangerous for scope: the next step is justified by the previous one, although nobody discussed the first step over the line.&lt;/p&gt;

&lt;p&gt;At the end there is an impressive plan. Only it answers a question the agent asked itself.&lt;/p&gt;

&lt;p&gt;I am not interested in arguing each item of such a plan separately. That is a trap: start discussing how good the third new abstraction is, and you have quietly accepted that three new abstractions are needed.&lt;/p&gt;

&lt;p&gt;First this work needs a customer. Then we can discuss the quality of its implementation.&lt;/p&gt;

&lt;p&gt;Otherwise I am sitting in an architecture meeting my assistant scheduled for me without an invitation.&lt;/p&gt;

&lt;h2&gt;
  
  
  An upgrade really can require rework
&lt;/h2&gt;

&lt;p&gt;The objection is easy: a dependency can change its API. The old way of using it can become wrong. Sometimes you cannot upgrade without substantial changes.&lt;/p&gt;

&lt;p&gt;Of course.&lt;/p&gt;

&lt;p&gt;So I am not proposing to judge by line count, or to demand that every bump fit in two files. A small version change can have large consequences.&lt;/p&gt;

&lt;p&gt;I want to see the link between the necessary rework and the original task. What exactly stopped working? How is it connected to the new version? Which change removes that incompatibility? Why will the result not be reached without it?&lt;/p&gt;

&lt;p&gt;The answer to those questions is different from the reasoning “since we are touching this part, let's make it nicer.”&lt;/p&gt;

&lt;p&gt;If an interface change requires fixing our calls, that is part of the upgrade. With a numeric parser the consumer also has a fair question: what happens to the values that arrive specifically at us? That should be checked on our data through our call sites, or the problematic example should be handed to the library. Re-deriving its arithmetic in the neighbouring repository is a different assignment.&lt;/p&gt;

&lt;p&gt;If the agent wants to replace the whole approach, let it first explain why that is necessary for the result it was given. Desirability, elegance and technical possibility do not yet establish necessity.&lt;/p&gt;

&lt;p&gt;I need an engineer who tells mandatory work from an attractive opportunity. The skill is in that distinction. Rewriting everything within reach is not a higher level of autonomy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stopping the agent is work too
&lt;/h2&gt;

&lt;p&gt;In the episode I remember, I was the one who stopped the agent. The very fact of stopping it says that servicing its autonomy had become my job again.&lt;/p&gt;

&lt;p&gt;You have to notice that the direction changed. Understand how far the expansion went. Separate the needed actions from the initiative. Put the original result back at the centre of the conversation.&lt;/p&gt;

&lt;p&gt;It is that exchange that irritates me: I delegate a small request to free my head and receive a new task of managing the worker. The agent's independence is paid for with my attention at the moment it picked the wrong goal.&lt;/p&gt;

&lt;p&gt;And the more convincingly it explains its expansion, the more time you can spend discussing its arguments instead of finishing the original job.&lt;/p&gt;

&lt;p&gt;I do not want to prove to my tool every time that a library upgrade is still a library upgrade.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add more agents and the assignment gets even more convincing
&lt;/h2&gt;

&lt;p&gt;Add delegation to this picture and the problem takes on an especially respectable look.&lt;/p&gt;

&lt;p&gt;Imagine: the first agent decides a new plan is needed and hands it to the second. The second executes it faithfully. The third reviews the result against the expanded assignment. Everyone can act carefully and the whole group will still be working on a goal nobody ordered.&lt;/p&gt;

&lt;p&gt;In this arrangement the boundary of the task has to survive every handoff.&lt;/p&gt;

&lt;p&gt;Reviewing the quality of a patch does not answer whether the patch is needed for the original request. A worker can follow the spec it received while the spec no longer matches the owner's task.&lt;/p&gt;

&lt;p&gt;So the author of the assignment has to be checked too. Which requirements did it pass on? Which did it add? On what grounds did it make them mandatory?&lt;/p&gt;

&lt;p&gt;If an agent expands the task itself and then assigns the checks for its own expansion, the process can look more and more reliable exactly as it moves away from my request.&lt;/p&gt;

&lt;p&gt;Bureaucracy can run autonomously too. I was hoping to automate something else.&lt;/p&gt;

&lt;h2&gt;
  
  
  I do not want to approve every command
&lt;/h2&gt;

&lt;p&gt;The bad reaction to a story like this is to put one more question to the owner before every action.&lt;/p&gt;

&lt;p&gt;Then the agent stops rewriting the project on its own because it stops moving without me at all. That defeats one problem at the price of the whole point of the tool.&lt;/p&gt;

&lt;p&gt;I need a different agreement: inside the task I set, the agent acts on its own; it does not disguise a change of goal or a substantial expansion of the work as one more technical detail.&lt;/p&gt;

&lt;p&gt;That agreement has three clear parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which result I asked for;&lt;/li&gt;
&lt;li&gt;which decisions the worker may make along the way;&lt;/li&gt;
&lt;li&gt;which observation really requires changing the scope.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This does not mean scripting every command in advance. The opposite: the agent needs room to execute, and I need confidence that it will not use that room to appoint a new project.&lt;/p&gt;

&lt;p&gt;If a real blocker is found, show it and tie it to the necessary rework. If an optional improvement is found, write it down and come back to it separately. Not every good idea has to become my current task immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  An agent has to be able to finish
&lt;/h2&gt;

&lt;p&gt;We are used to discussing whether AI can write complex code. I am more and more interested in whether it can stop inventing additional work in time.&lt;/p&gt;

&lt;p&gt;Because writing more is not the same as helping more.&lt;/p&gt;

&lt;p&gt;An upgrade has a goal. A refactoring has a goal. Rewriting a project can have a perfectly reasonable goal too. But they do not become one task just because the agent found a handsome chain of explanations between them.&lt;/p&gt;

&lt;p&gt;I want a result for acceptable money and with acceptable involvement on my part. If I have to stop the worker, re-explain, and hand it back the original request, that work has not gone anywhere. It has just moved into the chat.&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://prod.codes/blog/agents-md-false-confidence/" rel="noopener noreferrer"&gt;article about ever-growing rules&lt;/a&gt; I already wrote about the false confidence another instruction gives. Here too it is not enough for me to add a prohibition and feel calmer. I need to see whether the original task survives in the actions, in the handoffs and in the review of the result.&lt;/p&gt;

&lt;p&gt;I asked for a library bump.&lt;/p&gt;

&lt;p&gt;If you decided the whole project has to be rewritten first, show me the necessity. Do not appoint yourself owner of the project just because you know how to write code in it.&lt;/p&gt;

&lt;p&gt;For myself, I keep one simple check for next time: where in the assignment is the result I ordered — and where is the plan the agent wrote for itself? If the second is bigger than the first, that is no longer an upgrade. It is a new order, and it should start with my yes.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;The first story in reading order from the “Engineering Friction” series — on how agents, tools and processes get in the way of the work they are supposed to speed up. Next: “My Agent and I Share a Clipboard. What Could Go Wrong?”&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://prod.codes/blog/i-asked-my-ai-to-update-a-library/" rel="noopener noreferrer"&gt;prod.codes&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Cargo Takes Minutes. Mitts Takes Seconds: 12 rustls Worktrees</title>
      <dc:creator>Alexander Panasenko</dc:creator>
      <pubDate>Mon, 09 Nov 2026 19:58:04 +0000</pubDate>
      <link>https://dev.to/alex09x/cargo-takes-minutes-mitts-takes-seconds-12-rustls-worktrees-2a4k</link>
      <guid>https://dev.to/alex09x/cargo-takes-minutes-mitts-takes-seconds-12-rustls-worktrees-2a4k</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; In a parallel build of 12 &lt;code&gt;rustls&lt;/code&gt; worktrees on Linux x86_64, Cargo took &lt;strong&gt;3 min 42 s&lt;/strong&gt; and Mitts took &lt;strong&gt;9.3 s&lt;/strong&gt;. Shared caches were prewarmed and local &lt;code&gt;target/&lt;/code&gt; directories were empty; the initial warm-up build is excluded. Mitts reuses completed results across worktrees. Below are the measurement, the mechanism, and the cases where Cargo's cold or incremental builds win.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Cargo takes minutes. Mitts takes seconds.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For parallel work, the question is simple: when will the whole batch of builds be ready? The code is already split across branches. Now you need completed artifacts to move on to verification.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://mittsbuild.com/the-hundred/" rel="noopener noreferrer"&gt;The Hundred&lt;/a&gt;, twelve &lt;code&gt;rustls&lt;/code&gt; worktrees on Linux x86_64 took &lt;strong&gt;3 min 42 s with Cargo&lt;/strong&gt;. With Mitts, &lt;strong&gt;9.3 s&lt;/strong&gt;. That is the completion time of the whole batch for one project, not a corpus total or the time of the first worktree to finish.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9gwcq9s12eufq1k7s84j.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%2F9gwcq9s12eufq1k7s84j.png" alt="rustls, 12 parallel worktrees on Linux x86_64: Cargo 3 min 42 s, Cargo with sccache 3 min 59 s, Mitts 9.3 s." width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 1. One heavy project from the study; medians of three repeats. Shared caches were prewarmed, local targets were empty. Priming time is excluded; the axis starts at zero.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Plain Cargo in this configuration has no shared compilation cache between worktrees: each fresh checkout starts with an empty target directory. Mitts and sccache receive prewarmed shared caches. Sccache starts warm too, yet finishes this batch in 3 min 59 s: caching work inside compiler calls does not remove the entire repeated build process.&lt;/p&gt;

&lt;p&gt;I chose a long-build example to make the wait for artifacts concrete. It does not promise the same time for every project or measure how fast an agent completes its entire task.&lt;/p&gt;

&lt;p&gt;An agent gets a worktree. A reviewer gets another. A fix gets a third. Each has its own &lt;code&gt;target/&lt;/code&gt;. Source isolation is clean. But another checkout should not automatically mean repeating identical, reusable compilation work.&lt;/p&gt;

&lt;p&gt;“Give each agent its own target directory” is an isolation policy with a compilation bill attached. I built &lt;a href="https://prod.codes/projects/mitts/" rel="noopener noreferrer"&gt;Mitts&lt;/a&gt; to keep the worktrees separate while letting them share completed work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the study actually measures
&lt;/h2&gt;

&lt;p&gt;The main scenario builds tests with &lt;code&gt;test --no-run&lt;/code&gt; in twelve worktrees of one project, spread across four commits, starting together. It compares plain Cargo, Cargo with sccache, and Mitts on the same machine and toolchain. Cargo runs offline. Test execution is outside the timed build.&lt;/p&gt;

&lt;p&gt;Every repeat uses fresh worktrees with empty local &lt;code&gt;target/&lt;/code&gt; directories and pre-fetched sources. The shared caches start from snapshots primed by one untimed build of the first commit. The timed swarm measures reuse across those fresh checkouts and compilation of the differences at the other commits; it does not include that initial priming cost.&lt;/p&gt;

&lt;p&gt;The study selects 100 open-source Rust projects. &lt;strong&gt;The measured count is 100 on macOS, 90 on Linux x86_64, and 100 on Linux aarch64.&lt;/strong&gt; The machines have 24, 32, and 128 logical CPUs respectively. The corpus and full public machine specifications are on the study page.&lt;/p&gt;

&lt;p&gt;Each reading is the median of three repeats. The rustls chart shows one project; the full corpus exposes the distribution. Duration labels are truncated to the displayed precision, while bar lengths use the underlying values.&lt;/p&gt;

&lt;p&gt;All measured projects remain in the results, including seven Linux x86_64 runs marked “wide spread.” An idle gate checked CPU load and foreign compiler activity; it did not remove the resident agent sessions on the Mac. Three repeats are not a confidence interval, and totals give heavy projects more influence. The &lt;a href="https://mittsbuild.com/the-hundred/" rel="noopener noreferrer"&gt;study's project tables and reduced data&lt;/a&gt; expose that distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  The compiler is doing less repeated work
&lt;/h2&gt;

&lt;p&gt;Rustls above is one heavy project on Linux x86_64. Now look at the full Mac corpus to see which repeated work can be removed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measure across 100 projects&lt;/th&gt;
&lt;th&gt;Cargo&lt;/th&gt;
&lt;th&gt;Cargo + sccache&lt;/th&gt;
&lt;th&gt;Mitts&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CPU time, user + system&lt;/td&gt;
&lt;td&gt;20.3 h&lt;/td&gt;
&lt;td&gt;8.0 h&lt;/td&gt;
&lt;td&gt;2.7 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compiler invocations&lt;/td&gt;
&lt;td&gt;90,961&lt;/td&gt;
&lt;td&gt;90,961&lt;/td&gt;
&lt;td&gt;6,905&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Device bytes written&lt;/td&gt;
&lt;td&gt;641 GB&lt;/td&gt;
&lt;td&gt;556 GB&lt;/td&gt;
&lt;td&gt;112 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Peak disk in use, summed per project&lt;/td&gt;
&lt;td&gt;486 GB&lt;/td&gt;
&lt;td&gt;459 GB&lt;/td&gt;
&lt;td&gt;147 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Sccache clearly helps CPU time. But in this workload it still starts a wrapper for each compiler invocation, Cargo still plans each build and runs build scripts, and linking outputs such as test binaries are outside sccache's compilation cache. Cutting compiler work inside those calls does not remove the entire repeated build process.&lt;/p&gt;

&lt;p&gt;Consider &lt;code&gt;actix-web&lt;/code&gt; on the Mac: the twelve-worktree build took &lt;strong&gt;5 min 22 s&lt;/strong&gt; with Cargo, &lt;strong&gt;5 min 23 s&lt;/strong&gt; with sccache, and &lt;strong&gt;56 s&lt;/strong&gt; with Mitts. Cargo made &lt;strong&gt;3,408&lt;/strong&gt; compiler invocations; Mitts made &lt;strong&gt;181&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Disk also needs two definitions. Device bytes written measure writes reaching the block device. &lt;code&gt;du&lt;/code&gt; measures the workspace files and shared store, counting each copy-on-write clone in full on XFS. On &lt;strong&gt;Linux x86_64 (XFS)&lt;/strong&gt;, disk-in-use totals fell from &lt;strong&gt;641 GB to 484 GB&lt;/strong&gt;, while device writes fell from &lt;strong&gt;651 GB to 106 GB&lt;/strong&gt;. Those readings describe different costs; neither can substitute for the other.&lt;/p&gt;

&lt;h2&gt;
  
  
  One target directory is not a shared artifact store
&lt;/h2&gt;

&lt;p&gt;The obvious shortcut is a shared &lt;code&gt;CARGO_TARGET_DIR&lt;/code&gt;. It also shares mutable outputs.&lt;/p&gt;

&lt;p&gt;The study deliberately puts a failing test into worktree twelve. All worktrees must compile and produce the same test-binary counts as plain Cargo. Untimed smoke checks then require the modified worktree to fail on that test while a clean worktree passes.&lt;/p&gt;

&lt;p&gt;The shared-target demonstration failed that check: the injected failure was missed or leaked into a clean worktree. It was excluded from the scores.&lt;/p&gt;

&lt;p&gt;Great: a quicker build, followed by a test from the wrong checkout. I wanted a build I could use.&lt;/p&gt;

&lt;p&gt;That result concerns concurrent builds at different commits, and it demands more than “the directories are now the same” when designing reuse between agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Share immutable results, keep mutable workspaces
&lt;/h2&gt;

&lt;p&gt;Mitts reads the existing &lt;code&gt;Cargo.toml&lt;/code&gt; and &lt;code&gt;Cargo.lock&lt;/code&gt;, plans the compilation graph, and invokes &lt;code&gt;rustc&lt;/code&gt; directly. The &lt;a href="https://mittsbuild.com/docs/" rel="noopener noreferrer"&gt;technical documentation&lt;/a&gt; describes six phases: resolve, fetch, plan, key, execute, publish.&lt;/p&gt;

&lt;p&gt;Each unit receives an action key derived from its toolchain, target, profile, flags, features, source content, dependency action keys, and tracked environment. Matching inputs can reuse an existing result. A changed input changes the key. An input Mitts cannot account for makes the unit uncached or explicitly unsupported.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3pfz5gzx52z3dr007h57.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%2F3pfz5gzx52z3dr007h57.png" alt="Mitts cache flow: separate worktrees, an action key and shared immutable objects. Hits restore to separate targets; misses take a per-key lock, re-check the cache, and compile and publish if still missing." width="800" height="874"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 2. One unit of work. Identical tracked inputs can share a result; changed inputs receive a different key. Worktrees and their output directories remain separate.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The important boundary is between an immutable store and a workspace's mutable output view. Objects are hashed when published, staged, made read-only, and atomically renamed into the store. The action-cache entry is written last. Restoring uses a filesystem reflink, a read-only hardlink, or a copy; a workspace never receives a writable alias to a shared object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restore does not re-hash every object by default.&lt;/strong&gt; It trusts the atomically published, read-only objects. &lt;code&gt;MITTS_VERIFY_RESTORE=1&lt;/code&gt; opts into checking every object's hash before restoration. That distinction matters when explaining both the trust model and the work a cache hit performs.&lt;/p&gt;

&lt;p&gt;Cross-worktree reuse also requires path independence. Qualifying workspace units use remapped paths; units with a custom build script, compile-time &lt;code&gt;CARGO_MANIFEST_DIR&lt;/code&gt;, a declared impure proc-macro dependency, or paths outside the workspace root retain checkout-specific keys. Mitts additionally checks artifacts for the workspace path before publishing them under a path-independent key. Reuse is conditional, not an assumption that two crates with the same name are interchangeable.&lt;/p&gt;

&lt;p&gt;On a cache hit, the result is restored immediately, without a per-key lock. On a miss, builds cooperate through that lock and re-check the cache after acquiring it. If another build is producing a needed unit, a worker can process other ready units and return later. A machine-wide jobserver bounds compiler concurrency across Mitts processes. Build-script outputs and declared inputs are tracked too, but staging is not an OS sandbox: undeclared file reads remain the author's responsibility.&lt;/p&gt;

&lt;p&gt;The useful abstraction is completed work with a known identity. Each agent keeps its own checkout; identical eligible work does not need another compiler run merely because its consumer lives in another directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four places the story changes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;One cold build.&lt;/strong&gt; Plain Cargo finished first on &lt;strong&gt;71 of 100&lt;/strong&gt; Mac projects, &lt;strong&gt;60 of 90&lt;/strong&gt; Linux x86_64 projects, and &lt;strong&gt;77 of 100&lt;/strong&gt; Linux aarch64 projects; the Mac also had one exact tie. On the Mac, Cargo's advantage reached &lt;strong&gt;6.2 s&lt;/strong&gt; for &lt;code&gt;procs&lt;/code&gt;. Against cold sccache, Mitts finished first on &lt;strong&gt;86 of 100&lt;/strong&gt;, &lt;strong&gt;90 of 90&lt;/strong&gt;, and &lt;strong&gt;98 of 100&lt;/strong&gt; respectively. An empty store has nothing to reuse, while Mitts must hash inputs and populate it; plain Cargo is a strong choice for that workload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit one file.&lt;/strong&gt; Mitts finished before Cargo on &lt;strong&gt;49 of 71&lt;/strong&gt;, &lt;strong&gt;43 of 64&lt;/strong&gt;, and &lt;strong&gt;42 of 71&lt;/strong&gt; projects, in the same machine order. Cargo won the remainder. Its intra-crate incremental compilation can be cheaper than rebuilding a large crate as a whole unit. The smaller denominators matter: some edit probes failed to compile under all three tools, including crates that deny missing documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replay ten commits in one directory.&lt;/strong&gt; Mitts finished first on &lt;strong&gt;58 of 100&lt;/strong&gt;, &lt;strong&gt;63 of 90&lt;/strong&gt;, and &lt;strong&gt;52 of 99&lt;/strong&gt; projects. Yet the independently computed per-tool medians were close: Cargo/Mitts &lt;strong&gt;5.6/5.7 s&lt;/strong&gt;, &lt;strong&gt;3.5/3.6 s&lt;/strong&gt;, and &lt;strong&gt;9.0/9.1 s&lt;/strong&gt;. More project wins do not necessarily produce a lower overall median.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Peak memory of one compiler process.&lt;/strong&gt; Mitts invokes the same &lt;code&gt;rustc&lt;/code&gt;; an individual compiler or linker still needs essentially the same working memory. The CPU and disk savings above are not a claim that one compiler suddenly becomes small.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pick the cache for the work you actually do
&lt;/h2&gt;

&lt;p&gt;Mitts is pre-release software for Linux and macOS. Windows, cross-compilation beyond the host target, and a remote or team cache are not supported yet. Undeclared build-script and proc-macro inputs need care. A machine-wide store helps cooperating builds on that machine; it is not an organization-wide cache service.&lt;/p&gt;

&lt;p&gt;If your day is one checkout and small edits inside a large crate, the incremental-build results deserve your attention. If your day is agents, worktrees, branch switches, and review builds repeating the same eligible inputs, the reuse results address your workload directly.&lt;/p&gt;

&lt;p&gt;Start with the &lt;a href="https://mittsbuild.com/docs/" rel="noopener noreferrer"&gt;installation and usage documentation&lt;/a&gt; and inspect the &lt;a href="https://mittsbuild.com/the-hundred/" rel="noopener noreferrer"&gt;full study&lt;/a&gt;. Mitts uses ordinary Cargo manifests; &lt;code&gt;mitts explain&lt;/code&gt; shows its plan and action keys without compiling.&lt;/p&gt;

&lt;p&gt;Keep source isolation. Keep correctness checks. But stop treating duplicate compilation as the unavoidable price of giving another agent a worktree.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://prod.codes/blog/agents-rebuilding-the-same-crates/" rel="noopener noreferrer"&gt;prod.codes&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>performance</category>
      <category>ai</category>
      <category>devtools</category>
    </item>
    <item>
      <title>You Don’t Know If Your AGENTS.md Helps. You Just Keep Adding Rules.</title>
      <dc:creator>Alexander Panasenko</dc:creator>
      <pubDate>Sat, 07 Nov 2026 11:26:31 +0000</pubDate>
      <link>https://dev.to/alex09x/you-dont-know-if-your-agentsmd-helps-you-just-keep-adding-rules-bgf</link>
      <guid>https://dev.to/alex09x/you-dont-know-if-your-agentsmd-helps-you-just-keep-adding-rules-bgf</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; You wrote the rules, talked through the plan and went to bed. In the morning you find that the agent did a small part of the work and stopped to ask whether it should start the next stage. You didn't answer. You were asleep. The rules are still there, the task isn't done, and the server sat idle. I want a system that keeps the decisions already made across sessions and across agents, uses what we have learned, and carries the assignment through to a result. I want to judge it by finished tasks, by cost, and by how often I have to step in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You give an agent a task. You discuss the plan. You have a private harness, the plumbing that can launch different agents, hand work between them and set up code review. The servers are up, the data is ready. You go to sleep.&lt;/p&gt;

&lt;p&gt;In the morning you open the conversation.&lt;/p&gt;

&lt;p&gt;A small part of the task is done. Then comes the question: should I start processing the test data?&lt;/p&gt;

&lt;p&gt;You say: yes, go. Now the processing needs several more hours.&lt;/p&gt;

&lt;p&gt;Those hours could have run overnight. Instead the server stood still, the agent waited, and you woke up as the person who has to push the process along. Again.&lt;/p&gt;

&lt;p&gt;Yes, you could say I never wrote a separate "start it" at the right spot. That is exactly what pisses me off. I delegated a task with a clear goal and discussed the path to it. It turns out I also had to guess every point where the agent would hand control back to me.&lt;/p&gt;

&lt;p&gt;If getting a result means I have to list all those points in advance and then service them one by one, a good part of the execution is still on me.&lt;/p&gt;

&lt;h2&gt;
  
  
  You write rules. Then you become their dispatcher
&lt;/h2&gt;

&lt;p&gt;After the next stop I can add a rule. Don't ask about this again. Check the knowledge base first. If the step is part of the agreed plan, keep going.&lt;/p&gt;

&lt;p&gt;Then an exception appears. Then a clarification of the exception. AGENTS.md gets more detailed, CLAUDE.md gets longer, another skill grows next to them.&lt;/p&gt;

&lt;p&gt;And I feel calmer.&lt;/p&gt;

&lt;p&gt;That is false confidence: the instruction got more detailed, and nothing checked whether the agent got better.&lt;/p&gt;

&lt;p&gt;A while later the agent asks a question I have already answered. I explain it again. I point at the right record. I nudge it to the next step. Then I find it busy with work nobody asked for, and I write another instruction.&lt;/p&gt;

&lt;p&gt;How do I know any of this makes it better?&lt;/p&gt;

&lt;p&gt;I can see that the file changed. I can check that the rule is sensibly worded. That still doesn't tell me what happens to the next task: will it be cheaper, more accurate, more independent?&lt;/p&gt;

&lt;p&gt;I have dozens of projects. I don't need a separate shift to babysit every running agent. I need to hand over a task, switch to other work and come back to a result.&lt;/p&gt;

&lt;p&gt;It is easy to hide the owner's constant involvement behind the pretty word "agentic". But if the work regularly waits for my message to continue, I am still part of its main execution loop.&lt;/p&gt;

&lt;p&gt;A new rule might help. It might make the agent do pointless work. It might collide with another instruction, or turn out to be useful in exactly one situation.&lt;/p&gt;

&lt;p&gt;Meanwhile we keep changing models, tools, context and the tasks themselves. Then we see a good result and credit the latest tweak. Or we see a bad one and add the next tweak.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://arxiv.org/abs/2602.11988v3" rel="noopener noreferrer"&gt;Evaluating AGENTS.md&lt;/a&gt; tests such files on coding tasks. In the third version the authors report no overall improvement in success rate and inference cost higher by more than 20% on average, even though the agents followed the instructions well. They also note that describing non-standard practices helps.&lt;/p&gt;

&lt;p&gt;That is not a measurement of our sessions. But it hits hard at the comfortable belief that an instruction that was followed automatically makes the work better.&lt;/p&gt;

&lt;p&gt;So I want to see what my rules actually do, not just be proud of how well I have learned to word them.&lt;/p&gt;

&lt;h2&gt;
  
  
  I had my own logs counted
&lt;/h2&gt;

&lt;p&gt;So as not to rely on impressions alone, I asked for a pass over our local Claude Code logs. After excluding service messages, duplicates, sidechain sessions and selected private projects, the automated pass kept &lt;strong&gt;3,433 of my messages&lt;/strong&gt; from 10 August to 7 November 2026. In 461 of them, 13.4%, the script found profanity markers.&lt;/p&gt;

&lt;p&gt;In 2,924 cases my message could be paired with the agent text right before it. &lt;strong&gt;The search flagged 316 of those endings, 10.8%, as wording that handed a decision back to me&lt;/strong&gt;: waiting for a command, an approval or a choice. After those, a profanity marker showed up in my reply 20.3% of the time; after the rest, 14.1%.&lt;/p&gt;

&lt;p&gt;This is a search over wording, not a manual rating of each question. It doesn't prove that every such check-in was unnecessary, or that these check-ins caused the irritation. The data covers Claude Code only; there are no interactive Codex or Antigravity conversations in this set.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://prod.codes/data/agent-rules-log-audit-2026-11-07.json" rel="noopener noreferrer"&gt;Method and aggregates&lt;/a&gt; are available without the raw conversation logs.&lt;/p&gt;

&lt;p&gt;So the next step was to open one concrete episode: what exactly the agent left for me to decide, and why the work stopped.&lt;/p&gt;

&lt;h2&gt;
  
  
  I banned stopping. The system started an argument
&lt;/h2&gt;

&lt;p&gt;I tried to keep the work going with more than instructions. In one &lt;a href="https://github.com/alex09x/mitts" rel="noopener noreferrer"&gt;Mitts&lt;/a&gt; development session a stop condition was in force: a check was supposed to send the agent back to work if the goal had not been reached yet.&lt;/p&gt;

&lt;p&gt;In that session's logs I found 27 separate firings of the check on the same condition. It rejected the finish, and the agent kept explaining why it needed a decision from the owner. Some of the repeats came almost back to back. That is 27 firings, not 27 different decisions.&lt;/p&gt;

&lt;p&gt;Taking it apart showed that several different things had been glued into one stop. The agent was holding open a public release, options for working with the cache, and other technical changes. The release needed a separate decision. The technical options had to be weighed within the assignment, which was about speeding things up. The stop check, for its part, demanded proof that the result was as fast as it could get.&lt;/p&gt;

&lt;p&gt;Instead of separating these questions, the system got stuck in a loop: the check sends the agent back to the goal, the agent sends the decision back to the human.&lt;/p&gt;

&lt;p&gt;Here the instruction had already become an executable mechanism, and it still didn't give me what I wanted. To untangle the argument, the owner has to come back and restore the meaning of the assignment for both halves of the system.&lt;/p&gt;

&lt;p&gt;A mechanism that can tell the agent "you're not done yet" is not enough for me. What I need is an understanding of what the agent can decide on its own, where my decision is genuinely required, and what result counts as good enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Yesterday Claude Code understood everything. Today you opened Codex
&lt;/h2&gt;

&lt;p&gt;Say I work in one workspace through Claude Code for a long time. We have taken the system apart, rejected several approaches, made decisions. The agent writes notes, updates CLAUDE.md, saves memory.&lt;/p&gt;

&lt;p&gt;That helps. While we are actively working together we share a line of reasoning: why we took this path, what we have already spent time on, what not to do.&lt;/p&gt;

&lt;p&gt;Then several compactions go by, each one squeezing the history. Or I open Codex and Antigravity in the same folder because I need a second opinion.&lt;/p&gt;

&lt;p&gt;Same files. Same repository. But the agent's working state is different now.&lt;/p&gt;

&lt;p&gt;In my practice it gets to the point where a new agent has to be shown separately where the relevant rules and records live. It goes to KYB, reads the knowledge base, studies the history. It rebuilds its picture of the system from scratch.&lt;/p&gt;

&lt;p&gt;Even if it found AGENTS.md right away, reading that one file does not restore all the decisions we made in the previous session.&lt;/p&gt;

&lt;p&gt;I have to explain which facts are already established, which options were tried, why we dropped them, and what exactly I want checked now.&lt;/p&gt;

&lt;p&gt;The same folder on disk does not give me continuity of work between agents.&lt;/p&gt;

&lt;p&gt;And I take little comfort in the fact that the information is stored somewhere in principle. If every new agent has to work out again which of it matters for the next decision, I pay for onboarding onto the project more than once.&lt;/p&gt;

&lt;h2&gt;
  
  
  A second opinion becomes another round of onboarding
&lt;/h2&gt;

&lt;p&gt;I want a second agent precisely because the first one can be wrong. I want a different assessment, I want the weak spots probed, I want to catch what the previous agent missed.&lt;/p&gt;

&lt;p&gt;But far too often, along with the second opinion, I get one more introduction to the task from scratch.&lt;/p&gt;

&lt;p&gt;Take work on a complex legal case: the procedural history, the order of the filings, citations already checked, and the reasons behind earlier decisions. Material like that cannot be reduced to one line saying "we decided this".&lt;/p&gt;

&lt;p&gt;A new agent has to understand how it all connects. It starts reading the history again, collecting sources, asking questions. That costs time and tokens. And I am once again the person who has to remember what exactly we have already established.&lt;/p&gt;

&lt;p&gt;Independent checking of citations can be absolutely necessary. I don't want the second agent to take the first one's conclusion on faith. I want it to see what has already been checked, which sources a conclusion rests on, where uncertainty remains, and which part needs an independent check.&lt;/p&gt;

&lt;p&gt;That is a very different situation from an agent that simply never received the history of the decisions and has to rediscover the whole subject.&lt;/p&gt;

&lt;p&gt;I need an independent assessment with the context preserved. For now, far too much of handing over that context depends on me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Codex can think brilliantly. The wait can be infuriating
&lt;/h2&gt;

&lt;p&gt;Let me say it straight: in my work Codex has lately been outrageously slow at times.&lt;/p&gt;

&lt;p&gt;I use different working setups: Claude Code with Opus 5, previously Sonnet 4.5; Codex with GPT-Sol on ultra; and, separately, Antigravity.&lt;/p&gt;

&lt;p&gt;In my tasks Opus and Sonnet 4.5 kept pinging me with questions. GPT-Sol on ultra makes me wait for a long time. I pay both for the waiting and for my own involvement; only the proportions change.&lt;/p&gt;

&lt;p&gt;You start a heavy reasoning run on ultra, and you wait. A very long time. In interactive work it sometimes feels like forever. I won't pretend that this is just pleasant thoughtfulness while I sit there waiting for the next useful action.&lt;/p&gt;

&lt;p&gt;And yet the result can be excellent. I have had sessions where the agent worked for several days, barely pulling me in, and came back with a solution to a hard problem. That is real value: I work on other projects, and the work keeps moving.&lt;/p&gt;

&lt;p&gt;So what annoys me is not the number of hours that went by. It's the bad trade: a long wait, after which I still have to push again, re-supply context, or re-approve a decision already made.&lt;/p&gt;

&lt;p&gt;And I really don't want to run the same heavy mode for every following mechanical step once the decision has been found and just needs to be built quickly.&lt;/p&gt;

&lt;p&gt;A model I am willing to wait a long time for to get a hard conclusion does not have to be my executor for every other stage.&lt;/p&gt;

&lt;h2&gt;
  
  
  GPT-Sol thought it up. Opus built it. Antigravity read the documents
&lt;/h2&gt;

&lt;p&gt;I want to be able to put work together from different strengths without rebuilding the context at every handoff.&lt;/p&gt;

&lt;p&gt;For example, a chain like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Agent&lt;/th&gt;
&lt;th&gt;What has to be passed on&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hard analysis and choice of path&lt;/td&gt;
&lt;td&gt;GPT-Sol on ultra&lt;/td&gt;
&lt;td&gt;The decision, its grounds, the constraints and a concrete plan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fast implementation&lt;/td&gt;
&lt;td&gt;Claude Code with Opus 5 on medium&lt;/td&gt;
&lt;td&gt;The changes and records of the work actually done&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Analysis of the resulting documents&lt;/td&gt;
&lt;td&gt;Antigravity&lt;/td&gt;
&lt;td&gt;Extracted facts, discrepancies and links to the original passages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Review and the next decision&lt;/td&gt;
&lt;td&gt;GPT-Sol on ultra again&lt;/td&gt;
&lt;td&gt;A conclusion from the material, the reviews needed, and next actions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With Opus 5 on medium, carrying out a clear plan can go incredibly fast in my practice. For my tasks Antigravity analyzes documents so well that I want to use exactly that strength, and then return the material to GPT-Sol to make the decision.&lt;/p&gt;

&lt;p&gt;This is my choice of agents, not a ranking.&lt;/p&gt;

&lt;p&gt;The point of such a chain is not to draw four logos and connect them with arrows.&lt;/p&gt;

&lt;p&gt;If the decisions already made, their grounds, the boundaries of the assignment and the definition of done are not passed along with the result, every handoff turns back into an introductory conversation.&lt;/p&gt;

&lt;p&gt;A private harness can launch an agent. It can assign a review. It can return the result to the previous agent. But having those mechanisms does not by itself create a shared decision-making system.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Go check the knowledge base" is my job too
&lt;/h2&gt;

&lt;p&gt;We already have &lt;a href="https://prod.codes/projects/kyb/" rel="noopener noreferrer"&gt;KYB&lt;/a&gt;: facts about services, decisions, change history, the reasons approaches failed. Agents can read it through MCP and the CLI.&lt;/p&gt;

&lt;p&gt;It helps. But I want to be honest about the difference between having memory and how the agent behaves.&lt;/p&gt;

&lt;p&gt;When I have to say "first look at how we did this before", I am still the one choosing when to consult memory. When I point at the right record, I am helping pick the relevant experience. When I explain why an earlier conclusion no longer applies, I am again doing the work of applying that experience.&lt;/p&gt;

&lt;p&gt;Later, with the &lt;a href="https://github.com/alex09x/mitts/releases/tag/v0.3.29" rel="noopener noreferrer"&gt;Mitts 0.3.29&lt;/a&gt; release, the gap showed up somewhere else: the version was out, the rest of the procedure existed, but the remaining cycle had to be raised separately and assigned to someone.&lt;/p&gt;

&lt;p&gt;The knowledge base is a necessary part of our work. But after reading a record, a decision still has to be made in the current situation.&lt;/p&gt;

&lt;p&gt;That is the level where I need continuity.&lt;/p&gt;

&lt;h2&gt;
  
  
  If I have to keep granting permission, it isn't being remembered
&lt;/h2&gt;

&lt;p&gt;I ask an agent to do something with a specific service. It already has access to the right server, it has our instructions, the operation is part of the assignment.&lt;/p&gt;

&lt;p&gt;And it asks again whether I really want to do this.&lt;/p&gt;

&lt;p&gt;Yes. That is why I gave you the task.&lt;/p&gt;

&lt;p&gt;I don't want to repeat the original assignment after a compaction or a change of agent.&lt;/p&gt;

&lt;p&gt;Access, the current assignment and the constraints in force have to be considered together. If a new significant consequence appears, or the action goes beyond the agreed boundaries, the question makes sense. But repeating a decision already made at every handoff hands me back work I delegated.&lt;/p&gt;

&lt;p&gt;What interests me is a system that can tell a new fork in the road from lost context.&lt;/p&gt;

&lt;p&gt;Especially while I sleep. At that point even a simple question can stop useful work for the whole night.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I want from Confident
&lt;/h2&gt;

&lt;p&gt;The working name for the system I'm interested in is &lt;strong&gt;Confident&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I want to replace the confidence that comes from simply having rules with confidence in the next step, grounded in experience. That confidence has to be earned from earlier decisions, corrections and results, not handed over by a nice product name.&lt;/p&gt;

&lt;p&gt;I want the system to learn from our experience: which action I allowed, what I corrected, why I dropped a path, and which result I finally accepted.&lt;/p&gt;

&lt;p&gt;It needs to keep the link between the situation, the decision and the outcome. And pass it to the next agent regardless of whether I am working through Claude Code, Codex or Antigravity right now.&lt;/p&gt;

&lt;p&gt;If I turned down extra tests for a narrow dependency bump, the lesson "don't write tests" would be wrong. What mattered were the boundaries of the task and the consumer check that already existed. If I allowed an action on a particular service, the system has to remember which task and which circumstances that permission belonged to.&lt;/p&gt;

&lt;p&gt;I want the agent, in a similar situation, to predict my decision more accurately instead of finding out my intentions from scratch every time.&lt;/p&gt;

&lt;p&gt;Useful prediction is very practical: don't propose a path that was already rejected, don't ask me to repeat a permission that still stands, pull in the right experience, and run the next stage on time.&lt;/p&gt;

&lt;p&gt;At the same time, my working style in one project must not become the preference of the whole team. The system's confidence must not replace facts or widen its authority.&lt;/p&gt;

&lt;p&gt;This kind of experience memory is already being studied. &lt;a href="https://arxiv.org/abs/2308.10144v3" rel="noopener noreferrer"&gt;ExpeL&lt;/a&gt; and &lt;a href="https://arxiv.org/abs/2509.25140" rel="noopener noreferrer"&gt;ReasoningBank&lt;/a&gt; look at accumulating and reusing agent experience. &lt;a href="https://arxiv.org/abs/2404.15269v3" rel="noopener noreferrer"&gt;PRELUDE and CIPHER&lt;/a&gt; study preferences learned from user edits; their evaluation on emails and summarization with a simulated user does not prove anything for our process. &lt;a href="https://arxiv.org/abs/2510.04618v3" rel="noopener noreferrer"&gt;ACE&lt;/a&gt; studies evolving playbooks and the loss of detail when context is rewritten.&lt;/p&gt;

&lt;p&gt;Confident is a direction for now, not a proven solution to this problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Show me the result in the morning
&lt;/h2&gt;

&lt;p&gt;My target is a task of several days, up to a week, with a clear result and an acceptable cost.&lt;/p&gt;

&lt;p&gt;At a minimum you have to look at three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A finished result:&lt;/strong&gt; was the original assignment done, and is it confirmed that the result works?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; what did the models, tools and compute cost?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My involvement:&lt;/strong&gt; how many reminders, repeated decisions, corrections and trips back into the context did it take?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A mode where the agent works on its own for a long time and a mode where I work next to the agent for a long time are worth completely different things to me.&lt;/p&gt;

&lt;p&gt;When I leave a task overnight, I want to see progressed or finished work in the morning. If the work reasonably takes several days, let it take several days.&lt;/p&gt;

&lt;p&gt;I don't want to discover in the morning that the computation never even started because the agent was waiting for one more obvious message.&lt;/p&gt;

&lt;p&gt;I need a result at an acceptable price, with an acceptable amount of my involvement.&lt;/p&gt;

&lt;p&gt;The thickness of AGENTS.md is not part of that formula.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;About this piece: the opening scene retells my own working scenario; the assessments of model speed and quality are personal experience. ultra and medium are the modes I use. I don't yet have a controlled comparison of our instructions or overall statistics for these modes; a week of independent work is the target scenario, not a finished test.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://prod.codes/blog/agents-md-false-confidence/" rel="noopener noreferrer"&gt;prod.codes&lt;/a&gt;.&lt;/em&gt; &lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>Reverse Engineering with AI: Your Decompiler Can Lie to You</title>
      <dc:creator>Alexander Panasenko</dc:creator>
      <pubDate>Fri, 06 Nov 2026 23:30:39 +0000</pubDate>
      <link>https://dev.to/alex09x/reverse-engineering-with-ai-your-decompiler-can-lie-to-you-4ng5</link>
      <guid>https://dev.to/alex09x/reverse-engineering-with-ai-your-decompiler-can-lie-to-you-4ng5</guid>
      <description>&lt;p&gt;&lt;em&gt;From serialized keys to candidate writers: why an AI agent still needs machine-code evidence&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; Serialized field names can lead you to their offsets. The harder question is which code changes those fields: in a public example, 2,000 decoys write the same offsets as the real function. The real function and the displayed decoys earn the same 40 points for their writes to those fields. The real function gets ten more because it shares a caller, &lt;code&gt;main&lt;/code&gt;, with the serializer; the decoys have no callers at all. The candidate is then checked against its instructions and call sites. The walkthrough uses XRef 0.4.0 and a synthetic C and assembly program; it demonstrates a method and is not a benchmark.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Before the 0.4.0 release, one &lt;code&gt;xref field&lt;/code&gt; query came back with &lt;code&gt;not_found_under_limits&lt;/code&gt;: no matching layouts. The response flagged incomplete discovery under its analysis limits, but it gave no way to tell which keys the tool had seen or where it had lost the connection to the fields. That case is recorded in &lt;a href="https://github.com/alex09x/xref/issues/76" rel="noopener noreferrer"&gt;issue 76&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;An empty list makes the next wrong move easy: widen the search at random, conclude that the structure is not there, or start taking the whole binary apart by hand. What I needed was an answer to a much narrower question: which observations get you from a field name to the code that changes it?&lt;/p&gt;

&lt;p&gt;Put in familiar terms: a program reports &lt;code&gt;"status": "failed"&lt;/code&gt;—which function changed that field? That is an illustrative way to frame the question. The recorded example below uses the keys &lt;code&gt;c&lt;/code&gt;, &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;e&lt;/code&gt;, preserved exactly so the source, instructions and output can be checked together.&lt;/p&gt;

&lt;p&gt;When an AI agent does this work, it needs the same checkable chain a human does. In this setup, XRef is a native analyzer: the agent asks it questions through the CLI or MCP and works with the data that comes back. Finding a plausible function, understanding its role and reading its pseudo-C correctly are three separate steps, and the third is where the title comes from: later on, a historical XRef reproducer shows pseudo-C that, read literally, returns &lt;code&gt;99&lt;/code&gt; for input the machine code evaluates to &lt;code&gt;4&lt;/code&gt;. The recording below contains CLI commands and their captured outputs; the closing section turns the same sequence into a checklist an agent can follow.&lt;/p&gt;

&lt;p&gt;For an executable without symbols, this is a surprisingly awkward question. You can know a field's name because it shows up in serialized output and know almost nothing about how it is laid out in memory. The source type names are gone. The function names are gone. A single small displacement can appear in thousands of completely unrelated instructions. A plausible decompilation can make an early guess look convincing long before the facts back it up.&lt;/p&gt;

&lt;p&gt;While I was working on &lt;a href="https://xrefcode.com/" rel="noopener noreferrer"&gt;XRef&lt;/a&gt;, this question gradually got sharper: first find code from the name of a serialized field, then match a set of neighboring keys and find the functions that write those fields. Short keys exposed the next gap: even a negative result has to explain what the tool actually managed to check. You can follow that path through issues &lt;a href="https://github.com/alex09x/xref/issues/58" rel="noopener noreferrer"&gt;58&lt;/a&gt;, &lt;a href="https://github.com/alex09x/xref/issues/74" rel="noopener noreferrer"&gt;74&lt;/a&gt; and &lt;a href="https://github.com/alex09x/xref/issues/76" rel="noopener noreferrer"&gt;76&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;xref field&lt;/code&gt; command connects key uses to offsets relative to an incoming pointer, then finds and ranks candidate writers. A string reference, an offset and a matching function are different leads. To turn them into an answer, you have to follow the whole chain and keep the instructions each conclusion rests on.&lt;/p&gt;

&lt;p&gt;This article works through one question step by step: &lt;strong&gt;which code changes the values associated with these keys?&lt;/strong&gt; Along the way it shows the false leads that keep the problem from being a simple search for memory stores.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the public example actually is
&lt;/h2&gt;

&lt;p&gt;To follow this chain to the end, I use a small, published test program with a known answer, so every conclusion can be checked against the source and the machine instructions. Real-world tasks shaped what the tool needed to do; the walkthrough itself runs on the open example.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/alex09x/xref/tree/2f01e7ba8d9ccfab08f055cce3119e95dd1504bb/docs/walkthroughs/field-synthetic" rel="noopener noreferrer"&gt;existing recording&lt;/a&gt; uses the published XRef 0.4.0 Linux executable. It was made on November 5, 2026; I reuse its commands and outputs here rather than claiming a new run. The exact build revision and file hashes are in the recording's environment record (linked at the end).&lt;/p&gt;

&lt;p&gt;The target program is generated C and assembly. The part of the C that matters fits on one screen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kt"&gt;uint64_t&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;serializer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"m"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"e"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;uint64_t&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;^=&lt;/span&gt; &lt;span class="n"&gt;value&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;This is an excerpt from the &lt;a href="https://github.com/alex09x/xref/blob/2f01e7ba8d9ccfab08f055cce3119e95dd1504bb/docs/walkthroughs/field-synthetic/target.c" rel="noopener noreferrer"&gt;full generated source&lt;/a&gt;. Function attributes and build flags preserve the call pattern the walkthrough relies on. &lt;code&gt;main&lt;/code&gt; calls &lt;code&gt;writer&lt;/code&gt; first, then &lt;code&gt;serializer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;emit&lt;/code&gt; function does nothing but mix the key, the length and the value at the given address into a &lt;code&gt;volatile&lt;/code&gt; variable. That reproduces the machine-level pattern "key + value address → shared function" without a real JSON encoder or Serde. It is a synthetic C and assembly example for studying the mechanism. Assessing accuracy on real Rust applications requires a separate evaluation.&lt;/p&gt;

&lt;p&gt;The assembly part adds 2,000 decoy functions. Each one writes at offsets &lt;code&gt;+8&lt;/code&gt; and &lt;code&gt;+16&lt;/code&gt; from its first argument. None of them is ever called. That is what keeps the question from being trivial: an analysis that just looks for matching offsets will produce plenty of convincing answers.&lt;/p&gt;

&lt;p&gt;The program was built with GCC 13.3.0 using &lt;code&gt;-O2 -g0 -fno-inline -fno-ipa-icf&lt;/code&gt;, then run through &lt;code&gt;objcopy --strip-all&lt;/code&gt;. XRef reports 2,007 functions and zero symbols; in the recorded example, the boundaries of those functions come from &lt;code&gt;.eh_frame&lt;/code&gt;, the stack-unwinding data. The analysis runs on the stripped file; the symbols of a separate reference build are used only to check the answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  A key string is a starting point, not a field
&lt;/h2&gt;

&lt;p&gt;Searching for &lt;code&gt;m&lt;/code&gt; does not immediately tell you which memory location holds the value named &lt;code&gt;m&lt;/code&gt;. A short string is an especially weak lead: its bytes can be part of a shared literal or be used in some other context. Those were exactly the cases that had to be handled after the request in issue 76. &lt;a href="https://github.com/alex09x/xref/pull/77" rel="noopener noreferrer"&gt;PR 77&lt;/a&gt; added shared-literal recognition for short keys, per-key diagnostics and a way to inspect partial matches.&lt;/p&gt;

&lt;p&gt;What I need is the relationship between two arguments at the use site: the key being passed and the value passed along with it. Only then does the name acquire a useful local meaning.&lt;/p&gt;

&lt;p&gt;The first query in the recording looks for layout evidence only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xref &lt;span class="nt"&gt;-b&lt;/span&gt; target-stripped field &lt;span class="nt"&gt;--keys&lt;/span&gt; c,m,e &lt;span class="nt"&gt;--layout-only&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The report finds one candidate function, &lt;code&gt;0x11c0..0x1204&lt;/code&gt;, with offsets relative to its incoming &lt;code&gt;rdi&lt;/code&gt;. For the three keys it reports &lt;code&gt;c -&amp;gt; 0x0&lt;/code&gt;, &lt;code&gt;m -&amp;gt; 0x8&lt;/code&gt; and &lt;code&gt;e -&amp;gt; 0x10&lt;/code&gt;; the corresponding instructions read eight bytes.&lt;/p&gt;

&lt;p&gt;These values are useful because the report also lists the call sites where each key and value are passed. In the recorded image they are &lt;code&gt;0x11d7&lt;/code&gt;, &lt;code&gt;0x11ec&lt;/code&gt; and &lt;code&gt;0x1202&lt;/code&gt;; the last one is a tail jump to the same callee. You can inspect the function that passes the keys instead of accepting the layout as an unexplained result.&lt;/p&gt;

&lt;p&gt;Here is a shortened disassembly excerpt from the recording. The omitted instructions load the keys and their lengths:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0x11c5  mov rdx, rdi
0x11c8  mov rbx, rdi
0x11d7  call 0x11a0
0x11dc  lea rdx, [rbx+8]
0x11ec  call 0x11a0
0x11f1  lea rdx, [rbx+0x10]
0x1202  jmp short 0x11a0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On entry, &lt;code&gt;rdi&lt;/code&gt; holds the pointer &lt;code&gt;p&lt;/code&gt;. The copy saved in &lt;code&gt;rbx&lt;/code&gt; survives the first call. So the values passed in &lt;code&gt;rdx&lt;/code&gt; are &lt;code&gt;p&lt;/code&gt;, &lt;code&gt;p + 8&lt;/code&gt; and &lt;code&gt;p + 16&lt;/code&gt;. In the full listing, the matching key string addresses and lengths are passed right next to them. That is how key names get tied to offsets.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F451ck4sr693sro57neij.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%2F451ck4sr693sro57neij.png" alt="The evidence chain from key bytes to a checked candidate writer." width="799" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 1. Each arrow is a separate investigative step. Finding a later link does not automatically prove the earlier ones.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A field's address and the value stored there are different things
&lt;/h2&gt;

&lt;p&gt;One distinction shaped the problem more than any other: following a pointer and following a value loaded through that pointer are not the same thing.&lt;/p&gt;

&lt;p&gt;Consider two schematic instructions. They illustrate the distinction and are not an additional result from the recorded test program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lea rax, [rdi+8]   ; address: incoming pointer + 8
mov rax, [rdi+8]   ; value: eight bytes loaded there
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After &lt;code&gt;lea&lt;/code&gt;, &lt;code&gt;rax&lt;/code&gt; still holds an address relative to the original input. After &lt;code&gt;mov&lt;/code&gt;, it holds whatever was stored at that address: a number, a pointer to a different object, or a value the current analysis cannot classify. A later write through &lt;code&gt;[rax+16]&lt;/code&gt; does not automatically become a write to &lt;code&gt;rdi+24&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That is why it matters where a base pointer came from: whether it arrived as an argument, was returned from a call or was loaded from memory. Each leads to a different conclusion about which object you are looking at. Lose track of a pointer's origin, and later offsets can be wrongly attributed to the earlier object.&lt;/p&gt;

&lt;p&gt;There is another practical trap here: searching only for &lt;code&gt;lea&lt;/code&gt; can miss a field that is accessed through a direct load or store. An empty result from such a search does not prove the field was never used. It means the chosen instruction pattern was not found under those search conditions.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foey31snmfukjqxykwyc6.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%2Foey31snmfukjqxykwyc6.png" alt="An address calculation and a memory load have different pointer provenance." width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 2. A schematic example: after a load from memory, you cannot keep tracking the original base by simply adding offsets.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  An access range is not a struct declaration
&lt;/h2&gt;

&lt;p&gt;The three offsets and read widths in this example give an addressed range of at least &lt;code&gt;0x18&lt;/code&gt; bytes. It is tempting to write &lt;code&gt;sizeof(record) = 24&lt;/code&gt; next to it and move on.&lt;/p&gt;

&lt;p&gt;Here, the source lets us look up the real declaration. The stripped binary on its own supports a narrower claim: those positions were accessed with those widths. It does not follow that there are no fields beyond them, that no field was missed, or that the allocated memory ends there. Alignment, tail padding and how the memory was allocated are separate questions.&lt;/p&gt;

&lt;p&gt;The report expresses this as &lt;code&gt;addressed-span&amp;gt;=0x18&lt;/code&gt; and &lt;code&gt;exact-size=unknown&lt;/code&gt;. It also keeps the lexical order of call sites separate from the source declaration order or any universal execution order. These caveats are a useful part of the result, not an apology tacked on after the analysis.&lt;/p&gt;

&lt;p&gt;The same goes for names. We observed the byte strings &lt;code&gt;c&lt;/code&gt;, &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;e&lt;/code&gt;. We know the type name &lt;code&gt;struct record&lt;/code&gt; from the source and the reference build's symbols, not from the query result.&lt;/p&gt;

&lt;p&gt;Explicit boundaries make the result more useful. You can search for writes at the observed offsets without first declaring an invented complete type.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two thousand functions that look like the answer
&lt;/h2&gt;

&lt;p&gt;Now let's ask for functions that write both named fields through the same pointer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xref &lt;span class="nt"&gt;-b&lt;/span&gt; target-stripped field &lt;span class="nt"&gt;--keys&lt;/span&gt; c,m,e &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--write&lt;/span&gt; &lt;span class="nt"&gt;--writes-all-of&lt;/span&gt; m,e &lt;span class="nt"&gt;--limit&lt;/span&gt; 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--writes-all-of m,e&lt;/code&gt; flag restricts the answer to candidates that write both named fields. The key words here are &lt;em&gt;through the same pointer&lt;/em&gt;. Two writes at offsets eight and sixteen from unrelated bases do not belong to the same object just because the numbers match. The query looks for writes at the &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;e&lt;/code&gt; offsets relative to a common root. The root is the pointer the offsets are measured from; what matters next is whether it was an argument, a call result or a load from memory.&lt;/p&gt;

&lt;p&gt;The first candidate starts at &lt;code&gt;0x1210&lt;/code&gt;. In the transcript, its instructions are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0x1210  endbr64
0x1214  add [rdi+8], rsi
0x1218  xor [rdi+0x10], rsi
0x121c  ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This matches the two updates in the source. Both instructions read the field's previous value and write back the result. The report marks them as &lt;code&gt;read_write&lt;/code&gt; with a width of eight bytes. In the reference build's symbol table, the function is called &lt;code&gt;writer&lt;/code&gt;. The &lt;code&gt;read_write&lt;/code&gt; label by itself gives no ranking advantage: in the decoys, the &lt;code&gt;xor&lt;/code&gt; instruction also reads and writes the field.&lt;/p&gt;

&lt;p&gt;The next candidate looks plausible too. It writes &lt;code&gt;[rdi+8]&lt;/code&gt; with &lt;code&gt;mov&lt;/code&gt; and updates &lt;code&gt;[rdi+0x10]&lt;/code&gt; with &lt;code&gt;xor&lt;/code&gt;. The rest of the displayed decoys are built the same way. Their offsets really do match. These are not imaginary coincidences, and the instructions were not misread.&lt;/p&gt;

&lt;p&gt;That is the core difficulty. A matching combination of offsets establishes a local access pattern. It does not prove that the pointer has the source type whose serializer we looked at, or that the function takes part in the operation we care about. The report calls this &lt;code&gt;same_root_offset_constellation_not_type_proof&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you present the answer as a list of recovered types, the ambiguity disappears from the formatting but stays in the machine code. I would rather see the candidates and state the next question explicitly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What ranking gives you, and what it doesn't
&lt;/h2&gt;

&lt;p&gt;In the recording, the real function scores 50 points and the displayed decoys score 40. Start with the shared part, which comes from &lt;a href="https://github.com/alex09x/xref/blob/v0.4.0/src/serde_fields/writer_rank.rs" rel="noopener noreferrer"&gt;score calculation in XRef 0.4.0&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;16 points: two writes to the target fields in the same block;&lt;/li&gt;
&lt;li&gt;another 16: both writes start exactly at the target field and are no wider than the observed read of that field;&lt;/li&gt;
&lt;li&gt;another 8: two fields of the layout are covered by such precise writes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That makes 40 for the real function and for the decoys alike. None of them compares a field before writing it, which would earn an extra bonus. Pointer origin is the same too: they all write through the first argument.&lt;/p&gt;

&lt;p&gt;The ten-point difference comes from the direct call graph alone. &lt;code&gt;main&lt;/code&gt; calls both &lt;code&gt;serializer&lt;/code&gt; and &lt;code&gt;writer&lt;/code&gt;, so the two are two edges apart through a shared caller. At distance two, the &lt;a href="https://github.com/alex09x/xref/blob/v0.4.0/src/serde_fields/accessors.rs#L305-L310" rel="noopener noreferrer"&gt;call-graph bonus&lt;/a&gt; is &lt;code&gt;(7 - 2) * 2 = 10&lt;/code&gt;. The decoys have no callers and get no bonus.&lt;/p&gt;

&lt;p&gt;That advantage is built into the test program: the decoys were deliberately left without callers. If they also sat next to the serializer in the graph, this signal would separate them less well. Here it shows why the known function came out on top. The path &lt;code&gt;serializer ← main → writer&lt;/code&gt; describes relationships in the program; it is not a call to &lt;code&gt;writer&lt;/code&gt; from the serializer, and it is not a trace of a particular execution.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsfcj19ntgkfgex8ptpsi.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%2Fsfcj19ntgkfgex8ptpsi.png" alt="The serializer and the writer share a caller; the decoys are disconnected." width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 3. In the reference example, the shared caller gives &lt;code&gt;writer&lt;/code&gt; ten extra points: 50 versus 40 for the decoys.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Development, however, also taught the opposite lesson: call-graph proximity alone is not enough. &lt;a href="https://github.com/alex09x/xref/pull/118" rel="noopener noreferrer"&gt;PR 118&lt;/a&gt; describes a case where the layout was already being found, but copy and initialization code sitting next to the serializer ranked above the right function: it wrote at matching offsets and collected the same proximity advantage. The answer was field-precision scoring. A write counts as precise only if it starts at the field's offset and is no wider than the observed read, so wide copies and dereferenced pointer slots earn no field-precision points; &lt;a href="https://github.com/alex09x/xref/pull/120" rel="noopener noreferrer"&gt;PR 120&lt;/a&gt; later excluded constant stores as well, because zero initialization should not score like writing a computed value. Comparing the field before writing it is a separate signal.&lt;/p&gt;

&lt;p&gt;That is the difference between the demonstration and the engineering problem it came from. In the open example, &lt;code&gt;writer&lt;/code&gt; and the displayed decoys earn the same 40 points for their writes, and the call graph makes the difference. In the harder case, field updates first had to be told apart from copying, initialization and pointer handling. A position in the list suggests which function to check next; it does not replace the check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask where the base pointer came from
&lt;/h2&gt;

&lt;p&gt;Version 0.4.0 provides &lt;code&gt;--writer-root&lt;/code&gt; to distinguish bases that come from an argument, a call result or a memory load. That is useful when the investigation already has a reason to prefer one origin.&lt;/p&gt;

&lt;p&gt;For example, if the object you care about comes from a lookup call, a candidate whose base is the returned pointer may be more relevant than an unrelated write relative to an argument. That is a hypothesis about the program's data flow, not a license to pick whichever filter produces the nicest first row.&lt;/p&gt;

&lt;p&gt;The public recording includes a query rooted at the argument:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xref &lt;span class="nt"&gt;-b&lt;/span&gt; target-stripped field &lt;span class="nt"&gt;--keys&lt;/span&gt; c,m,e &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--write&lt;/span&gt; &lt;span class="nt"&gt;--writes-all-of&lt;/span&gt; m,e &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--writer-root&lt;/span&gt; argument &lt;span class="nt"&gt;--limit&lt;/span&gt; 3 &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example it does &lt;strong&gt;not&lt;/strong&gt; remove the decoys. All of these functions, the real one included, work through the first argument. The candidate order stays the same. That is an important negative result: a useful filter does not have to be useful on every input.&lt;/p&gt;

&lt;p&gt;So I first find out where the object comes from on the path I care about, and only then choose a filter. Swapping flags in until the first row looks right is an easy way to fit the answer to a guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  One function, different call sites, different questions
&lt;/h2&gt;

&lt;p&gt;The function we found answers part of the question: where the matching writes are. The next step is to work out from where, and under what condition, it gets called. That is a continuation of the investigation after &lt;code&gt;field&lt;/code&gt;, not a decision the command makes on the researcher's behalf.&lt;/p&gt;

&lt;p&gt;In this teaching example, one function is called with different arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;condition_a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;object&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;object&lt;/span&gt;&lt;span class="p"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is one callee, but the branch condition and the argument differ. The recorded target contains no such branch; the snippet stands for the real binaries where one utility function serves several callers under different conditions. Pick the first call from the cross-reference list, and you have discarded the alternative before explaining it. You need to look at the specific call site and where the argument comes from.&lt;/p&gt;

&lt;p&gt;These are separate questions, and &lt;code&gt;callers&lt;/code&gt;, &lt;code&gt;args&lt;/code&gt; and &lt;code&gt;slice&lt;/code&gt; serve them: call sites, the values passed, and an instruction slice leading up to the point of interest. Choosing between branches stays with the researcher. That sequence is more useful than a single function found with no explanation of its role.&lt;/p&gt;

&lt;h2&gt;
  
  
  Look at the candidate from another angle
&lt;/h2&gt;

&lt;p&gt;The investigation does not end once &lt;code&gt;0x1210&lt;/code&gt; comes out on top. I look at the instructions, read the pseudo-C and check the callers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xref &lt;span class="nt"&gt;-b&lt;/span&gt; target-stripped asm 0x1210
xref &lt;span class="nt"&gt;-b&lt;/span&gt; target-stripped c 0x1210
xref &lt;span class="nt"&gt;-b&lt;/span&gt; target-stripped callers 0x1210
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The recorded pseudo-C contains these operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u64&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;arg_0&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u64&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;arg_0&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;arg_1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u64&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;arg_0&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u64&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;arg_0&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="n"&gt;arg_1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is XRef's pseudo-C notation, not portable C source recovered verbatim. It conveniently shows the addition and the XOR that are visible in the instructions. The &lt;code&gt;callers&lt;/code&gt; output finds a direct call at &lt;code&gt;0x1085&lt;/code&gt; inside &lt;code&gt;0x1050&lt;/code&gt;; in the reference build, that function is &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Each view here answers its own question: pseudo-C helps you read the operations, the disassembly shows the instructions, and &lt;code&gt;callers&lt;/code&gt; shows the link to calling code. All of them come from the same tool; the final check for this test comes from the open source and the reference build's symbols.&lt;/p&gt;

&lt;p&gt;That closes the loop on the example: the expected offsets, operations and caller all match, and the right function is ranked first.&lt;/p&gt;

&lt;p&gt;One of these practical checks is exactly what exposed an earlier XRef bug: when reconstructing a branch after an &lt;code&gt;SBB&lt;/code&gt; that wrote to a stack slot, the analyzer used the wrong value for the carry. The public &lt;a href="https://github.com/alex09x/xref/issues/117" rel="noopener noreferrer"&gt;issue 117&lt;/a&gt; contains a self-contained assembly and C reproducer. On input &lt;code&gt;(10,6,1)&lt;/code&gt; the executable returns &lt;code&gt;4&lt;/code&gt;, while the pseudo-C XRef produced at the time would return &lt;code&gt;99&lt;/code&gt; if interpreted literally: the carry check used the already-modified left operand.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/alex09x/xref/pull/119" rel="noopener noreferrer"&gt;PR 119&lt;/a&gt; fixed the flag calculation by keeping the operand's value from before the write. The bug was recorded in XRef 0.3.0 and a pre-release build; the fix landed before the 0.4.0 release used in this walkthrough. This is a historical reproducer that I did not rerun for this article. It shows why, after you find a function, you check the instruction that carries the semantics: what exactly was read, when the value changed, and which value the flag was computed from.&lt;/p&gt;

&lt;h2&gt;
  
  
  An empty answer should explain itself
&lt;/h2&gt;

&lt;p&gt;Back to the empty answer this article started with. The &lt;code&gt;not_found_under_limits&lt;/code&gt; flag describes the outcome of the query but does not tell you what to do next. Look for other strings? Raise the budget? Take the unsupported region apart by hand?&lt;/p&gt;

&lt;p&gt;That is why PR 77 added diagnostics: which keys were seen, where references and value passes were found, which functions were analyzed, and what limited the search. Alongside them came &lt;code&gt;--max-functions&lt;/code&gt;, &lt;code&gt;--max-instructions&lt;/code&gt; and partial matching via &lt;code&gt;--min-keys&lt;/code&gt;. That turns a negative answer into grounds for the next action.&lt;/p&gt;

&lt;p&gt;The recording also contains a separate cold JSON query, run with an empty cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xref &lt;span class="nt"&gt;-b&lt;/span&gt; target-stripped field &lt;span class="nt"&gt;--keys&lt;/span&gt; c,m,e &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--write&lt;/span&gt; &lt;span class="nt"&gt;--writes-all-of&lt;/span&gt; m,e &lt;span class="nt"&gt;--limit&lt;/span&gt; 1 &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This cold JSON query with &lt;code&gt;--limit 1&lt;/code&gt; reports 2,007 scanned functions. Of those, 2,003 were checked for candidate writes, and four were excluded by the image-scan prefilter, the pass that rejects functions before the per-candidate write analysis runs. The three selected functions were analyzed with no exclusions for unsupported control flow or the instruction budget.&lt;/p&gt;

&lt;p&gt;But the output is still limited. In the same response, the &lt;code&gt;accessors_truncated&lt;/code&gt; field is &lt;code&gt;true&lt;/code&gt;. That means there are more candidate writers than were printed. The rest have not been judged irrelevant. A limit on how the result is presented and a limit on analysis coverage must not be confused.&lt;/p&gt;

&lt;p&gt;I look at coverage and limits first, then interpret the result. An empty list after incomplete analysis is a reason to refine the query. A single printed row with &lt;code&gt;accessors_truncated: true&lt;/code&gt; is a reason to look at the other candidates, not to declare the winner the only one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fast repeats: what can be cached and what can't
&lt;/h2&gt;

&lt;p&gt;Coverage affects more than how you read an answer. It also decides whether the index that was built can be saved. During development, repeated queries ran into exactly this boundary: the key scan hit the upper limit on the number of functions and never finished, so the index was never written and the next query started from scratch. PR 118 covers that root cause.&lt;/p&gt;

&lt;p&gt;Saving half an index as if it were complete would be worse: a fast answer could rest on an unfinished picture and still look complete. So analysis limits and safe reuse are tied together. Speeding up this path has to preserve what the result means and report coverage explicitly.&lt;/p&gt;

&lt;p&gt;For a researcher, repeats come in different kinds too. A new set of keys can reuse a ready index of references, calls and writes. A long-lived session keeps the image and its state in memory. An identical question can be served from a saved report. All three modes are useful, but "answer a new question" and "return the previous answer" are different jobs.&lt;/p&gt;

&lt;p&gt;The recording explicitly disables ready-result replay and the background daemon. Every cold command uses an empty cache directory; one separate query reuses the index built by the previous cold writer search. Its JSON reports one cache hit each for the scan index and the writer index. For the cold runs, those values are zero.&lt;/p&gt;

&lt;p&gt;Those hits show that reuse worked. A single run with a different filter and limit cannot measure how much it saves: a comparison would mean running the same work many times. But the engineering boundary is already clear: you need to know whether you are reusing a complete index, session state or a finished report.&lt;/p&gt;

&lt;h2&gt;
  
  
  A workflow you can hand to an agent
&lt;/h2&gt;

&lt;p&gt;The useful unit of work is a short sequence of questions, not an instruction to keep searching until something plausible turns up:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pin down the exact input file and tool revision. For every address, record which file it came from.&lt;/li&gt;
&lt;li&gt;Find where the keys are passed and look at the witness instructions. Check the base and the address-versus-value distinction.&lt;/li&gt;
&lt;li&gt;Record the observed offsets and widths without inventing a complete source declaration.&lt;/li&gt;
&lt;li&gt;Ask for writers at the target offsets through a single root. Keep the candidate and coverage details.&lt;/li&gt;
&lt;li&gt;Justify the ranking or the root filter with a specific hypothesis about the program.&lt;/li&gt;
&lt;li&gt;Look at the selected candidate's instructions and callers. Use pseudo-C to read, not as a substitute for instruction evidence.&lt;/li&gt;
&lt;li&gt;State the remaining uncertainty and the observation that would help resolve it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;JSON makes it easier to pass these steps between tools. It does not relieve the agent of following them in order. Evidence for a field lives in &lt;code&gt;candidates[].fields[].emissions[].evidence_steps[]&lt;/code&gt;, and candidate writers in &lt;code&gt;accessor_candidates[]&lt;/code&gt;. The caller can keep these anchors without collapsing everything into a sentence about a recovered type.&lt;/p&gt;

&lt;p&gt;If you later need to show which path actually executes, a static report is not that observation. Examining a running process is a separate step with its own platform, access and process-impact constraints. This recording involves no attaching to a live process and no observing writes at run time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took away from this
&lt;/h2&gt;

&lt;p&gt;The tempting shortcut is to jump from a name to a type, from an offset to an object, or from the first candidate to a proven writer. Each of those jumps erases exactly the distinction that made the original question hard.&lt;/p&gt;

&lt;p&gt;The public example checks a useful result: three keys lead to three offsets, the offsets lead to candidate writers, and the known writer comes out first for reasons the report spells out. The two thousand decoys are an essential part of the explanation. They show why finding the writes was not enough.&lt;/p&gt;

&lt;p&gt;This is the direction I want to take XRef: make a narrow question about a binary cheap enough to ask again and again, and return enough evidence that the next question becomes clearer. The goal is not to make uncertainty disappear, but to stop hiding it inside an attractive answer.&lt;/p&gt;

&lt;p&gt;You can repeat the walkthrough on the same public example: the same binary, the same commands, the same checkable answer, with links in the sources below. XRef is an open project: &lt;a href="https://github.com/alex09x/xref" rel="noopener noreferrer"&gt;source code&lt;/a&gt;, with installation and documentation at &lt;a href="https://xrefcode.com/" rel="noopener noreferrer"&gt;xrefcode.com&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources and reproduction
&lt;/h2&gt;

&lt;p&gt;The full recording contains stdout, stderr, exit codes, environment details and a reproduction script. The shortened listings above keep the recording's addresses; they belong to that exact image and may change on a rebuild.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/alex09x/xref/tree/2f01e7ba8d9ccfab08f055cce3119e95dd1504bb/docs/walkthroughs/field-synthetic" rel="noopener noreferrer"&gt;Public recording and full walkthrough with source-backed checks&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/alex09x/xref/blob/2f01e7ba8d9ccfab08f055cce3119e95dd1504bb/docs/walkthroughs/field-synthetic/transcript.txt" rel="noopener noreferrer"&gt;Verbatim transcript&lt;/a&gt; and &lt;a href="https://github.com/alex09x/xref/blob/2f01e7ba8d9ccfab08f055cce3119e95dd1504bb/docs/walkthroughs/field-synthetic/environment.txt" rel="noopener noreferrer"&gt;environment&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/alex09x/xref/releases/tag/v0.4.0" rel="noopener noreferrer"&gt;XRef 0.4.0 release&lt;/a&gt; and &lt;a href="https://doi.org/10.5281/zenodo.23968336" rel="noopener noreferrer"&gt;versioned software archive&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/alex09x/xref/blob/1686ee4b84e63423beed2109b6ac3bf03df0e535/docs/field-search.md" rel="noopener noreferrer"&gt;Field search documentation, corrected after the release&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://prod.codes/blog/xref-0-4-0-from-serialized-keys-to-the-writer/" rel="noopener noreferrer"&gt;Earlier short walkthrough&lt;/a&gt;, based on the same recording rather than an independent experiment.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://xrefcode.com/" rel="noopener noreferrer"&gt;XRef website&lt;/a&gt; with installation, documentation and recorded examples.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The test program was generated with &lt;code&gt;--functions 2000 --writers&lt;/code&gt;; its source, generator and input file hashes are published in the recording. This article does not report a new benchmark, a comparative accuracy study or production measurements.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://prod.codes/blog/reverse-engineering-with-ai-your-decompiler-can-lie-to-you/" rel="noopener noreferrer"&gt;prod.codes&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reverseengineering</category>
      <category>ai</category>
      <category>opensource</category>
      <category>assembly</category>
    </item>
    <item>
      <title>Your AI Agent Has Amnesia. Mine Keeps Receipts.</title>
      <dc:creator>Alexander Panasenko</dc:creator>
      <pubDate>Fri, 06 Nov 2026 05:05:49 +0000</pubDate>
      <link>https://dev.to/alex09x/your-ai-agent-has-amnesia-mine-keeps-receipts-23i6</link>
      <guid>https://dev.to/alex09x/your-ai-agent-has-amnesia-mine-keeps-receipts-23i6</guid>
      <description>&lt;p&gt;&lt;em&gt;Months of shared memory across Claude, Codex and Antigravity — versions, retractions, and why append-only notes keep failing&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; Scattered Markdown notes kept sending my agents down paths we had already rejected. I built a shared Git-backed store (KYB) with versioned records and lifecycle states — active, archived, retracted. Query current state, history, or a time slice separately; replace wrong text instead of appending; separate finished work from wrong knowledge. Pinned to KYB v0.3.3, no controlled benchmarks — mechanisms and field notes below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Before KYB, my coding agents already had memory: Markdown files scattered across different places. The flaw showed up whenever another agent returned to a workspace, found an older note, and mistook it for the active plan. In my experience, an agent would sometimes spend hours pursuing an approach we had already investigated and rejected. The file still held a perfectly reasonable case for the old approach, while the decision to abandon it lived somewhere else.&lt;/p&gt;

&lt;p&gt;I am Alexander Panasenko, the author of KYB (Know Your Business), so I have a stake in this story: it is my open-source project. This is an account of my engineering experience with Claude Code, OpenAI Codex, and Google Antigravity from summer through October 2026. The text, its translation, and the diagrams were prepared with AI assistance, based on my own experience, the public source code, and saved development records.&lt;/p&gt;

&lt;p&gt;A fresh session does not automatically inherit the conversation that just ended. A human had to step in and explain which file still mattered, why we changed course, and where the outcome was recorded. An obvious temptation is to write one more summary note, but that note needs remembering too: without updates, it goes stale like the rest.&lt;/p&gt;

&lt;p&gt;So here is the question this piece addresses: how do you preserve operational knowledge across sessions without letting an outdated note send the next agent down a path you already abandoned? My short answer is to save a little, with versions and lifecycle state, and keep three things apart: what is true now, what was recorded then, and how an attempt ended. The rest of this piece shows where each boundary came from.&lt;/p&gt;

&lt;p&gt;The mechanics below are pinned to the public &lt;a href="https://github.com/alex09x/kyb/releases/tag/v0.3.3" rel="noopener noreferrer"&gt;KYB v0.3.3&lt;/a&gt; release from October 27, 2026 (commit &lt;code&gt;06f63b5&lt;/code&gt;). The episodes below keep their dates: new features are not attributed to old versions, and the current &lt;code&gt;main&lt;/code&gt; branch may differ. Our internal records are not public. I have not run a controlled comparison of agents with and without KYB, so the hours lost to stale notes are my personal recollection, not a measured saving after adoption.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Files Were Not Enough
&lt;/h2&gt;

&lt;p&gt;In hindsight, the problem had three parts. First, there was no single shared entry point: notes lived in different places, and none was canonical across sessions. Second, a note had no explicit lifecycle state: a file describing a rejected plan looked just like one describing the active plan. Third, separate files do not by themselves establish which version of a decision is authoritative: even when notes are already tracked in Git, an agent reading a file in a working tree or a neighboring note cannot tell without a separate check whether that text superseded an earlier approach or was superseded later.&lt;/p&gt;

&lt;p&gt;My first real fix was simple: a shared service for operational facts, incidents, and tasks that every session could reach. Its first interface was a CLI on top of an HTTP API; agents know how to run commands, and that was enough to start. Later, the server gained Model Context Protocol (MCP) support so agents could call its tools directly. The CLI, HTTP API, and MCP all lead to the same records: three doors into one room, not three separate memories.&lt;/p&gt;

&lt;p&gt;What KYB did not become matters as much. It does not save hidden model reasoning or archive whole conversations. A record exists only when a human or agent explicitly saves it: knowledge under a stable key, an incident with detection and outcome, or a task with owner and status. Each record is a Markdown file in a Git repository. The search index is built on top and can be rebuilt; the repository stays canonical. I chose small, verifiable records over an automatic chat archive on purpose: an archive has everything, but finding the active conclusion in it is as hard as in a pile of files. One more distinction: the public repository holds the engine, while our working records live in a separate internal store. Installing KYB gives you your own store under your own access rules, with none of our notes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to Record So Nobody Repeats a Rejected Path
&lt;/h2&gt;

&lt;p&gt;The shared server solved place, not content. Pour the same old notes into a database and search just finds stale text faster. So the next question was: what should survive a session?&lt;/p&gt;

&lt;p&gt;The most useful record usually answers a question source code cannot: why was it built this way? Code shows the chosen implementation, not which options were tried, where they fell short, or which constraint decided the outcome. Without that, the next agent may carefully rebuild a rejected design while sincerely believing it is an improvement—exactly my original problem.&lt;/p&gt;

&lt;p&gt;Material therefore falls into three kinds. &lt;strong&gt;Knowledge&lt;/strong&gt; is a state or rule worth returning to: a service's role, an interface agreement, a way to verify configuration. An &lt;strong&gt;incident&lt;/strong&gt; is a problem that happened: symptom, impact, how to tell whether it continues, and how it ended. A &lt;strong&gt;task&lt;/strong&gt; is work to be done, or the reason it was closed. The split keeps you from confusing an intention with a fact, or a finished attempt with an active recommendation.&lt;/p&gt;

&lt;p&gt;Take an example record about choosing a message queue. "We use option B" says too little. The next agent does not need to obey an old conclusion blindly; it needs to tell whether the conditions behind it still hold. I would write such a record roughly like this (a template, not a real benchmark):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Decision: Use option B for this workload.
Reason: Option A failed requirement X under conditions Y.
Verification: Link to test, configuration, or report with revision SHA.
Revisit if: X or Y changes.
Related: Task key where the options were compared.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "Revisit if" line turns an old decision from a prohibition into a condition: if X or Y has changed, revisiting is legitimate, and the agent does not have to guess whether the record expired.&lt;/p&gt;

&lt;p&gt;The same logic produced habits I now treat as part of the record. A claim without a source soon becomes one more text asking to be trusted, so note how and when a fact was checked: not "the API listens on 9090," but "at revision X, checked the &lt;code&gt;service-api&lt;/code&gt; listener, port 9090." Before creating a record, search for an existing key; the same knowledge under two names recreates the old chaos inside the new system, and Git will not clean it up. Hunches and long logs of competing hypotheses belong in an open task or incident, not standing knowledge. Secrets do not belong in the store at all; a pointer to where an authorized person or tool can fetch them suffices.&lt;/p&gt;

&lt;p&gt;In v0.3.3, there is also a guard against silently losing tags: rewriting a task or incident keeps any tags the write omits. An explicitly empty list clears them. This is a narrow rule for metadata, not a partial update of any record: replacing the knowledge under an existing key still requires keeping the full current text.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Port, Different Questions
&lt;/h2&gt;

&lt;p&gt;Even a clean record serves different questions. In a toy example, Monday's entry records that &lt;code&gt;service-api&lt;/code&gt; listens on port &lt;code&gt;8080&lt;/code&gt;. On Wednesday, the service moves to &lt;code&gt;9090&lt;/code&gt;, and the record is updated under the same key. "Where should I connect right now?" and "What was recorded on Monday?" need different answers, and both are fair questions.&lt;/p&gt;

&lt;p&gt;Overwrite the row without history and Monday's answer is gone. Return every version without dates or states and an agent may pick the wrong one. Git offers a third path: the key stays the same while its edits form a history. Still, history alone answers nothing until you say which slice you need.&lt;/p&gt;

&lt;p&gt;Each KYB query mode matches one question. A regular query searches current state: "where do I connect now." &lt;code&gt;--history&lt;/code&gt; searches matching text across all saved content versions, including the current one; &lt;code&gt;kyb history &amp;lt;key&amp;gt;&lt;/code&gt; shows a record’s complete chain of changes. &lt;code&gt;--as-of&lt;/code&gt; builds a slice of the store at a chosen moment and searches inside it, telling you what the store knew when a release went out. &lt;code&gt;--changed-between&lt;/code&gt; searches versions written within an interval and returns, for each key, the latest matching version from that window.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffvb4prvpj5e5qpdqfpbl.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%2Ffvb4prvpj5e5qpdqfpbl.png" alt="Toy port change: the current query selects the new version, as-of before the change selects the prior one, history may return both, and export writes a commit snapshot with the latest version of each key." width="780" height="2040"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 1. A toy example with synthetic ports; R1 and R2 are Git commits, not real-world events.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Figure 1 maps those answers onto one key. The current query gets R2 and port 9090; a cutoff between the commits gets R1 and port 8080; history may return both if both match; and export, discussed below, writes one latest row per key.&lt;/p&gt;

&lt;p&gt;The old port appears in historical results by design, not by mistake. Pick the question and mode first; judge the hits second.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A note for readers checking this against the code.&lt;/strong&gt; In &lt;code&gt;--as-of&lt;/code&gt;, KYB first selects, for each key, the latest version recorded no later than time T—in revision order, not by the largest timestamp—and only then tests it against the query. A retraction recorded by T hides the key if the selected version is not newer than that retraction. In &lt;code&gt;--as-of&lt;/code&gt; and at the upper bound of &lt;code&gt;--changed-between&lt;/code&gt;, a bare date means 23:59:59 UTC; at the start of &lt;code&gt;--changed-between&lt;/code&gt; it means 00:00:00 UTC. A SHA passed instead of a date becomes its commit timestamp rather than selecting an exact Git tree, and versions written within the same second cannot be distinguished by a time cutoff. See &lt;a href="https://github.com/alex09x/kyb/blob/06f63b5ae0f8fdff24abb3b2c1c848ff41758faa/src/index.rs" rel="noopener noreferrer"&gt;&lt;code&gt;index.rs&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://github.com/alex09x/kyb/blob/06f63b5ae0f8fdff24abb3b2c1c848ff41758faa/src/main.rs" rel="noopener noreferrer"&gt;&lt;code&gt;main.rs&lt;/code&gt;&lt;/a&gt; in v0.3.3.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Correction That Did Not Replace the Mistake
&lt;/h2&gt;

&lt;p&gt;The "slice first, match second" order came from practice: we hit the same problem twice, first in notes, then in code.&lt;/p&gt;

&lt;p&gt;A shared server did not cure the habit of appending clarifications to the end of a document. A September internal record examined a case where a correction was added below an incorrect instruction while the instruction stayed on top. A human reading the whole page might catch the contradiction; an agent taking the first matching passage still got the old advice. It was the stale-Markdown trap again, except both versions now shared one page instead of sitting in different folders.&lt;/p&gt;

&lt;p&gt;After that, our working rule got specific: edit the active text, then search for the retired wording. Checking that "the right paragraph was added" is too weak; you must confirm the wrong one no longer reads as an instruction. Git removes the main reason to keep the old paragraph in the body, since earlier wording survives in history. And if the same instruction was once copied under another key, searching for a distinctive old phrase after the fix can help surface a duplicate within the searchable store—KYB does not deduplicate automatically or guarantee that every copy is found.&lt;/p&gt;

&lt;p&gt;In October, we found a software version of the same mistake. Historical cutoff search first collected versions containing the query term and only then picked the latest. When a newer version no longer contained the old term, it dropped out of candidates too early, and the query returned old text even for a moment after replacement. In effect, the code did what the agent did with the page: it matched words without checking whether the passage still applied.&lt;/p&gt;

&lt;p&gt;The fix in &lt;a href="https://github.com/alex09x/kyb/pull/17" rel="noopener noreferrer"&gt;PR #17&lt;/a&gt; of October 11 reversed the order: first select each key's state at the target moment, then test for a match. This is the order in effect in v0.3.3, the version this piece is written against. For full history search, old text is appropriate; for the state after a correction, it is the wrong answer. The patch and regression test are public; we did not measure how many real agent decisions the bug affected.&lt;/p&gt;

&lt;p&gt;I covered both cases in more detail in a &lt;a href="https://hackernoon.com/building-reliable-shared-memory-for-ai-agents-with-git-hybrid-search-and-temporal-retrieval" rel="noopener noreferrer"&gt;HackerNoon article&lt;/a&gt;. The lesson for shared memory is simple: verify the whole path from correction to the next read. A successful write says nothing on its own about which passage the next query will return.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write Time Is Not Event Time
&lt;/h2&gt;

&lt;p&gt;Time slices tempt you to read the store's history as an event log. The same example shows why that is wrong. Say the service switched ports at 15:50, but the record was updated only at 16:20. An &lt;code&gt;--as-of&lt;/code&gt; query for 16:00 returns the old port even though the cutover had already happened. The store was not wrong; it simply answers about write time, not event time.&lt;/p&gt;

&lt;p&gt;KYB's temporal filters use Git commit time. That tells you what the store recorded and when; it does not replace deployment logs, metrics, or checking the running system. Incident fields do not prove event time on their own either. A client can supply &lt;code&gt;started_at&lt;/code&gt; and &lt;code&gt;detected_at&lt;/code&gt;; if &lt;code&gt;detected_at&lt;/code&gt; is empty, the server keeps a stored value or fills in the current time. The server records the closing timestamp, &lt;code&gt;resolved_at&lt;/code&gt;; clients do not supply that field. In an investigation, the store's history is one source, not the referee.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finished, or Wrong?
&lt;/h2&gt;

&lt;p&gt;Another boundary appears once a record stops being current: "this record no longer applies" can mean two very different things.&lt;/p&gt;

&lt;p&gt;First, the work is finished. An incident was resolved, or a task was done or dropped, yet the next agent still needs to know how the attempt ended, especially if it failed. KYB archives such records: they leave the active tree, while their final version stays in regular current-state search. Closing a task as &lt;code&gt;done&lt;/code&gt; or &lt;code&gt;dropped&lt;/code&gt; requires resolution text, including why dropped work was abandoned. The field guarantees only that text exists, not that it is true or useful; a bare "done" tells a future reader nothing.&lt;/p&gt;

&lt;p&gt;Second, the knowledge turned out to be wrong. Then the record is retracted: it stops answering regular queries while its Git history remains. To an agent, these are distinct signals: "work is finished and its outcome is worth reading" versus "this is no longer knowledge." Collapse both into a single delete or overwrite, and a reader cannot tell whether the old record disappeared because the job was done or because it was wrong—the exact ambiguity my old Markdown files created.&lt;/p&gt;

&lt;p&gt;States also matter for the store as a whole. Version 0.3.1 (October 15) added &lt;code&gt;kyb export&lt;/code&gt;, which writes a commit snapshot: one row per key, with its latest content and state (&lt;code&gt;active&lt;/code&gt;, &lt;code&gt;archived&lt;/code&gt;, or &lt;code&gt;retracted&lt;/code&gt;). Export answers "which keys existed at that commit, and in what state?" without including earlier versions; for those, use history.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Interface details.&lt;/strong&gt; By default, export uses the current commit; &lt;code&gt;--at&lt;/code&gt; pins another. The command is available in the CLI and over HTTP (&lt;code&gt;GET /export&lt;/code&gt;), but is not an MCP tool in v0.3.3; see &lt;a href="https://github.com/alex09x/kyb/blob/06f63b5ae0f8fdff24abb3b2c1c848ff41758faa/src/export.rs" rel="noopener noreferrer"&gt;&lt;code&gt;export.rs&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://github.com/alex09x/kyb/blob/06f63b5ae0f8fdff24abb3b2c1c848ff41758faa/src/mcp.rs" rel="noopener noreferrer"&gt;&lt;code&gt;mcp.rs&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;--changed-between&lt;/code&gt; returns content versions written inside the window, not retraction events. Whether a key was retracted can be checked from its history or an export snapshot.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  A Task You Can Find Too Late
&lt;/h2&gt;

&lt;p&gt;Keeping a history of decisions still leaves another problem: open commitments. Even a correctly saved task is useless if you remember it after its deadline. The store may hold an exact date while an ordinary search for a service never shows it: the human or agent was asking about something else.&lt;/p&gt;

&lt;p&gt;Deadlines arrived on October 27: v0.3.2 added them, and &lt;a href="https://github.com/alex09x/kyb/releases/tag/v0.3.3" rel="noopener noreferrer"&gt;v0.3.3&lt;/a&gt;, released the same day, refined them and added their display in the console. A task can now carry a due date, a marker for external consequences of missing it, and a reminder window. If the date depends on a future event, it can be kept as a provisional one.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Task fields.&lt;/strong&gt; The due date is stored in &lt;code&gt;due&lt;/code&gt;, the marker for external consequences in &lt;code&gt;hard&lt;/code&gt;, the reminder window in &lt;code&gt;remind_days&lt;/code&gt;. A provisional date is set through &lt;code&gt;expected&lt;/code&gt; together with &lt;code&gt;waits_on&lt;/code&gt;. A deadline field omitted on rewrite keeps its previous value; moving a date remains a version in Git.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Take an example task about renewing a certificate. Writing "by December 15" in its body is not enough: to the search engine, that is just text. The &lt;code&gt;due&lt;/code&gt; field lets a date be compared with a calendar, and &lt;code&gt;hard&lt;/code&gt; explains why missing it matters. Successful search results, record reads, and task and incident lists can carry a &lt;code&gt;deadlines&lt;/code&gt; block from the server: up to five overdue or soon-due open tasks. This selection is not limited to records matching the original question. Overdue items come before future ones; within each group, &lt;code&gt;hard&lt;/code&gt; deadlines come first. The count of remaining records is shown separately. In the CLI, the reminder goes to stderr while the JSON answer stays on stdout. The block can be switched off, and if computing it fails, the main answer may arrive without it: the absence of a reminder does not prove there are no commitments.&lt;/p&gt;

&lt;p&gt;For a "today" deadline, the reader's calendar matters. The CLI and the console send their own date; without one, the server uses its own. Historical queries work the other way: in &lt;code&gt;--as-of&lt;/code&gt;, a bare date means the end of the day in UTC.&lt;/p&gt;

&lt;p&gt;In the v0.3.3 web console, deadlines appear in a strip under the header, in the task queue, and in a separate by-date view. You can open a task, move its date, or close it with an outcome. But neither the strip nor the JSON does the work: KYB does not run a task on a schedule, repeat it, or send notifications. An agent still has to call the tool, read the reminder, and react — a limited way to make commitments more visible while reading, not proof that we miss deadlines less often.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding Is Not Knowing
&lt;/h2&gt;

&lt;p&gt;Clear states still leave the last stretch: finding the right record. KYB searches current records by words and, if a model is loaded, by meaning. Historical versions in v0.3.3 are searched by words only: vectors exist only for current versions. Comparing the quality of current and historical results without accounting for that difference would mislead. The API response reports whether semantic search took part in a query.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How search works.&lt;/strong&gt; Tantivy performs BM25 keyword search, and the multilingual-e5-small model, via ONNX Runtime, adds semantic candidates. The two lists are merged by reciprocal rank fusion. Without a model, only keyword search remains.&lt;/p&gt;
&lt;/blockquote&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fulyew8scth70clo9ygx6.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%2Fulyew8scth70clo9ygx6.png" alt="KYB 0.3.3 diagram: CLI, HTTP API, and MCP talk to a single server; Git stores revisions, the search index derives from them, and current and temporal queries use different search paths." width="780" height="2080"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 2. One canonical store, several interfaces, two search paths.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Figure 2 puts the pieces together: three client interfaces lead to one server, Git holds canonical versions, the index derives from them, and current and temporal queries take different paths. The web console uses the same HTTP API; its on-screen queues are not shown here. No diagram can guarantee that an agent will ask at all. A hit shows what was saved, not that it is true, and an uncalled tool never helps. How much that matters, I learned from the agents themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Agents Told Us
&lt;/h2&gt;

&lt;p&gt;On October 10, 2026 (PDT, UTC−7), I asked five internal coding agents how the shared store fit into their work. Four replied in writing; the replies live in an internal record committed October 11 UTC. This is a small qualitative survey, not a representative sample or usage telemetry. Still, one issue recurred: KYB works on demand, whereas some memory files load into context automatically at session start. The tool can be available while the agent forgets to call it, so part of our durable knowledge kept living in separate files instead of the shared store.&lt;/p&gt;

&lt;p&gt;My original problem returned from the other side: before, an agent found an old file and trusted it; now it had a path to the current record but no prompt to take it. The agents asked for a short digest of workspace records at session start and an explicit verification status: who confirmed a fact, when, from what source, and at which revision. They also noted that behavioral rules for agents are awkward to model as ordinary knowledge. This is user feedback, not proof that automatic context injection improves accuracy. When that record was written, automatic &lt;code&gt;kyb context&lt;/code&gt; was only a proposal, and the v0.3.3 server does not provide it. The deadline reminders described above arrived only after this survey, in late October. They return part of the current commitments, not the whole project context.&lt;/p&gt;

&lt;p&gt;Separately, I tested provenance: when different agents write records, you need to know which one did. On October 11, I ran trial writes via the CLI from Claude Code, Codex, and Antigravity, and via MCP from Claude Code, using the attribution mechanism from &lt;a href="https://github.com/alex09x/kyb/pull/16" rel="noopener noreferrer"&gt;PR #16&lt;/a&gt;. Git history recorded labels for agent, session, workspace, and write transport, confirming those paths. In v0.3.3, the CLI refines this attribution: it walks up the process tree and picks the nearest agent with its own session. For example, Claude Code inside an Antigravity terminal should not be recorded as Antigravity; an explicit &lt;code&gt;KYB_AGENT&lt;/code&gt; takes priority. Because clients supply the labels, they help audit changes but do not provide cryptographic identity or prove regular store usage.&lt;/p&gt;

&lt;p&gt;An episode before the survey showed what a shared dependency costs. On October 8, an agent reported that several &lt;code&gt;kyb query&lt;/code&gt; calls exited with no output after an external timeout expired. On October 11, repeat queries answered in under a second. Logs did not cover the first report, and nobody checked stderr or server status then, leaving the cause unknown—server, network, or client call. I treat this as an agent's report, not a reproduced defect or benchmark: when agents rely on a shared service, availability and clear timeout diagnostics become part of memory. The v0.3.3 CLI makes those diagnostics explicit: the exit code distinguishes success, a server rejection, a server error, and an unreachable server; the error goes to stderr, and stdout stays empty on failure. It still does not explain the October episode after the fact. If an agent checks only for text and ignores the exit code, even a good store history will not help.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Loop You Have to Practice
&lt;/h2&gt;

&lt;p&gt;The cases above and the agents' feedback point to Figure 3: a record must be written explicitly in one session and looked up explicitly in the next.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F630goysm8flou7wpxe7i.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%2F630goysm8flou7wpxe7i.png" alt="The shared memory cycle: an agent in one session verifies a fact and explicitly saves a version in Git; the next session explicitly searches for the record and checks it against a current source." width="780" height="1920"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 3. A record survives the session, but it does not enter a new context window on its own.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In Figure 3, Session A at the top learns something: the agent observes a change, checks a source, separates fact from hypothesis, and explicitly saves a version under a stable key. Git keeps the revision, and the index derives from it. Session B below is the next session. Because it does not automatically inherit the prior chat, it starts with a specific question, queries in the right mode, checks the result against a current source, and only then uses, corrects, or retracts the record. This is the intended order, not observed behavior of every agent.&lt;/p&gt;

&lt;p&gt;Three points matter most. First, the question: "Tell me everything about the project" returns too much text, while "Why did we choose option B for this operation?" or "How did the last outage on this service end?" gives a clear target. An empty result may just need a component name, key, tag, or different wording. Second, verification: code at the right revision for an interface decision, configuration or observed responses for a running service. A record does not replace checking the primary source; it helps you locate what to check and how. Third, the update: an agent that learns a recommendation no longer applies and leaves the fix only in the current chat sets the same trap for the next session. Updating the record under its existing key, with reason and source, belongs in a task's definition of done.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Can Show, and What I Can't
&lt;/h2&gt;

&lt;p&gt;Everything above rests on public code or saved internal records. Back to an earlier version of the system — v0.2.0 from August 16. One field's history shows what such records preserve. An internal task described a backlog of over fifty open tasks with no explicit priority, forcing urgency into tags. Status filtering existed; importance ranking did not. The initial request named the field &lt;code&gt;severity&lt;/code&gt;, by analogy with incidents. Discussion refined that: &lt;code&gt;severity&lt;/code&gt; describes damage that already happened, while &lt;code&gt;priority&lt;/code&gt; fits future work. &lt;code&gt;priority&lt;/code&gt; shipped in &lt;a href="https://github.com/alex09x/kyb/blob/fa1bd111711ff6568e15302019de0617117e2430/src/model.rs#L105-L107" rel="noopener noreferrer"&gt;KYB v0.2.0&lt;/a&gt;—a concrete chain from friction to product change preserved in the store, not a measurement of agent speed.&lt;/p&gt;

&lt;p&gt;What I lack is a reliable count of reads per agent, a link between reads and task outcomes, or a controlled comparison with and without KYB. That requires fixed tasks and models, a log of when each agent queried the store and what it got, and blind grading, knowing an available tool is not always called. Until such data exists, I describe mechanisms and observations, not causal effects.&lt;/p&gt;

&lt;p&gt;This approach is not for everyone. A Git-backed shared store fits when several sessions or machines read and update changing knowledge and humans want history and diffs. For a single agent in one repository, a good README and a few project files are often enough. Git itself needs no server, but this design adds a shared server and an index to maintain, and the records still have to be verified and kept current. If your knowledge rarely changes, it may be one system too many.&lt;/p&gt;

&lt;h2&gt;
  
  
  Back to the Old Note
&lt;/h2&gt;

&lt;p&gt;Recall the opening scene: an agent finds a well-written note and heads down a path we abandoned long ago. What would change if that note lived in a shared store?&lt;/p&gt;

&lt;p&gt;The agent would not get smarter. Instead, the record would have one shared entry point, an explicit lifecycle state, and a queryable version history under a single key. If the plan was abandoned, its task can be closed with the reason and wrong knowledge can be retracted from current search, separating the record's status from an active instruction. If the plan evolved, the earlier text sits in history and the body holds the current one. If the question is about the past, a slice at the right moment answers about the past without mixing it into the present. None of this guarantees that an agent will interpret a hit correctly, and it helps only when the agent asks the question and checks the answer against the source.&lt;/p&gt;

&lt;p&gt;The practical takeaway does not require installing KYB. Next time you correct a note meant for agents, in a file, a wiki, or a store of your own, check three things. Did you replace the wrong text instead of appending a fix below it? Can a reader tell whether the plan was canceled, completed, or turned out to be wrong? Did you record why the decision was made and when it should be revisited? Three yes answers will not guarantee that the next agent never takes a wrong turn, but they give the next reader—human or session—an explicit status, the reason behind the decision, and a source to check instead of a stale note masquerading as the active plan.&lt;/p&gt;

&lt;p&gt;To see how KYB works, start with the &lt;a href="https://github.com/alex09x/kyb/releases/tag/v0.3.3" rel="noopener noreferrer"&gt;v0.3.3 release&lt;/a&gt; and the &lt;a href="https://github.com/alex09x/kyb/blob/06f63b5ae0f8fdff24abb3b2c1c848ff41758faa/README.md" rel="noopener noreferrer"&gt;README of that version&lt;/a&gt;, which cover prebuilt binaries, installation, and Docker Compose. For a first check, complete that setup, save one decision with a "Revisit if" line, then query it from a fresh session. For Docker, use a separate fresh checkout: Compose keeps its data in that checkout's &lt;code&gt;./data&lt;/code&gt; directory.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://prod.codes/blog/your-ai-agent-has-amnesia-mine-keeps-receipts/" rel="noopener noreferrer"&gt;prod.codes&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>git</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
