{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreihsh23u4a43y3yj2ofbrocysn2xav34zxdfdewmr66d3nwbdhso74",
    "uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3mps6g7thp2o2"
  },
  "coverImage": {
    "$type": "blob",
    "ref": {
      "$link": "bafkreifqvxh3v3jo2crnwuzqhzg7fntyadgkkcn2lyfvux4zn46cnoquv4"
    },
    "mimeType": "image/webp",
    "size": 117288
  },
  "path": "/maliano63717738/the-code-was-in-git-the-ai-conversations-to-implement-itwas-gone-142m",
  "publishedAt": "2026-07-04T03:38:11.000Z",
  "site": "https://dev.to",
  "tags": [
    "electron",
    "node",
    "opensource",
    "ai",
    "https://github.com/aliabdm/ContextVault",
    "https://context-vault-two.vercel.app/download",
    "https://context-vault-two.vercel.app/",
    "https://www.npmjs.com/package/@aliabdm/contextvault",
    "https://context-vault-two.vercel.app/faq",
    "https://senior-mohammad-ali.vercel.app/",
    "https://www.linkedin.com/in/mohammad-ali-abdul-wahed-1533b9171/",
    "@aliabdm"
  ],
  "textContent": "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\n  * Why one approach had been chosen\n  * Which fixes had already failed\n  * What the coding agent warned me about\n  * Which tasks had been postponed\n\n\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\n##  First: what is 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\n\n    Git:          what changed in the code?\n    ContextVault: 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\n  1. **Browser Capture** — a Chrome extension that stores supported LLM conversations locally and exports Markdown or ZIP.\n  2. **Vault Terminal** — an npm CLI for recording agent work, decisions, tasks, problems, and notes inside a project.\n  3. **ContextVault Desktop** — a visual app for recording, browsing, retrieving, preparing, and exporting that project context.\n\n\n\nThere is no required account or ContextVault backend. Browser data stays in the browser. Project sessions stay in local Markdown.\n\n##  A concrete example\n\nInitialize ContextVault inside a repository:\n\n\n\n    npx @aliabdm/contextvault init\n    contextvault record\n\n\nDuring the session, preserve only the context that may matter later:\n\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\n    .contextvault/sessions/\n\n\nLater, a developer or agent can ask for evidence:\n\n\n\n    contextvault history --since 2w\n    contextvault decisions auth --source codex\n    contextvault problems auth --since 30d\n    contextvault retrieve \"authentication callback\"\n    contextvault prepare \"fix authentication callback\"\n\n\n`retrieve` ranks relevant local events. `prepare` creates 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\n##  Why build a Desktop app?\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\n\n    contextvault 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\n> Share the engine and data model, but give each surface a complete experience.\n\n##  The dangerous shortcut: implementing everything twice\n\nThe easiest way to build the GUI would have been to give Desktop its own recorder and database:\n\n\n\n    CLI      -> Markdown\n    Desktop  -> 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\n\n    Browser 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\n##  How recording works inside Electron\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\n\n    startRecorder({ title, source })\n    sendRecorderCommand(recorderId, command)\n    finishRecorder(recorderId)\n    cancelRecorder(recorderId)\n\n\nAn entry created in the GUI is sent to the real recorder:\n\n\n\n    await 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\n\n    contextvault list\n    contextvault show <session-id>\n\n\nNo conversion step is required.\n\n##  How CLI sessions appear live in Desktop\n\nCompatibility also needs to work in the opposite direction.\n\nThe main process watches the active project's session directory:\n\n\n\n    vaultWatcher = 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\n  * Watching project\n  * Last updated\n  * Events found\n  * Sources detected\n\n\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` appeared as a detected source.\n\nThat was the moment the CLI and GUI stopped feeling like separate products.\n\n##  Turning commands into actual workflows\n\nThe redesign replaced the default arguments field with screens based on user intent.\n\nWhat the user wants | Desktop workflow\n---|---\nCapture project context | Recorder\nBrowse or export a session | Sessions / Session Detail\nUnderstand recent activity | History\nFind previous choices | Decisions\nReview bugs and failed attempts | Problems\nReview follow-up work | Tasks\nRank evidence for a question | Retrieve\nFind matching text | Search\nBuild context for another agent | Prepare\nConnect related sessions | Link Sessions\nMaintain the local vault | Index, Memory, Timeline, Export\n\nHistory, for example, supports:\n\n  * Since: 24 hours, 7, 14, or 30 days, all time, or a custom date\n  * Source: Codex, Claude Code, Cursor, ChatGPT, manual, terminal, or browser\n  * Event type: decision, problem, task, note, user, or agent\n  * Maximum results\n\n\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\n##  Search, Retrieve, and Prepare are different\n\nThese features can sound interchangeable, so the UI and documentation separate them:\n\n###  Search\n\nFind matching events and sessions using text and filters.\n\n###  Retrieve\n\nRank the local evidence most relevant to a task. The deterministic scorer considers exact phrases, tokens, event importance, recency, and filters.\n\n###  Prepare\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\n##  What \"automatic\" does and does not mean\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  1. Records through the ContextVault CLI, or\n  2. Writes a compatible session file into `.contextvault`.\n\n\n\nDirect 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\n##  Verification beyond \"it builds\"\n\nThe release was checked across the entire compatibility story:\n\n\n\n    Package and extension tests          63 passed\n    Browser extension production build  passed\n    Desktop renderer type-check          passed\n    Desktop production build            passed\n    Windows installer packaging         passed\n    GitHub Actions Windows build         passed\n    GitHub Actions Linux build           passed\n    CLI -> 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\n##  Next: collaborative context repositories\n\nThe next phase is Git-like collaboration for context:\n\n  * Push a selected vault to a repository\n  * Invite collaborators\n  * Pull shared context\n  * Review diffs and history\n  * Edit locally\n  * Push reviewed changes\n  * Resolve conflicts\n\n\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##  Try ContextVault\n\n\n    npx @aliabdm/contextvault init\n    contextvault record\n\n\n  * GitHub: https://github.com/aliabdm/ContextVault\n  * Desktop: https://context-vault-two.vercel.app/download\n  * Product walkthrough: https://context-vault-two.vercel.app/\n  * npm: https://www.npmjs.com/package/@aliabdm/contextvault\n  * Technical FAQ: https://context-vault-two.vercel.app/faq\n  * Portfolio: https://senior-mohammad-ali.vercel.app/\n  * LinkedIn : https://www.linkedin.com/in/mohammad-ali-abdul-wahed-1533b9171/\n\n",
  "title": "The Code Was in Git. The AI Conversations TO Implement it,Was Gone"
}