Problem
Developers using AI coding agents increasingly hit continuity failures: a new session, compaction, crash, or provider switch loses the useful trail of what changed, why it changed, what failed, and where to resume. Plain transcript search helps, but it does not preserve the workflow topology behind a session.
Community pain points this should address:
Re-explaining project context, logs, files, and prior decisions after context loss.
Losing failed attempts and repeating the same debugging paths.
Not knowing the last stable point before an agent broke a project.
Difficulty resuming work across Claude Code, Codex, Cursor, or other agent transcripts.
Needing external memory files because agent memory is either absent, too broad, or not evidence-linked.
Relevant public signal:
Cursor forum: context loss creates repeated correction loops and needs smarter context management, not just bigger windows: https://forum.cursor.com/t/the-vicious-circle-of-agent-context-loss/104068
Claude Code issue: context loss forces developers to re-establish architecture, decisions, and project configuration: Context persistence across sessions - major workflow disruption for complex projects anthropics/claude-code#2954
Claude Code issue: request for layered memory, topic files, semantic search, and a “what was I working on?” style command: Feature Request: Layered memory system for persistent cross-session context anthropics/claude-code#27298
Reddit: users are building local transcript/memory systems with hooks, BM25, vector search, markdown/git, and startup briefings: https://www.reddit.com/r/ClaudeAI/comments/1s0zccc/claude_code_forgets_everything_between_sessions_i/
Reddit: users distinguish stable project rules from append-only/queryable decisions, rejected approaches, and failures: https://www.reddit.com/r/ClaudeAI/comments/1tg9bmz/context_loss_between_sessions_still_the_biggest/
Anthropic context engineering guidance supports compact, high-signal, just-in-time retrieval over stuffing full history into context: https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
Proposal
Add a deterministic session topology layer and use it to power timeline, resume, and evidence-first AI features.
Start with transcript topology that is true from the source data, not an inferred LLM knowledge graph:
Normalize every session into ordered events.
Preserve message, tool call, tool result, command, file, test, error, decision, and resume-point structure.
Add typed edges between events so code-recall can answer causality questions, not only similarity questions.
Keep sqlite-vec for high-signal event bundles rather than embedding every raw message as the primary search unit.
Suggested data model
Add a session_events table along these lines:
event_id TEXT PRIMARY KEY ,
session_id TEXT NOT NULL ,
provider TEXT NOT NULL ,
ordinal INTEGER NOT NULL ,
timestamp TEXT ,
role TEXT ,
event_type TEXT NOT NULL ,
text TEXT ,
tool_name TEXT ,
command TEXT ,
file_path TEXT ,
status TEXT ,
parent_event_id TEXT
Useful event_type values:
user_message
assistant_message
tool_call
tool_result
file_action
command
test_result
error
decision
resume_point
Edges to support:
session -> event
event -> next_event
assistant_message -> tool_call
tool_call -> tool_result
tool_call -> file
tool_call -> command
tool_result -> error_signature
session -> decision
session -> resume_point
Product surface
Potential user-facing features:
Timeline tab for a selected session.
Resume brief: “what changed, what failed, what should I verify next?”
Search prefixes: decision:, error:, test:, tool:, resume:.
AI chat answers with citations to specific events/tool calls instead of only broad chunks.
Cross-provider work threads that connect Claude/Codex sessions touching the same files, commands, branches, errors, or decisions.
Phased implementation
Add schema and migrations for session_events, event FTS, and typed event edges.
Parse Claude Code and Codex transcripts into normalized timelines while preserving the existing session/chunk index.
Index high-signal event bundles into sqlite-vec: decisions, errors, tests, tool-call bundles, and resume summaries.
Add searcher support for event-aware prefixes and result evidence.
Add a TUI Timeline tab for selected result/session.
Add an AI Resume action that uses event citations and bounded evidence.
Later: consider optional semantic entity extraction for stable entities only, such as services, libraries, APIs, tickets, recurring errors, or architecture decisions.
Non-goals for the first pass
Do not embed every raw message as the main retrieval unit.
Do not build a fully LLM-inferred semantic knowledge graph before the deterministic timeline exists.
Do not add an external vector database unless sqlite-vec becomes a measured bottleneck.
Problem
Developers using AI coding agents increasingly hit continuity failures: a new session, compaction, crash, or provider switch loses the useful trail of what changed, why it changed, what failed, and where to resume. Plain transcript search helps, but it does not preserve the workflow topology behind a session.
Community pain points this should address:
Relevant public signal:
Proposal
Add a deterministic session topology layer and use it to power timeline, resume, and evidence-first AI features.
Start with transcript topology that is true from the source data, not an inferred LLM knowledge graph:
Suggested data model
Add a
session_eventstable along these lines:Useful
event_typevalues:user_messageassistant_messagetool_calltool_resultfile_actioncommandtest_resulterrordecisionresume_pointEdges to support:
session -> eventevent -> next_eventassistant_message -> tool_calltool_call -> tool_resulttool_call -> filetool_call -> commandtool_result -> error_signaturesession -> decisionsession -> resume_pointProduct surface
Potential user-facing features:
decision:,error:,test:,tool:,resume:.Phased implementation
session_events, event FTS, and typed event edges.Non-goals for the first pass