{"slug": "your-ai-coding-agent-has-amnesia-somehow-you-became-the-memory", "title": "Your AI Coding Agent Has Amnesia. Somehow You Became the Memory.", "summary": "A developer built Elephant, a tool that records coding agent sessions in a local journal to create recovery capsules, allowing context to be transferred between agents like Claude and Codex. The tool addresses the problem of AI coding agents losing context when sessions end, turning the developer into middleware. Elephant captures prompts, responses, tool calls, and file changes in real time, enabling a new agent to continue where the previous one left off.", "body_md": "Not an interesting bug.\n\nAn authentication bug.\n\nWhich means somewhere, somebody wanted a user to remain logged in, and now six files are involved.\n\nYou open Claude Code.\n\nClaude reads the repository.\n\nIt checks the authentication flow.\n\nIt finds the refresh-token logic.\n\nIt reads some tests.\n\nIt changes `auth/session.py`\n\n.\n\nOne test fails.\n\nClaude investigates.\n\nIt reads another file.\n\nIt discovers that the test is not really testing what its name suggests.\n\nNormal software development.\n\nForty-seven messages later, something beautiful happens.\n\nClaude finally understands the problem.\n\nNot approximately.\n\nNot “here are three possible causes.”\n\nIt actually understands it.\n\nYou understand it.\n\nClaude understands it.\n\nThe repository understands nothing because it is a folder.\n\nBut still.\n\nFor one brief moment, there is alignment.\n\nThen Claude says:\n\n```\nYou've hit your usage limit.\n```\n\nExcellent.\n\nThe only participant who understood the problem has died.\n\nBecause we live in the future.\n\nWe have multiple artificial intelligences capable of writing software.\n\nSurely this should help.\n\nYou open the same repository in Codex.\n\nCodex looks at you with the optimism of a new employee on Monday morning.\n\n```\nWhat would you like to work on?\n```\n\nAnd now you realise something.\n\nClaude has lost the context.\n\nCodex never had the context.\n\nBut **you** have the context.\n\nCongratulations.\n\nYou are now middleware.\n\nYour job was software engineering.\n\nYour new job is explaining one artificial intelligence to another artificial intelligence.\n\nWe automated programming and somehow created clerical work.\n\nSo you start typing.\n\n“Well, basically, we're fixing refresh-token rotation…”\n\nThen you explain the architecture.\n\nThen what Claude discovered.\n\nThen why the obvious fix didn't work.\n\nThen which files changed.\n\nThen the test that's still failing.\n\nThen the thing Claude tried before that.\n\nThen the thing that looked wrong but actually wasn't wrong.\n\nThen the thing that looked correct but was very wrong.\n\nCodex reads all this.\n\nYou say:\n\n“Got it?”\n\nCodex says:\n\n“Got it.”\n\nYou have no mechanism to verify this.\n\nThis is now a trust-based economy.\n\nAnd the particularly stupid part is that most of this information already exists.\n\nThe files exist.\n\nThe Git diff exists.\n\nThe tool calls happened.\n\nThe errors happened.\n\nThe conversation happened.\n\nThe model responses happened.\n\nYour computer witnessed everything.\n\nBut when you change coding agents, everybody behaves as though the previous forty minutes occurred in another civilisation.\n\nSo I built **Elephant**.\n\nNot because AI agents need more intelligence.\n\nThey need memory.\n\nThe basic idea is embarrassingly simple.\n\nWhile your coding agent is working, Elephant records what is happening.\n\nNot after the session.\n\nNot when the model is almost dead.\n\nWhile it is happening.\n\nPrompts.\n\nResponses.\n\nTool calls.\n\nFailures.\n\nFile changes.\n\nCurrent objective.\n\nGit state.\n\nRecent session events.\n\nAll of it goes into a local append-only journal.\n\nThen Elephant periodically creates what I call a **recovery capsule**.\n\nSo instead of this:\n\n```\nClaude:\nYou've hit your usage limit.\n\nCodex:\nWhat are we working on?\n\nYou:\nOkay. Sit down.\nIt started yesterday...\n```\n\nyou get something closer to:\n\n```\nClaude:\nYou've hit your usage limit.\n\n        [open same repo in Codex]\n\nElephant:\nRecovered previous Claude Code session.\n\nObjective:\nFix refresh-token rotation.\n\nState:\nImplementation complete.\nOne integration test still failing.\n\nChanged:\nauth/session.py\ntests/test_rotation.py\n\nCodex:\nI found the failing test.\nContinuing from there.\n```\n\nThat is basically Elephant.\n\nThe dead model does not have to explain what it was doing.\n\nElephant was taking notes while it was alive.\n\nThis turns out to be important.\n\nYes.\n\nYou can.\n\nThis works beautifully under one condition:\n\nClaude must still be alive.\n\nUnfortunately the message:\n\n```\nYou've hit your usage limit.\n```\n\nusually does not arrive three minutes before the usage limit.\n\nThere is no:\n\n```\nYou have 847 tokens remaining.\n\nPlease settle your affairs.\n```\n\nThe model does not gather its family.\n\nIt does not write a will.\n\nIt does not say:\n\n“Tell Codex the bug is in `rotate_token()`\n\n.”\n\nIt just stops.\n\nAsking a model at quota to summarize the session is like installing a fire alarm after the building has burned down.\n\nThe summary would have been useful.\n\nEarlier.\n\nSo Elephant doesn't depend on a dying model remembering to preserve its memory.\n\nIt journals continuously.\n\nAfter completed turns, it checkpoints.\n\nBefore compaction, it checkpoints.\n\nAt session end, it checkpoints.\n\nWhen the host exposes interruption or quota-failure events, Elephant records those too.\n\nIf the quota disappears without warning, the useful state is already on disk.\n\nThere is no heroic final message.\n\nI don't trust software that requires heroism.\n\nWe talk about Claude Code, Codex, Gemini, Copilot, OpenCode and everything else as if they are completely separate working environments.\n\nBut from the developer's perspective, they often aren't.\n\nThe project is the same.\n\nThe Git repository is the same.\n\nThe bug is the same.\n\nThe terminal is the same.\n\nThe developer is unfortunately still the same.\n\nOnly the model changed.\n\nYet changing the model often resets the understanding of the work.\n\nImagine doing this with human developers.\n\nDeveloper A works on a bug for four hours.\n\nAt 4 PM his shift ends.\n\nDeveloper B sits at the same desk.\n\nYou delete all of Developer A's notes.\n\nThen B says:\n\n“So what does this company do?”\n\nWe would call this poor management.\n\nWith AI we call it a new session.\n\nElephant uses a shared local store:\n\n```\n~/.elephant/\n├── elephant.db\n└── transcripts/\n```\n\nCapture-capable integrations write into the same versioned event format.\n\nSo the memory created while working in one supported harness can be recovered by another.\n\nThe architecture is roughly:\n\n```\n┌──────────────────────────────────────────────────┐\n│ Coding agents                                    │\n│ Claude · Codex · Hermes · OpenCode · Pi · ...   │\n├──────────────────────────────────────────────────┤\n│ Elephant                                         │\n│ redact · journal · checkpoint · inspect Git      │\n├──────────────────────────────────────────────────┤\n│ Continuation                                     │\n│ startup recovery · resume                        │\n└──────────────────────────────────────────────────┘\n```\n\nThe important architectural decision here is what Elephant **doesn't** do.\n\nIt doesn't pretend every coding agent has the same API.\n\nBecause they don't.\n\nThat abstraction would look elegant for approximately three days.\n\nThen one provider would add an event.\n\nAnother would rename a hook.\n\nA third would expose no hook at all.\n\nAnd eventually the universal interface would contain seventeen optional fields called things like:\n\n```\nmaybe_session_end_v2_final\n```\n\nInstead, Elephant has one memory protocol and thin native adapters around it.\n\nThe hosts remain different.\n\nThe memory doesn't have to.\n\nA useful handoff does not require the entire conversation to be shoved into another model.\n\nThat would technically preserve context in the same way moving your entire house preserves your toothbrush.\n\nElephant focuses on the state required to continue:\n\nThe distinction between **conversation history** and **working state** matters.\n\nIf I ask an agent to fix authentication and we spend thirty messages discovering that the problem is an incorrect cookie domain, the next agent doesn't necessarily need all thirty messages.\n\nIt needs to know:\n\n```\nObjective:\nFix auth refresh failure.\n\nFinding:\nCookie domain is incorrect in production config.\n\nChanged:\nconfig/auth.ts\n\nRemaining:\nIntegration test still failing on refresh.\n\nGit:\nWorking tree contains uncommitted changes.\n```\n\nThat is context.\n\nThe forty-seven-message archaeological record is evidence.\n\nUseful sometimes.\n\nNot the first thing you need.\n\nMemory systems have a dangerous tendency.\n\nThey remember something that *was* true and then confidently tell you it *is* true.\n\nThis is especially bad in programming because the repository has the annoying habit of changing.\n\nSuppose Claude modifies three files.\n\nElephant checkpoints.\n\nThen you manually revert one.\n\nThen you open Codex.\n\nWhat should happen?\n\nOption A:\n\nElephant believes its memory and tells Codex the old file still contains Claude's change.\n\nOption B:\n\nElephant checks reality.\n\nElephant chooses B.\n\nRecovery compares the stored capsule's Git metadata with the live worktree.\n\nThe files on disk win.\n\nBecause memory is evidence.\n\nThe repository is reality.\n\nThis is also a surprisingly useful rule outside software engineering.\n\nBut this is DEV Community, so we'll pretend I only meant Git.\n\nNothing.\n\nBecause Elephant probably doesn't know you're at 98%.\n\nAnd neither does your plugin.\n\nThis sounds like a missing feature until you notice the alternative is lying.\n\nMost coding harnesses do not expose an exact subscription percentage.\n\nSo Elephant stores quota information as:\n\n```\nexact\nestimated\nunknown\n```\n\nIf the host provides an exact signal, fine.\n\nIf it doesn't, Elephant does not manufacture:\n\n```\nCLAUDE QUOTA: 97.3%\nCRITICAL MEMORY MODE ACTIVATED\n```\n\nbecause that would be theatre.\n\nThe system is designed around the assumption that the agent may disappear unexpectedly.\n\nContinuous journaling makes exact quota prediction much less important.\n\nIf the memory is already saved, you don't need to predict the precise second the model dies.\n\nSeatbelts do not predict crashes either.\n\nThis has not prevented their adoption.\n\nA coding-agent conversation may contain:\n\nSending all of that to another memory SaaS by default felt unnecessary.\n\nSo Elephant's own journal stays local.\n\nNo Elephant account.\n\nNo Elephant cloud.\n\nNo analytics pipeline.\n\nNo telemetry.\n\nNo mysterious checkbox saying:\n\nHelp us improve Elephant by uploading the private repository that pays your salary.\n\nThe database lives on your machine.\n\nSensitive keys and common credential formats are redacted before persistence.\n\nThis is defense-in-depth, not magic.\n\nIf somebody has unrestricted access to your laptop, Elephant is not going to defeat the concept of computer security.\n\nThe elephant remembers.\n\nIt is not Batman.\n\nThere is another boring engineering reality.\n\nNot every coding harness exposes enough lifecycle information for automatic capture.\n\nIt would have been much easier to put twenty logos on the README and write:\n\n```\nSupports everything.\n```\n\nOpen-source README engineering is significantly easier than software engineering.\n\nInstead, Elephant distinguishes levels of support.\n\nSome hosts can provide native lifecycle capture and automatic recovery.\n\nOthers can participate through recovery skills, MCP surfaces, rules files, or repository-level instructions.\n\nThe current project includes integrations or recovery surfaces across tools including Claude Code, Codex, GitHub Copilot CLI, Gemini, Pi, Hermes, OpenCode, Cursor, Windsurf, Cline, Kiro and other compatible hosts.\n\nThe exact capability differs by harness.\n\nWhich is less impressive than saying “universal.”\n\nBut more useful.\n\nSoftware eventually has to interact with reality.\n\nReality has terrible developer experience.\n\nYou install Elephant in the harnesses between which you want continuity.\n\nFor example, in Claude Code the repository currently documents:\n\n```\n/plugin marketplace add vishesh9131/elephant\n```\n\nthen:\n\n```\n/plugin install elephant@elephant\n```\n\nFor Codex:\n\n```\ncodex plugin marketplace add vishesh9131/elephant\n```\n\nThen install Elephant from the marketplace through `/plugins`\n\n.\n\nThere are native/recovery setup paths for the other supported hosts as well; the repository keeps the current commands and platform matrix.\n\nPython 3.11+ is required for the local kernel and lifecycle hooks.\n\nOnce installed, the point is that Elephant should mostly disappear.\n\nI did not want another command that developers must remember to run before the thing designed to remember things can remember things.\n\nThat would be conceptually embarrassing.\n\nSometimes you actually want to ask for the previous session.\n\nElephant supports explicit recovery too.\n\nDepending on the host, that may be something like:\n\n```\n/elephant:resume\n```\n\nor:\n\n```\n$resume\n```\n\nor simply:\n\n```\nresume my previous session\n```\n\nThe exact surface depends on the coding harness.\n\nAgain, because the coding harnesses are actually different.\n\nI checked.\n\nAI coding has created an interesting situation.\n\nThe models are becoming increasingly capable of long, autonomous technical work.\n\nWhich makes losing their context more annoying, not less.\n\nIf an agent spends thirty seconds answering a question and forgets afterward, who cares?\n\nIf an agent spends forty-five minutes:\n\nthen its working context has value.\n\nThe model didn't merely produce text.\n\nIt accumulated **state**.\n\nAnd as developers increasingly move between different coding agents, that state needs to become portable.\n\nThere is already visible developer demand around shared context and handoffs between Claude, Codex, Gemini and similar tools. Developers are building utilities for context packaging, shared memory and multi-agent workflows because switching agents otherwise means repeatedly reconstructing project state. The problem is becoming a category rather than an isolated annoyance.\n\nThe interesting question is therefore no longer:\n\nWhich coding agent should own my project?\n\nIt might be:\n\nWhy should any coding agent own the memory?\n\nWe currently treat AI coding tools somewhat like IDEs.\n\nPick one.\n\nConfigure it.\n\nDevelop habits around it.\n\nDefend it online for reasons that become increasingly personal.\n\nBut models are moving quickly.\n\nOne model may be better at debugging.\n\nAnother may be better at planning.\n\nAnother may have a larger context window.\n\nOne may have available quota.\n\nOne may simply not be down today.\n\nSo perhaps the model should be a replaceable worker.\n\nThe project state should survive the worker.\n\nThat means:\n\n```\nproject\n  +\nworking state\n  +\nhistory\n  +\nGit evidence\n```\n\nshould not belong exclusively to Claude.\n\nOr Codex.\n\nOr Gemini.\n\nThe model is executing the work.\n\nThe memory belongs to the project.\n\nThat is the larger idea behind Elephant.\n\nKind of.\n\nBut that phrase has become sufficiently broad that it can now mean almost anything involving a database.\n\nElephant is intentionally narrower.\n\nIt is not trying to remember your childhood.\n\nIt does not need to know your favourite programming language from six months ago.\n\nIt does not construct a psychological profile because you used `var`\n\nonce.\n\nIts immediate job is much more boring:\n\n**Allow another coding agent to continue the work.**\n\nThat constraint is useful.\n\nBecause “memory” sounds like an AI research problem.\n\n“Handoff” sounds like an engineering problem.\n\nEngineering problems have tests.\n\nElephant's conformance flow is basically:\n\n```\ncapture\n   ↓\ncheckpoint\n   ↓\nswitch harness\n   ↓\nrecover\n   ↓\nverify Git state\n```\n\nThe project tests journaling, redaction, recovery, MCP behaviour, manifests and cross-harness continuation.\n\nBecause the worst possible outcome for a memory tool is:\n\n```\nElephant:\nI remember everything.\n\nDeveloper:\nGreat. What were we doing?\n\nElephant:\nSomething with authentication.\n```\n\nAt that point we have reinvented my actual memory.\n\nBecause elephants supposedly never forget.\n\nThis is convenient branding.\n\nThe alternative name was probably something like:\n\n**Cross-Harness Context Persistence Orchestration Kernel.**\n\nWhich sounds like a project whose documentation begins with Kubernetes.\n\nSo:\n\nElephant.\n\nWe spent years trying to make AI coding agents more autonomous.\n\nNow they can inspect repositories.\n\nRun commands.\n\nEdit files.\n\nWrite tests.\n\nDebug failures.\n\nReason across large codebases.\n\nAnd one of the remaining workflow problems is remarkably human:\n\nShift change.\n\nOne worker leaves.\n\nAnother worker arrives.\n\nNobody wrote down what happened.\n\nExcept now the workers are artificial intelligences with billion-parameter neural networks and the handover process is still:\n\n“Okay bro, basically…”\n\nThat seemed fixable.\n\nSo I built Elephant.\n\nThe model can forget.\n\nThe project shouldn't have to.\n\nIf you use multiple coding agents, try killing one in the middle of something interesting.\n\nFor once, that is an installation test.", "url": "https://wpnews.pro/news/your-ai-coding-agent-has-amnesia-somehow-you-became-the-memory", "canonical_source": "https://dev.to/vishesh_yadav_1dd30a79ab5/your-ai-coding-agent-has-amnesia-somehow-you-became-the-memory-2n5n", "published_at": "2026-08-12 21:27:58+00:00", "updated_at": "2026-08-12 21:45:54.121277+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-infrastructure"], "entities": ["Elephant", "Claude", "Codex"], "alternates": {"html": "https://wpnews.pro/news/your-ai-coding-agent-has-amnesia-somehow-you-became-the-memory", "markdown": "https://wpnews.pro/news/your-ai-coding-agent-has-amnesia-somehow-you-became-the-memory.md", "text": "https://wpnews.pro/news/your-ai-coding-agent-has-amnesia-somehow-you-became-the-memory.txt", "jsonld": "https://wpnews.pro/news/your-ai-coding-agent-has-amnesia-somehow-you-became-the-memory.jsonld"}}