Dev.to AI 🤖 Ai 👁 2 📖 5 min read

Your Agent's Memory Is Not the Current State of Your Repo

A green “tests passed” badge can be wrong without anybody lying. Imagine resuming a coding-agent session. Its checkpoint says the form validation tests passed. Someone has since changed the validation code, but the resu

A green “tests passed” badge can be wrong without anybody lying.

Imagine resuming a coding-agent session. Its checkpoint says the form validation tests passed. Someone has since changed the validation code, but the resumed session carries the old result forward as current evidence. The checkpoint remembered correctly. The badge didn't.

Remembering why you made a decision and knowing what is true in the checkout are different jobs. A longer memory doesn't remove that distinction. It gives you more information to reconcile.

Three records, three different questions

Shared memory answers: what should survive across tasks and clients? Project conventions, decision reasons, recurring constraints. Scope matters: a convention from another repository isn't automatically relevant here.

A session checkpoint answers: where did this particular task stop? Preserve the goal, completed work, rejected options and next step. Savepoint's Markdown session saves and stable decision IDs address that continuity problem. A saved reason is more useful than a bare instruction when the next session needs to revisit a choice.

A current observation answers: what can we establish about the working environment now? That includes checkout identity, branch, HEAD, uncommitted changes, active work and task-relevant validation evidence.

These records can disagree without any of them being useless. A checkpoint can accurately describe a former branch. A remembered test pass can remain valuable historical evidence after its applicability expires.

Shared recall also doesn't establish edit ownership. In shared-agent-memory, the coordination board is separate from memory: claims are advisory rather than filesystem locks. The default pre-edit hook warns; a separately selected block mode can refuse conflicting edits through that hook. Neither means every possible filesystem writer is excluded.

Persisting a claim and enforcing it are separate responsibilities.

Put the disagreement on a resume card

Consider a hypothetical frontend task: fixing a form's validation behavior after switching agent sessions. Before the next edit, build a small reconciliation table.

This is a proposed card for that scenario, not a report of executed checks.

Remembered claim Observed now Evidence scope and time Next action
Form tests passed Relevant validation code has changed Prior-session result; current inputs differ Mark current validation unknown; run the approved check
Continue on the task branch Checkout is on a different branch Resume-time branch observation Confirm the intended checkout before editing
This task owns the form files Concurrent work is unresolved Checkpoint assignment only; current ownership unknown Resolve ownership with the responsible developer

Each row needs a consequence. Otherwise it's just a summary with extra columns.

“Tests passed” needs enough context to be useful: which check, which inputs, which repository state, and when. For a local run, a commit identifier alone misses the dirty changes that may have been present during execution. Matching branch names are weaker still.

Timestamps help explain age. They don't establish applicability. A recent result can be stale after a relevant edit; an older decision can remain valid because its constraints haven't changed.

Don't make unknown look like success just to finish populating the card.

Reconcile before editing

Keep the old checkpoint intact. Start with read-only observations within the task's authorized scope, then record what agrees, what conflicts and what remains unchecked.

For the form task, that means inspecting the intended checkout and relevant staged, unstaged or untracked changes before trusting the saved test result. If the validation code changed, preserve the historical pass and mark current validation unknown. Choose the task-relevant check that would produce fresh evidence.

That check still needs appropriate boundaries. Permission to run a test isn't permission to contact production, inspect secrets or use real customer data. If the configured test's destinations are unclear, resolve that before running it.

A branch mismatch isn't permission to switch branches and carry someone else's changes along. An ownership conflict isn't permission to overwrite their work. When the allowed next action is unresolved, stop and ask the responsible person.

Make this a repeatable team procedure. The companion essay on how to make agent verification a repeatable team habit (Traditional Chinese) develops that organizational side: explicit verification and unverified-work fields, with short recipes for recurring tasks.

The card itself enforces nothing. A real write gate needs runner or tool integration. This is a proposed workflow, not an implemented gate, and its observations can become stale if another session changes the relevant state before the next action.

Make the frontend tell the truth

Start with a fixed read-only table. A branch name and a few unresolved checks don't need a model-designed layout.

Give the states precise meanings:

  • Saved: persisted from a previous session.
  • Observed: collected from an identified environment and state.
  • Stale: no longer applicable to the current action or inputs.
  • Unknown: not established yet.

Show the scope and evidence behind each state. “Saved successfully” must never silently become “validated successfully.”

Use task-adaptive views when the evidence differs enough to justify them: a form task might need a validation diff, while a migration task needs a schema comparison. If a model composes those views, constrain it to approved components and a validated data contract. Keep measured facts and action authorization outside generated prose. Partially streamed output must not enable a write action.

For that optional rendering layer, the curated discussions on Generative UI framework tradeoffs cover schema adherence, streaming reliability and design-system customization. Disclosure: Awesome Generative UI is my project. Those discussions offer implementation leads; they don't validate a checkpoint or implement the write gate.

The useful interface makes it easy to spot the unresolved branch or missing check. A fluent recap that hides either one is a worse interface, however polished it looks.

Carry the decision forward. Recheck the changed state.

Don't throw away durable memory because it can't certify the checkout. Keep the decision reasons and the task checkpoint. They explain what the next session is trying to do.

Then earn the current-state claims again wherever relevant inputs changed. On the next resumed task, put one remembered claim beside one fresh observation before making the next edit. If they disagree, resolve that disagreement instead of coloring it green.

Source notes

  • Savepoint — Markdown session saves, decision IDs and visible checkpoint state.
  • shared-agent-memory — shared recall and a separate coordination mechanism with advisory claims and configurable hooks.

These are documented project designs, not tools tested for this article. The resume card and reconciliation procedure are proposals, not measured results or guarantees of safe concurrent editing.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.