<?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: Daniel Imaino</title>
    <description>The latest articles on DEV Community by Daniel Imaino (@dimaino).</description>
    <link>https://dev.to/dimaino</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%2F4217307%2F5533dfe0-af4f-4185-98b0-29805d58663d.png</url>
      <title>DEV Community: Daniel Imaino</title>
      <link>https://dev.to/dimaino</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dimaino"/>
    <language>en</language>
    <item>
      <title>How to share AI coding agent context across a team</title>
      <dc:creator>Daniel Imaino</dc:creator>
      <pubDate>Fri, 30 Oct 2026 13:20:15 +0000</pubDate>
      <link>https://dev.to/dimaino/how-to-share-ai-coding-agent-context-across-a-team-4h3j</link>
      <guid>https://dev.to/dimaino/how-to-share-ai-coding-agent-context-across-a-team-4h3j</guid>
      <description>&lt;p&gt;To share context between the coding agents on a team, split it in two.&lt;br&gt;
&lt;strong&gt;Instructions&lt;/strong&gt; (how to build, conventions, rules) go in a file committed to&lt;br&gt;
the repository: &lt;code&gt;AGENTS.md&lt;/code&gt; is read by Codex, Cursor and Claude Code.&lt;br&gt;
&lt;strong&gt;Knowledge that grows as you work&lt;/strong&gt; (decisions, lessons from reverted&lt;br&gt;
changes, open tasks) goes in one shared memory every agent reads and writes&lt;br&gt;
over MCP. The file is the same for everyone because it's in git; the memory is&lt;br&gt;
the same for everyone because it's one server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why each agent starts from zero
&lt;/h2&gt;

&lt;p&gt;Each tool keeps its own context and none of it travels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code's auto memory is stored on one machine.&lt;/li&gt;
&lt;li&gt;Cursor's user rules are per person.&lt;/li&gt;
&lt;li&gt;Chat histories stay in the tool and with the person who had them.&lt;/li&gt;
&lt;li&gt;Pull request descriptions and Slack threads hold the reasons, but agents
don't read them before a change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the lesson one person's agent learned on Tuesday is learned again by&lt;br&gt;
someone else's on Thursday.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer 1: one instruction file for every agent
&lt;/h2&gt;

&lt;p&gt;Commit an &lt;code&gt;AGENTS.md&lt;/code&gt; at the repository root. Who reads it, from each&lt;br&gt;
tool's docs (checked on 30 October 2026):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Agent&lt;/th&gt;
&lt;th&gt;Reads AGENTS.md?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://developers.openai.com/codex/guides/agents-md" rel="noopener noreferrer"&gt;Codex&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Yes, from the repository root down to the working folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://cursor.com/docs/rules" rel="noopener noreferrer"&gt;Cursor&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Yes, at the root and in subfolders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://code.claude.com/docs/en/memory" rel="noopener noreferrer"&gt;Claude Code&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Yes, when there is no CLAUDE.md; otherwise import it with &lt;code&gt;@AGENTS.md&lt;/code&gt; in CLAUDE.md&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Keep it short and stable: build and test commands, layout, conventions, and&lt;br&gt;
the name of the project's shared memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer 2: one memory every agent reads and writes
&lt;/h2&gt;

&lt;p&gt;RepoMemory keeps a ledger per project with five kinds of entry:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Kind&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Decision&lt;/td&gt;
&lt;td&gt;"Chose Postgres full-text search over embeddings: predictable results."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lesson&lt;/td&gt;
&lt;td&gt;"Captcha on checkout cut completed orders 5%; reverted."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Guardrail&lt;/td&gt;
&lt;td&gt;"Never run migrations on deploy."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Note&lt;/td&gt;
&lt;td&gt;"Staging Stripe uses the shared test key."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Task&lt;/td&gt;
&lt;td&gt;"Move image uploads to R2."&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every agent uses the same tools: &lt;code&gt;brief&lt;/code&gt; at the start of a session (every&lt;br&gt;
guardrail, the open tasks, the newest decisions), &lt;code&gt;recall&lt;/code&gt; before a change,&lt;br&gt;
&lt;code&gt;record_entry&lt;/code&gt; when something is worth keeping, and &lt;code&gt;claim_task&lt;/code&gt; before&lt;br&gt;
starting a task. A claim is refused with &lt;code&gt;already_claimed&lt;/code&gt; if another agent&lt;br&gt;
has the task, and runs out after two hours unless renewed, so two people's&lt;br&gt;
agents don't do the same job and a crashed one doesn't hold it.&lt;/p&gt;

&lt;p&gt;Each entry records which key and which agent wrote it. Entries are shown to&lt;br&gt;
agents as notes, not instructions, and one worded like a prompt injection is&lt;br&gt;
flagged.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set it up for a team
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Put the team on one account. On the Team plan, every API key on the
account reads and writes the same ledgers. Invite teammates from the
dashboard.&lt;/li&gt;
&lt;li&gt;Each person creates their own key on the &lt;a href="https://repomemory.dev/dashboard/keys" rel="noopener noreferrer"&gt;API keys&lt;/a&gt; page
and sets it as &lt;code&gt;REPOMEMORY_KEY&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Each person connects their agent:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="c"&gt;# Claude Code&lt;/span&gt;
   claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http repomemory https://api.repomemory.dev/mcp &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s2"&gt;"X-API-Key: &lt;/span&gt;&lt;span class="nv"&gt;$REPOMEMORY_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
   &lt;span class="c"&gt;# Codex&lt;/span&gt;
   codex mcp add repomemory &lt;span class="nt"&gt;--url&lt;/span&gt; https://api.repomemory.dev/mcp &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;--bearer-token-env-var&lt;/span&gt; REPOMEMORY_KEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Cursor and VS Code, the &lt;a href="https://repomemory.dev/docs#mcp" rel="noopener noreferrer"&gt;docs&lt;/a&gt; have the JSON.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Commit the project-memory section to AGENTS.md once, for everyone:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;   ## Project memory (RepoMemory, project "acme/shop")
&lt;span class="p"&gt;   -&lt;/span&gt; At the start of a session, call &lt;span class="sb"&gt;`brief`&lt;/span&gt; for the project: it returns every guardrail, the open tasks and the latest decisions. Never break a guardrail.
&lt;span class="p"&gt;   -&lt;/span&gt; Before planning a change, removing code that looks unneeded or retrying an approach, call &lt;span class="sb"&gt;`recall`&lt;/span&gt; with words about the change. Follow what it returns.
&lt;span class="p"&gt;   -&lt;/span&gt; When a change is reverted, a fix took real digging, or you choose one approach over another, call &lt;span class="sb"&gt;`record_entry`&lt;/span&gt; (kind lesson or decision) saying what happened, why, and what to do instead, with your name in &lt;span class="sb"&gt;`agent`&lt;/span&gt;.
&lt;span class="p"&gt;   -&lt;/span&gt; Claim a task with &lt;span class="sb"&gt;`claim_task`&lt;/span&gt; before starting it and keep the &lt;span class="sb"&gt;`claim_token`&lt;/span&gt; it returns; &lt;span class="sb"&gt;`retire_entry`&lt;/span&gt; it when done, or call &lt;span class="sb"&gt;`claim_task`&lt;/span&gt; with &lt;span class="sb"&gt;`release`&lt;/span&gt; and the token if you stop without finishing.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;npx @plexsicity/repomemory init&lt;/code&gt; writes this section and adds the server&lt;br&gt;
   to Claude Code and Cursor in one step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep it healthy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;When a decision changes, record the new one with &lt;code&gt;supersedes&lt;/code&gt;; the old one
is retired with a pointer, and recall stops returning it.&lt;/li&gt;
&lt;li&gt;If someone's agent records a secret, delete the entry from the dashboard's
Ledger page; deleting is free.&lt;/li&gt;
&lt;li&gt;Export a project's whole ledger, retired entries included, with
&lt;code&gt;/v1/export&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits to know
&lt;/h2&gt;

&lt;p&gt;Recall matches words, not meaning. Agents record only what AGENTS.md tells&lt;br&gt;
them to. RepoMemory is hosted only, with no self-hosted version. The Team&lt;br&gt;
plan is $50 a month; see &lt;a href="https://repomemory.dev/pricing" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;First published on &lt;a href="https://repomemory.dev/guides/share-ai-agent-context-with-team" rel="noopener noreferrer"&gt;repomemory.dev&lt;/a&gt;. I build RepoMemory, so weigh my take on it accordingly.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>mcp</category>
      <category>teamwork</category>
    </item>
    <item>
      <title>Cursor rules for a team: project rules, team rules and shared memory</title>
      <dc:creator>Daniel Imaino</dc:creator>
      <pubDate>Fri, 30 Oct 2026 13:15:04 +0000</pubDate>
      <link>https://dev.to/dimaino/cursor-rules-for-a-team-project-rules-team-rules-and-shared-memory-1kkp</link>
      <guid>https://dev.to/dimaino/cursor-rules-for-a-team-project-rules-team-rules-and-shared-memory-1kkp</guid>
      <description>&lt;p&gt;To share Cursor rules with a team, commit them to the repository as project&lt;br&gt;
rules in &lt;code&gt;.cursor/rules/&lt;/code&gt; (or a plain &lt;code&gt;AGENTS.md&lt;/code&gt;), and use &lt;strong&gt;Team Rules&lt;/strong&gt; from&lt;br&gt;
the Cursor dashboard for rules that apply to every repository. Rules are&lt;br&gt;
instructions. For what the team has decided and learned, which changes week&lt;br&gt;
to week, add a shared ledger over MCP that every teammate's Cursor, and any&lt;br&gt;
other agent, reads before a change.&lt;/p&gt;
&lt;h2&gt;
  
  
  The four kinds of Cursor rules
&lt;/h2&gt;

&lt;p&gt;From &lt;a href="https://cursor.com/docs/rules" rel="noopener noreferrer"&gt;Cursor's rules docs&lt;/a&gt;, checked on 30&lt;br&gt;
October 2026:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Kind&lt;/th&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;th&gt;Shared with the team?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Project rules&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;.cursor/rules/*.mdc&lt;/code&gt; in the repo&lt;/td&gt;
&lt;td&gt;Yes, through git&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENTS.md&lt;/td&gt;
&lt;td&gt;The repo root and any subfolder&lt;/td&gt;
&lt;td&gt;Yes, through git; Claude Code and Codex read it too&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Team Rules&lt;/td&gt;
&lt;td&gt;The Cursor dashboard (Team and Enterprise plans)&lt;/td&gt;
&lt;td&gt;Yes, every repository; admins can enforce them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User Rules&lt;/td&gt;
&lt;td&gt;Your Cursor settings&lt;/td&gt;
&lt;td&gt;No, only you&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When rules disagree, Team Rules come first, then project rules, then user&lt;br&gt;
rules.&lt;/p&gt;
&lt;h2&gt;
  
  
  A project rule the whole team gets
&lt;/h2&gt;

&lt;p&gt;Project rules must use the &lt;code&gt;.mdc&lt;/code&gt; extension; a plain &lt;code&gt;.md&lt;/code&gt; file in&lt;br&gt;
&lt;code&gt;.cursor/rules&lt;/code&gt; is ignored. The front matter decides when a rule applies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Conventions for the checkout service&lt;/span&gt;
&lt;span class="na"&gt;globs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;src/checkout/**/*.ts&lt;/span&gt;
&lt;span class="na"&gt;alwaysApply&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Validate every request body with zod at the route.
&lt;span class="p"&gt;-&lt;/span&gt; Prices are integers in cents; never use floats for money.
&lt;span class="p"&gt;-&lt;/span&gt; Read @src/checkout/README.md before changing the payment flow.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;alwaysApply: true&lt;/code&gt;: in every chat.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;globs&lt;/code&gt; only: when a matching file is in context.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;description&lt;/code&gt; only: when the agent judges it relevant.&lt;/li&gt;
&lt;li&gt;Neither: only when someone @-mentions the rule.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cursor suggests keeping each rule under 500 lines and adding rules when you&lt;br&gt;
see the agent make the same mistake again.&lt;/p&gt;
&lt;h2&gt;
  
  
  If your team doesn't all use Cursor
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.cursor/rules&lt;/code&gt; is read only by Cursor. If some of the team use Claude Code,&lt;br&gt;
Codex or another agent, put the shared rules in &lt;code&gt;AGENTS.md&lt;/code&gt;: Cursor reads it&lt;br&gt;
(including nested ones in subfolders), Codex reads it, and Claude Code reads it&lt;br&gt;
when the repository has no CLAUDE.md. Keep Cursor-specific, file-scoped rules&lt;br&gt;
in &lt;code&gt;.cursor/rules&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  What rules don't do well
&lt;/h2&gt;

&lt;p&gt;Rules are static text that someone has to edit. They're a poor fit for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why a decision was made.&lt;/strong&gt; The rule says "no captcha on checkout"; the
reason, and the numbers behind it, don't fit in a rule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What was tried and reverted.&lt;/strong&gt; Writing every lesson into a rule makes it
long and less likely to be followed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Work in progress.&lt;/strong&gt; Which tasks are open, and which agent has taken one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Things learned today.&lt;/strong&gt; A teammate's agent finds out the staging database
is read-only; until someone edits a rule, nobody else's agent knows.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Add a shared ledger to every teammate's Cursor
&lt;/h2&gt;

&lt;p&gt;RepoMemory is an MCP server with one ledger per project. On the Team plan,&lt;br&gt;
every key on the account reads and writes the same ledgers. Add it to the&lt;br&gt;
project's &lt;code&gt;.cursor/mcp.json&lt;/code&gt;, with each person's key coming from their own&lt;br&gt;
environment so no key is committed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"repomemory"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.repomemory.dev/mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"X-API-Key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${env:REPOMEMORY_KEY}"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cursor fills in &lt;code&gt;${env:NAME}&lt;/code&gt; in &lt;code&gt;url&lt;/code&gt; and &lt;code&gt;headers&lt;/code&gt; from the environment.&lt;br&gt;
Then add an always-applied rule, &lt;code&gt;.cursor/rules/project-memory.mdc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;alwaysApply&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="gu"&gt;## Project memory (RepoMemory, project "acme/shop")&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; At the start of a session, call &lt;span class="sb"&gt;`brief`&lt;/span&gt; for the project: it returns every guardrail, the open tasks and the latest decisions. Never break a guardrail.
&lt;span class="p"&gt;-&lt;/span&gt; Before planning a change, removing code that looks unneeded or retrying an approach, call &lt;span class="sb"&gt;`recall`&lt;/span&gt; with words about the change. Follow what it returns.
&lt;span class="p"&gt;-&lt;/span&gt; When a change is reverted, a fix took real digging, or you choose one approach over another, call &lt;span class="sb"&gt;`record_entry`&lt;/span&gt; (kind lesson or decision) saying what happened, why, and what to do instead, with your name in &lt;span class="sb"&gt;`agent`&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now a lesson one teammate's agent records reaches everyone's next session,&lt;br&gt;
and a rule nobody should break can be a guardrail, which &lt;code&gt;brief&lt;/code&gt; hands every&lt;br&gt;
agent at the start of a session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits to know
&lt;/h2&gt;

&lt;p&gt;RepoMemory's recall matches words, not meaning, so agents should recall with&lt;br&gt;
the words of the change ("captcha checkout"). It's hosted only. The Team plan&lt;br&gt;
is $50 a month for 20,000 new entries; recall is free. See &lt;a href="https://repomemory.dev/pricing" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;&lt;br&gt;
and the &lt;a href="https://repomemory.dev/docs#mcp" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;First published on &lt;a href="https://repomemory.dev/guides/cursor-rules-for-teams" rel="noopener noreferrer"&gt;repomemory.dev&lt;/a&gt;. I build RepoMemory, so weigh my take on it accordingly.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cursor</category>
      <category>ai</category>
      <category>productivity</category>
      <category>teamwork</category>
    </item>
    <item>
      <title>CLAUDE.md vs shared memory for coding agents</title>
      <dc:creator>Daniel Imaino</dc:creator>
      <pubDate>Fri, 30 Oct 2026 13:09:53 +0000</pubDate>
      <link>https://dev.to/dimaino/claudemd-vs-shared-memory-for-coding-agents-126e</link>
      <guid>https://dev.to/dimaino/claudemd-vs-shared-memory-for-coding-agents-126e</guid>
      <description>&lt;p&gt;Put instructions in &lt;strong&gt;CLAUDE.md&lt;/strong&gt; and history in &lt;strong&gt;shared memory&lt;/strong&gt;. CLAUDE.md&lt;br&gt;
(or AGENTS.md) is loaded in full into every session, so it should hold short,&lt;br&gt;
stable rules: how to build, conventions, where things live. Shared memory is&lt;br&gt;
searched when it's needed, so it can hold the long tail: why a decision was&lt;br&gt;
made, what was reverted, which tasks are open. Most projects need both, and&lt;br&gt;
the CLAUDE.md is where you tell agents to use the memory.&lt;/p&gt;
&lt;h2&gt;
  
  
  The difference in one table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;CLAUDE.md / AGENTS.md&lt;/th&gt;
&lt;th&gt;Shared memory (a ledger over MCP)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What it holds&lt;/td&gt;
&lt;td&gt;Instructions&lt;/td&gt;
&lt;td&gt;Decisions, lessons, guardrails, notes, tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How the agent gets it&lt;/td&gt;
&lt;td&gt;Loaded whole at session start&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;brief&lt;/code&gt; at session start, &lt;code&gt;recall&lt;/code&gt; with words about the change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Size it works at&lt;/td&gt;
&lt;td&gt;Short: Anthropic suggests under 200 lines per file&lt;/td&gt;
&lt;td&gt;Hundreds of entries; only matching ones come back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Who writes it&lt;/td&gt;
&lt;td&gt;People, in commits&lt;/td&gt;
&lt;td&gt;Agents and people, as they work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;When something changes&lt;/td&gt;
&lt;td&gt;Someone edits the line&lt;/td&gt;
&lt;td&gt;A new entry supersedes the old one, which is retired&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Who reads it&lt;/td&gt;
&lt;td&gt;Whoever has the repository checked out&lt;/td&gt;
&lt;td&gt;Every agent and person with a key to the project, in any client&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Versioned&lt;/td&gt;
&lt;td&gt;In git, with the code&lt;/td&gt;
&lt;td&gt;In the ledger, with the author and date of each entry&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The CLAUDE.md column is from &lt;a href="https://code.claude.com/docs/en/memory" rel="noopener noreferrer"&gt;Anthropic's memory docs&lt;/a&gt;,&lt;br&gt;
checked on 30 October 2026.&lt;/p&gt;
&lt;h2&gt;
  
  
  What belongs in CLAUDE.md
&lt;/h2&gt;

&lt;p&gt;Things that are true in every session and short to state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Build&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`npm test`&lt;/span&gt; before committing; &lt;span class="sb"&gt;`npm run lint -- --fix`&lt;/span&gt; for style.
&lt;span class="gu"&gt;## Layout&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; API handlers in src/api/handlers/, one file per route.
&lt;span class="gu"&gt;## Project memory (RepoMemory, project "acme/shop")&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; At the start of a session, call &lt;span class="sb"&gt;`brief`&lt;/span&gt; for the project. Never break a guardrail.
&lt;span class="p"&gt;-&lt;/span&gt; Before planning a change, call &lt;span class="sb"&gt;`recall`&lt;/span&gt; with words about the change.
&lt;span class="p"&gt;-&lt;/span&gt; When a change is reverted or you choose one approach over another, call &lt;span class="sb"&gt;`record_entry`&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a line only matters when someone touches one part of the code, it's a&lt;br&gt;
candidate for a path-scoped rule (&lt;code&gt;.claude/rules/&lt;/code&gt; in Claude Code,&lt;br&gt;
&lt;code&gt;.cursor/rules/&lt;/code&gt; in Cursor) or for the ledger.&lt;/p&gt;
&lt;h2&gt;
  
  
  What belongs in shared memory
&lt;/h2&gt;

&lt;p&gt;Things that matter for one change, and stories that explain a rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lesson:&lt;/strong&gt; "Captcha on checkout cut completed orders 5%. Reverted after two
weeks; bots only spike on release days."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decision:&lt;/strong&gt; "Chose Postgres full-text search over embeddings: same query,
same results, no model to run."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrail:&lt;/strong&gt; "Never run migrations on deploy; the release job runs them
first." &lt;code&gt;brief&lt;/code&gt; returns every guardrail at the start of a session, so rules
like this don't depend on a search matching them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Task:&lt;/strong&gt; "Move image uploads to R2", which an agent claims before starting
so no other agent starts the same job.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a lesson being recorded, as an agent would through the&lt;br&gt;
&lt;code&gt;record_entry&lt;/code&gt; tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://api.repomemory.dev/v1/record &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-API-Key: &lt;/span&gt;&lt;span class="nv"&gt;$REPOMEMORY_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"project":"acme/shop","kind":"lesson",
       "title":"Captcha on checkout cut completed orders 5%",
       "body":"Shipped a captcha on the checkout page in March and reverted it after two weeks: completed orders fell 5%. Bots only spike on release days.",
       "tags":["checkout","captcha"],"agent":"claude-code"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Six months later, an agent asked to "add a captcha to checkout" recalls with&lt;br&gt;
those words and finds it before writing any code.&lt;/p&gt;
&lt;h2&gt;
  
  
  Signs you've put something in the wrong place
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your CLAUDE.md has a "history" or "don't do X again" section that keeps
growing. Move the stories to the ledger and leave one-line rules.&lt;/li&gt;
&lt;li&gt;Agents repeat a reverted change. The lesson was in a PR description or a
chat nobody's agent reads.&lt;/li&gt;
&lt;li&gt;Two lines in CLAUDE.md contradict each other because a decision changed.
In a ledger, recording the new decision with &lt;code&gt;supersedes&lt;/code&gt; retires the old
one.&lt;/li&gt;
&lt;li&gt;A rule is ignored by Cursor or Codex because it lives in Claude Code's
machine-local auto memory.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Set it up
&lt;/h2&gt;

&lt;p&gt;Create a free key on the &lt;a href="https://repomemory.dev/dashboard/keys" rel="noopener noreferrer"&gt;API keys&lt;/a&gt; page, then in the&lt;br&gt;
repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;REPOMEMORY_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sk_live_...
npx @plexsicity/repomemory init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It adds the MCP server to Claude Code and Cursor and writes the project-memory&lt;br&gt;
section into AGENTS.md or CLAUDE.md. The &lt;a href="https://repomemory.dev/docs#mcp" rel="noopener noreferrer"&gt;docs&lt;/a&gt; show the setup for&lt;br&gt;
Codex, VS Code and Claude.ai.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;First published on &lt;a href="https://repomemory.dev/guides/claude-md-vs-shared-memory" rel="noopener noreferrer"&gt;repomemory.dev&lt;/a&gt;. I build RepoMemory, so weigh my take on it accordingly.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>mcp</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to give Claude Code memory between sessions</title>
      <dc:creator>Daniel Imaino</dc:creator>
      <pubDate>Fri, 30 Oct 2026 13:02:17 +0000</pubDate>
      <link>https://dev.to/dimaino/how-to-give-claude-code-memory-between-sessions-568d</link>
      <guid>https://dev.to/dimaino/how-to-give-claude-code-memory-between-sessions-568d</guid>
      <description>&lt;p&gt;Claude Code doesn't remember your last session: each one starts with a fresh&lt;br&gt;
context window. Three things carry knowledge over. &lt;strong&gt;CLAUDE.md&lt;/strong&gt; holds the&lt;br&gt;
instructions you write. &lt;strong&gt;Auto memory&lt;/strong&gt; holds notes Claude writes for itself&lt;br&gt;
on your machine. A &lt;strong&gt;shared ledger&lt;/strong&gt; over MCP, such as RepoMemory, holds the&lt;br&gt;
decisions, lessons and tasks that every agent and teammate on the project&lt;br&gt;
should see. Use the first two for how to work in the repository, and the third&lt;br&gt;
for what has happened in it.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Claude Code carries over by itself
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://code.claude.com/docs/en/memory" rel="noopener noreferrer"&gt;Anthropic's memory docs&lt;/a&gt; (checked on&lt;br&gt;
30 October 2026) describe two mechanisms, both loaded at the start of every&lt;br&gt;
session:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;CLAUDE.md&lt;/th&gt;
&lt;th&gt;Auto memory&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Who writes it&lt;/td&gt;
&lt;td&gt;You&lt;/td&gt;
&lt;td&gt;Claude&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Where it lives&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;./CLAUDE.md&lt;/code&gt; in the repo, &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; for you, or an organisation-wide file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.claude/projects/&amp;lt;project&amp;gt;/memory/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shared with&lt;/td&gt;
&lt;td&gt;The team, through git&lt;/td&gt;
&lt;td&gt;Nobody: it is machine-local&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Loaded&lt;/td&gt;
&lt;td&gt;Every session, in full&lt;/td&gt;
&lt;td&gt;The first 200 lines or 25 KB of &lt;code&gt;MEMORY.md&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Good for&lt;/td&gt;
&lt;td&gt;Build commands, conventions, layout, "always do X"&lt;/td&gt;
&lt;td&gt;Your preferences and the corrections you gave Claude&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both are context, not enforced rules. The docs suggest keeping each CLAUDE.md&lt;br&gt;
under about 200 lines, because longer files cost context and are followed less&lt;br&gt;
reliably.&lt;/p&gt;
&lt;h2&gt;
  
  
  Where they stop
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Auto memory stays on one machine.&lt;/strong&gt; It isn't shared across machines,
cloud sessions or teammates. A lesson Claude learned on your laptop doesn't
reach the CI agent or a colleague's Cursor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CLAUDE.md is for rules, not history.&lt;/strong&gt; "We reverted the checkout captcha
because orders fell 5%" is worth knowing before anyone touches checkout, but
a file loaded whole into every session can't hold every such story without
growing past the size where it is followed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nothing is retired.&lt;/strong&gt; When a decision changes, someone has to find and
edit the old line, or the file says both things.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Only Claude Code reads auto memory.&lt;/strong&gt; Codex, Cursor and other agents
working on the same repository don't see it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Add a shared ledger over MCP
&lt;/h2&gt;

&lt;p&gt;RepoMemory is an MCP server that keeps a project's decisions, lessons,&lt;br&gt;
guardrails, notes and tasks. Claude Code calls &lt;code&gt;brief&lt;/code&gt; at the start of a&lt;br&gt;
session, &lt;code&gt;recall&lt;/code&gt; before a change, and &lt;code&gt;record_entry&lt;/code&gt; when something is worth&lt;br&gt;
keeping. Recall searches, so only the entries about the change at hand come&lt;br&gt;
back, and the ledger can grow without filling the context.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a free key on the &lt;a href="https://repomemory.dev/dashboard/keys" rel="noopener noreferrer"&gt;API keys&lt;/a&gt; page and add the
server:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http repomemory https://api.repomemory.dev/mcp &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s2"&gt;"X-API-Key: &lt;/span&gt;&lt;span class="nv"&gt;$REPOMEMORY_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Add this to the repository's &lt;code&gt;CLAUDE.md&lt;/code&gt; or &lt;code&gt;AGENTS.md&lt;/code&gt;, so every session
knows the project's ledger and when to use it:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;   ## Project memory (RepoMemory, project "acme/shop")
&lt;span class="p"&gt;   -&lt;/span&gt; At the start of a session, call &lt;span class="sb"&gt;`brief`&lt;/span&gt; for the project: it returns every guardrail, the open tasks and the latest decisions. Never break a guardrail.
&lt;span class="p"&gt;   -&lt;/span&gt; Before planning a change, removing code that looks unneeded or retrying an approach, call &lt;span class="sb"&gt;`recall`&lt;/span&gt; with words about the change. Follow what it returns.
&lt;span class="p"&gt;   -&lt;/span&gt; When a change is reverted, a fix took real digging, or you choose one approach over another, call &lt;span class="sb"&gt;`record_entry`&lt;/span&gt; (kind lesson or decision) saying what happened, why, and what to do instead, with your name in &lt;span class="sb"&gt;`agent`&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Or do both at once in the repository with the command line tool (Node.js
22 or newer):
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;REPOMEMORY_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sk_live_...
   npx @plexsicity/repomemory init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The next session starts with a call like this one, made for you by Claude:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://api.repomemory.dev/v1/brief &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-API-Key: &lt;/span&gt;&lt;span class="nv"&gt;$REPOMEMORY_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"project":"acme/shop"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns every active guardrail in full, the open tasks and the newest&lt;br&gt;
decisions and lessons, so the session begins where the last one stopped.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to keep where
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CLAUDE.md:&lt;/strong&gt; how to build and test, conventions, the project's ledger name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto memory:&lt;/strong&gt; your own preferences, which nobody else needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The ledger:&lt;/strong&gt; why something is the way it is, what was tried and
reverted, rules nobody should break, and tasks other agents may pick up.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits to know
&lt;/h2&gt;

&lt;p&gt;Recall matches words, not meaning: "captcha checkout" finds a lesson titled&lt;br&gt;
"Captcha on checkout", while "why did orders drop" may not. Agents only record&lt;br&gt;
what they are told to, which is what the CLAUDE.md lines are for. RepoMemory is&lt;br&gt;
hosted only. The free plan allows 300 new entries a month; recall, claims and&lt;br&gt;
retires are free. See &lt;a href="https://repomemory.dev/pricing" rel="noopener noreferrer"&gt;pricing&lt;/a&gt; and the &lt;a href="https://repomemory.dev/docs" rel="noopener noreferrer"&gt;docs&lt;/a&gt; for other&lt;br&gt;
clients.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;First published on &lt;a href="https://repomemory.dev/guides/claude-code-memory-between-sessions" rel="noopener noreferrer"&gt;repomemory.dev&lt;/a&gt;. I build RepoMemory, so weigh my take on it accordingly.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>productivity</category>
      <category>mcp</category>
    </item>
    <item>
      <title>How to stop AI coding agents repeating reverted changes</title>
      <dc:creator>Daniel Imaino</dc:creator>
      <pubDate>Fri, 30 Oct 2026 12:59:32 +0000</pubDate>
      <link>https://dev.to/dimaino/how-to-stop-ai-coding-agents-repeating-reverted-changes-3oc0</link>
      <guid>https://dev.to/dimaino/how-to-stop-ai-coding-agents-repeating-reverted-changes-3oc0</guid>
      <description>&lt;p&gt;AI coding agents repeat reverted changes because the reason for the revert isn't anywhere they look. The code shows only what is there now, not what was tried and taken out. To stop it, write the reason down as a lesson where every agent checks before a change, and tell agents to check. With RepoMemory, that means a &lt;code&gt;record_entry&lt;/code&gt; when the change is reverted, a &lt;code&gt;recall&lt;/code&gt; before the next change, and three lines in AGENTS.md or CLAUDE.md.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;Say someone added a captcha to checkout in March, and completed orders fell 5%, so it was reverted. In October someone asks an agent to "stop bots on checkout". The agent sees a checkout with no captcha and adds one. The lesson is still around, but the agent doesn't see it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the revert commit says "Revert 'Add captcha'", with no reason;&lt;/li&gt;
&lt;li&gt;the reason is in a PR comment, a Slack thread or someone's head;&lt;/li&gt;
&lt;li&gt;a "don't add a captcha" line in CLAUDE.md might be there, but a file that collects every such story stops being followed once it's long.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Record the lesson when you revert
&lt;/h2&gt;

&lt;p&gt;The agent that does the revert, or you, records what happened and what to do instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://api.repomemory.dev/v1/record &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-API-Key: &lt;/span&gt;&lt;span class="nv"&gt;$REPOMEMORY_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"project":"acme/shop","kind":"lesson",
       "title":"Captcha on checkout cut completed orders 5%",
       "body":"Shipped a captcha on the checkout page in March and reverted it after two weeks: completed orders fell 5%. Bots only spike on release days.",
       "tags":["checkout","captcha"],"agent":"claude-code"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put the words someone would use for the change in the title and tags ("captcha", "checkout"). Recall matches words, so a title in the change's own words is what makes it findable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recall before the next change
&lt;/h2&gt;

&lt;p&gt;Before planning, the agent searches with words about the change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://api.repomemory.dev/v1/recall &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-API-Key: &lt;/span&gt;&lt;span class="nv"&gt;$REPOMEMORY_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"project":"acme/shop","query":"add a captcha to checkout"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lesson comes back, and the agent can propose rate limiting on release days instead. Recall is free and unmetered on every plan, so agents can do it before every change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make it automatic
&lt;/h2&gt;

&lt;p&gt;Agents use the same operations as MCP tools. Connect the server (the &lt;a href="https://repomemory.dev/docs#mcp" rel="noopener noreferrer"&gt;docs&lt;/a&gt; cover Claude Code, Cursor, Codex, VS Code and Claude.ai) and add this to AGENTS.md or CLAUDE.md:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Project memory (RepoMemory, project "acme/shop")&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; At the start of a session, call &lt;span class="sb"&gt;`brief`&lt;/span&gt; for the project: it returns every guardrail, the open tasks and the latest decisions. Never break a guardrail.
&lt;span class="p"&gt;-&lt;/span&gt; Before planning a change, removing code that looks unneeded or retrying an approach, call &lt;span class="sb"&gt;`recall`&lt;/span&gt; with words about the change. Follow what it returns.
&lt;span class="p"&gt;-&lt;/span&gt; When a change is reverted, a fix took real digging, or you choose one approach over another, call &lt;span class="sb"&gt;`record_entry`&lt;/span&gt; (kind lesson or decision) saying what happened, why, and what to do instead, with your name in &lt;span class="sb"&gt;`agent`&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Removing code that looks unneeded" is in there on purpose: agents also undo fixes by tidying away a line that looks pointless. A lesson recorded when the line was added stops that too.&lt;/p&gt;

&lt;h2&gt;
  
  
  For rules that must never be broken
&lt;/h2&gt;

&lt;p&gt;If a lesson has become a rule, record it as a &lt;code&gt;guardrail&lt;/code&gt; instead. &lt;code&gt;brief&lt;/code&gt; returns every active guardrail at the start of each session, whatever the agent is about to do, so the rule doesn't depend on a search matching it.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the lesson stops being true
&lt;/h2&gt;

&lt;p&gt;If bots are later blocked at the CDN and a captcha is no longer the question, retire the lesson with a reason, or record a new decision with &lt;code&gt;supersedes&lt;/code&gt; set to its id. Recall then leaves the old one out, and an agent won't refuse a change the team has agreed to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The free plan has 300 new entries a month and needs no card. Create a key on the &lt;a href="https://repomemory.dev/dashboard/keys" rel="noopener noreferrer"&gt;API keys&lt;/a&gt; page, then run &lt;code&gt;npx @plexsicity/repomemory init&lt;/code&gt; in the repository.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;First published on &lt;a href="https://repomemory.dev/guides/stop-ai-agents-repeating-reverted-changes" rel="noopener noreferrer"&gt;repomemory.dev&lt;/a&gt;. I build RepoMemory, so weigh my take on it accordingly.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>claude</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
