Maintain Project Context Across Sessions
Saves session summaries, decisions, and pending tasks, then auto-loads a briefing at the start of the next Claude Code session.
Why it matters
Ensure seamless continuity between AI sessions by automatically saving and loading session context, including summaries, decisions, and pending tasks.
Outcomes
What it gets done
Save session context (topics, decisions, tasks, errors, files)
Load context for automatic session briefing
Search historical session data
Maintain and archive session data
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-context-agent | bash Overview
Context Agent
A context agent capturing and restoring Claude Code session state - decisions, pending tasks, modified files, discoveries - with an automatically loaded briefing at the start of each new session. Use when the user wants to save session context, get a briefing for a new session, or search prior session history.
What it does
This is a context agent for continuity between Claude Code sessions. It captures, compresses, and automatically restores context - topics discussed, decisions made, completed and pending tasks, modified files, technical discoveries, and resolved errors - saving structured summaries and loading an automatic briefing in the next session. Each session, it captures: topics discussed, technical/architectural decisions, completed tasks, pending tasks (with priority), modified files, important technical discoveries, resolved errors and their solutions, open unanswered questions, and metrics (tokens consumed, messages, tool calls).
When to use - and when NOT to
Use this skill when the user mentions saving context, starting the next session, a session briefing, a session summary, or session continuity. Do not use it for tasks unrelated to context management, when a simpler more specific tool can handle the request, or when the user needs general-purpose assistance without this specific domain expertise.
Inputs and outputs
The skill is organized under a local context-agent directory with a scripts/ folder (config, dataclass models, a Claude Code JSONL session parser, a summary generator, an ACTIVE_CONTEXT.md manager, a project registry, a compressor/archiver, an FTS5 search module, a context loader, and a context_manager.py CLI entry point), a references/ folder documenting the context file format and compression rules, and a data/ folder holding per-session markdown files, an archive, ACTIVE_CONTEXT.md (a consolidated context file capped at 150 lines), PROJECT_REGISTRY.md, and a context.db SQLite FTS5 search index. First-time setup runs context_manager.py init. context_manager.py save finds the most recent session's JSONL file, analyzes all messages/tool calls/results, generates a structured session summary, updates ACTIVE_CONTEXT.md, syncs to MEMORY.md, and indexes it for full-text search. context_manager.py load generates a briefing covering active projects, pending tasks by priority, blockers, recent decisions, conventions, and a summary of recent sessions. context_manager.py status gives a short summary of projects, critical pending items, and blockers. context_manager.py search "<term>" full-text searches (SQLite FTS5) across all sessions' topics, decisions, errors, and files. context_manager.py maintain archives old sessions, compresses the archive, resyncs MEMORY.md, and rebuilds the search index.
Integrations
The overall workflow: when a session ends, save produces a new session file plus updated ACTIVE_CONTEXT.md and MEMORY.md; when a new session begins, MEMORY.md is already in the system prompt automatically, and load produces a detailed briefing with everything needed to resume; when context grows too large, maintain archives, compresses, and optimizes it. ACTIVE_CONTEXT.md is automatically copied to the Claude Code project's MEMORY.md file, which is included in every session's system prompt - so Claude always starts already knowing current project state, pending tasks, and decisions made, with no manual action required. Detailed file format and compression/archiving rules are documented in references/context-format.md and references/compression-rules.md respectively. A related skill, context-guardian, is described as complementary for enhanced analysis.
Who it's for
Claude Code users running many sessions on the same projects who want automatic context continuity - saved decisions, pending tasks, and technical discoveries carried forward - without manually re-explaining project state at the start of every session.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.