↓ Skip to main content
  1. Posts/

Coda — Long-Term Memory for OpenCode

·272 words·2 mins·
Table of Contents

A memory layer for OpenCode AI sessions. It imports session history from Qwen Code and OpenCode, structures it into searchable JSON, and provides a React dashboard to browse everything.

How It Helps
#

Instead of the AI starting fresh every session, this preserves context across sessions, past decisions, project patterns, preferences, and command history. It auto-generates PERSONAL_CONTEXT.md which OpenCode reads at session start, and produces per-project summary files for targeted context injection.

Quick Start
#

git clone <your-repo>
npm install
npm run import   # first run exports all sessions (can be slow)
npm run dev      # start the React dashboard
  • First import — exports all ~275+ sessions from Qwen Code and OpenCode
  • Subsequent imports — incremental, only new/changed sessions

How It Works
#

Qwen Code JSONL  ──┐
OpenCode SQLite  ──┤──▶ import.js ──▶ src/data/*.json ──▶ React Dashboard
PERSONAL_CONTEXT.md ─┘                                    └──▶ AI context injection

The import script reads from your local Qwen Code data (/mnt/internal/.qwen/) and OpenCode sessions (via opencode export), normalizes them, and writes structured JSON to src/data/. It also generates PERSONAL_CONTEXT.md with an overview of your projects and recent activity.

Customize Your Profile
#

Edit your details in the “My Context” tab of the dashboard, or edit src/data/personal-context.json directly, then run npm run import to regenerate everything.

Project Structure
#

ComponentPath
Import scriptscripts/import.js
DB query helperscripts/query-sessions.py
Context editor helperscripts/edit-context.js
Session data (JSON)src/data/*.json
Project summariessrc/data/project-summaries/*.md
Dashboard UIsrc/App.jsx + src/components/*.jsx
Personal contextPERSONAL_CONTEXT.md

Important
#

All session data stays local on your machine. Personal identity information lives only in src/data/personal-context.json and PERSONAL_CONTEXT.md — both are gitignored by default so you can safely push the framework to GitHub.

Varun.log
Author
Varun.log
The creator of Stashed.in who loves to make new things.

Related


← Stashed.in

Link Map
Pages Tags