{"slug": "the-code-was-in-git-the-ai-conversations-to-implement-it-was-gone", "title": "The Code Was in Git. The AI Conversations TO Implement it,Was Gone", "summary": "A developer built ContextVault, an open-source, local-first memory layer for AI-assisted development, after losing context from AI conversations when switching between tools like ChatGPT, Codex, and Cursor. ContextVault preserves and makes searchable the reasoning behind code changes, addressing the structural problem of fragmented context across multiple AI agents. The tool includes a CLI and an Electron desktop app, both sharing the same Markdown-based data model.", "body_md": "I reopened an old project and found a working authentication implementation.\n\nWhat I could not find was the reason it looked that way.\n\nThe commits showed the final code, but not:\n\nThe answers were scattered across a ChatGPT thread, a Codex session, and a terminal that no longer existed.\n\nThere was another layer to it. I don't stick to one agent. I move between Codex, Claude Code, Cursor, and plain ChatGPT threads — sometimes because one tool genuinely fits the task better, more often because I simply run out of credits on one and switch to another mid-task. Every time that happened, the new agent started from zero. It had no idea what the previous one had already tried, decided, or ruled out. I either re-explained everything from memory, or let the new agent guess and re-discover things the old one already knew.\n\nThis is not only a documentation problem. It is a structural problem in AI-assisted development.\n\nWe use several tools to produce one project, but every tool keeps a separate, temporary memory.\n\nThat experience became ContextVault.\n\nContextVault is an open-source, local-first memory layer for AI work.\n\nIt preserves useful context from browser LLM conversations, terminals, and coding-agent sessions, then makes that context searchable and reusable in later sessions.\n\nThink of the distinction this way:\n\n```\nGit:          what changed in the code?\nContextVault: why did we change it, what failed, and what should happen next?\n```\n\nThe trigger for building it was specifically the agent-switching problem: whenever one agent ran out of credits or hit a limit, I needed the next one to pick up exactly where the last one left off, instead of restarting the investigation.\n\nContextVault has three user-facing surfaces:\n\nThere is no required account or ContextVault backend. Browser data stays in the browser. Project sessions stay in local Markdown.\n\nInitialize ContextVault inside a repository:\n\n```\nnpx @aliabdm/contextvault init\ncontextvault record\n```\n\nDuring the session, preserve only the context that may matter later:\n\n```\n/title Fix authentication callback\n/source codex\n/user The login redirects back to the sign-in page.\n/agent The session cookie is missing during the callback.\n/decision Keep authentication checks in middleware.\n/problem The previous SameSite change did not fix the callback.\n/task Add a regression test for the redirect loop.\n/end\n```\n\nThe result is readable Markdown under:\n\n```\n.contextvault/sessions/\n```\n\nLater, a developer or agent can ask for evidence:\n\n```\ncontextvault history --since 2w\ncontextvault decisions auth --source codex\ncontextvault problems auth --since 30d\ncontextvault retrieve \"authentication callback\"\ncontextvault prepare \"fix authentication callback\"\n```\n\n`retrieve`\n\nranks relevant local events. `prepare`\n\ncreates a focused Markdown package for the next agent.\n\nThe current engine is deterministic and lexical. It does not send the project to an LLM or generate an ungrounded answer.\n\nThe CLI proved the model, but it limited the audience.\n\nSomeone who simply wants \"authentication decisions from the last month\" should not need to know this syntax:\n\n```\ncontextvault decisions auth --source codex --since 30d\n```\n\nSo I built an Electron app over the package.\n\nThe first version exposed command buttons and a raw arguments field.\n\nTechnically, this preserved package compatibility. From a UX perspective, it was still asking users to think like a shell parser.\n\nThe app was a GUI, but not yet a Desktop product.\n\nThe redesign goal became similar to Docker CLI and Docker Desktop:\n\nShare the engine and data model, but give each surface a complete experience.\n\nThe easiest way to build the GUI would have been to give Desktop its own recorder and database:\n\n``` php\nCLI      -> Markdown\nDesktop  -> SQLite or custom JSON\n```\n\nThat would immediately create two versions of ContextVault.\n\nSessions, migrations, bug fixes, and indexing behavior would eventually drift. Existing CLI users would need imports or conversions before using Desktop.\n\nInstead, the architecture keeps one source of truth:\n\n```\nBrowser exports       CLI / agents       Desktop recorder\n       \\                   |                    /\n        \\                  |                   /\n                 .contextvault Markdown\n                           |\n                    local Context Engine\n                           |\n       History · Search · Retrieve · Prepare · Memory\n```\n\nDesktop is a GUI over the same engine and files—not a second implementation.\n\nWhen the user clicks **Start recording**, the Electron main process launches the bundled package recorder with the selected project as its working directory.\n\nThe renderer only receives a narrow preload API:\n\n```\nstartRecorder({ title, source })\nsendRecorderCommand(recorderId, command)\nfinishRecorder(recorderId)\ncancelRecorder(recorderId)\n```\n\nAn entry created in the GUI is sent to the real recorder:\n\n```\nawait window.contextVault.sendRecorderCommand(\n  recorderId,\n  `/decision ${content}`,\n)\n```\n\nThe package writes the final session Markdown.\n\nThis means a session created in Desktop is visible to:\n\n```\ncontextvault list\ncontextvault show <session-id>\n```\n\nNo conversion step is required.\n\nCompatibility also needs to work in the opposite direction.\n\nThe main process watches the active project's session directory:\n\n``` js\nvaultWatcher = watch(sessionsPath, () => {\n  if (vaultRefreshTimer) clearTimeout(vaultRefreshTimer)\n\n  vaultRefreshTimer = setTimeout(async () => {\n    const engine = await getEngine()\n    engine.buildContextIndex(projectPath)\n    mainWindow?.webContents.send('contextvault:vault-changed')\n  }, 250)\n})\n```\n\nThe delay debounces bursts of file events. After rebuilding the index, open renderer views refresh.\n\nThe UI exposes the watcher state:\n\nFor the integration test, I kept Desktop open and recorded a session from the external CLI. Without reopening the app, the session count increased from 3 to 4, the event count increased from 14 to 16, and `terminal`\n\nappeared as a detected source.\n\nThat was the moment the CLI and GUI stopped feeling like separate products.\n\nThe redesign replaced the default arguments field with screens based on user intent.\n\n| What the user wants | Desktop workflow |\n|---|---|\n| Capture project context | Recorder |\n| Browse or export a session | Sessions / Session Detail |\n| Understand recent activity | History |\n| Find previous choices | Decisions |\n| Review bugs and failed attempts | Problems |\n| Review follow-up work | Tasks |\n| Rank evidence for a question | Retrieve |\n| Find matching text | Search |\n| Build context for another agent | Prepare |\n| Connect related sessions | Link Sessions |\n| Maintain the local vault | Index, Memory, Timeline, Export |\n\nHistory, for example, supports:\n\nResults are grouped, readable, copyable, and exportable.\n\nThe raw runner still exists inside collapsed **Advanced CLI Mode** for uncommon flags. It is no longer the normal experience.\n\nThese features can sound interchangeable, so the UI and documentation separate them:\n\nFind matching events and sessions using text and filters.\n\nRank the local evidence most relevant to a task. The deterministic scorer considers exact phrases, tokens, event importance, recency, and filters.\n\nTurn retrieved evidence into a portable Markdown context package for the next model or agent.\n\nContextVault does not currently pretend to answer a project question using an AI model. It retrieves inspectable evidence and lets the user decide where to send it next.\n\nContextVault Desktop automatically notices compatible sessions written into the watched vault.\n\nIt does **not** silently intercept every unrelated Codex, Claude Code, Cursor, VS Code, terminal, screen, clipboard, or microphone process.\n\nAn external tool currently appears automatically only if it:\n\n`.contextvault`\n\n.Direct agent adapters and an MCP server are future integrations.\n\nThis boundary is intentional. Local-first software should not hide its capture behavior behind vague marketing language.\n\nThe release was checked across the entire compatibility story:\n\n```\nPackage and extension tests          63 passed\nBrowser extension production build  passed\nDesktop renderer type-check          passed\nDesktop production build            passed\nWindows installer packaging         passed\nGitHub Actions Windows build         passed\nGitHub Actions Linux build           passed\nCLI -> open Desktop live refresh     passed\n```\n\nThe Desktop release became v1.8.0. The npm package remained v1.3.0 because the Desktop-only changes did not modify the published package code.\n\nThe next phase is Git-like collaboration for context:\n\nThe difficult part is not remote storage. It is preserving provenance, reviewability, and user ownership while several humans and agents modify shared project memory.\n\n```\nnpx @aliabdm/contextvault init\ncontextvault record\n```\n\n", "url": "https://wpnews.pro/news/the-code-was-in-git-the-ai-conversations-to-implement-it-was-gone", "canonical_source": "https://dev.to/maliano63717738/the-code-was-in-git-the-ai-conversations-to-implement-itwas-gone-142m", "published_at": "2026-07-04 03:38:11+00:00", "updated_at": "2026-07-04 03:48:35.916326+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models", "ai-agents"], "entities": ["ContextVault", "ChatGPT", "Codex", "Claude Code", "Cursor", "Electron"], "alternates": {"html": "https://wpnews.pro/news/the-code-was-in-git-the-ai-conversations-to-implement-it-was-gone", "markdown": "https://wpnews.pro/news/the-code-was-in-git-the-ai-conversations-to-implement-it-was-gone.md", "text": "https://wpnews.pro/news/the-code-was-in-git-the-ai-conversations-to-implement-it-was-gone.txt", "jsonld": "https://wpnews.pro/news/the-code-was-in-git-the-ai-conversations-to-implement-it-was-gone.jsonld"}}