[FEATURE] Export session context as transferable knowledge artifact for cross-session continuity
Problem
When working on complex multi-session projects, each new Claude Code session starts from zero context — even when prior sessions have already built deep understanding of the codebase, made architectural decisions, and identified patterns.
Current workarounds are insufficient:
| Mechanism | What it preserves | What's lost |
|-----------|------------------|-------------|
| CLAUDE.md | Static instructions | Dynamic understanding, decision rationale |
| Auto memory | Factual snippets | Reasoning chains, architectural context |
| --continue / --resume | Full conversation | Not transferable to new contexts or agents |
| Subagent prompts | What you explicitly pass | Everything you don't think to include |
Real-world example
In a single session, Claude Code:
- Ran a full-stack audit (architecture, security, AI/ML, testing) across 20+ files
- Built deep understanding of an agent system (tools, memory, prompts, orchestration)
- Made architectural decisions (agentic search patterns, document indexing strategy)
- Identified 53 findings across 6 domains
To continue this work in a new session, the user must either:
- Resume the exact session (fragile, not transferable across machines)
- Manually write summaries into CLAUDE.md/memory (lossy, tedious)
- Re-explain everything from scratch (wastes tokens and time)
Proposed Solution
context export — Export accumulated session knowledge as a structured artifact
# Export current session's accumulated context
claude context export --output .claude/contexts/agent-audit-2025.md
# Import in a new session
claude context import .claude/contexts/agent-audit-2025.md
# Or reference inline
claude --context .claude/contexts/agent-audit-2025.md
The exported artifact would include:
- Codebase map: files read, their roles, relationships discovered
- Decisions made: what was decided and why (not just what)
- Findings/analysis: structured output from research/audit work
- Domain model: entities, patterns, and conventions understood
- Open threads: unfinished work, next steps, blockers
Key differences from existing features
| Feature | context export |
|---------|-----------------|
| Memory | Facts only → Full reasoning context |
| CLAUDE.md | Static, manual → Dynamic, auto-generated |
| --resume | Same session only → Transferable artifact |
| Subagent prompt | One-shot, manual → Structured, reusable |
Use cases
- Session handoff: Morning session builds context → afternoon session continues seamlessly
- Cross-machine: Export from laptop → import on CI/server agent
- Team sharing: One developer's deep-dive exported for another to build on
- Agent SDK: Parent agent exports context → child agents import relevant slices
- Audit/review workflows: Audit findings as importable context for the fix session
Related issues
- #24798 — Inter-session communication (parallel coordination)
- #12790 — Subagent context inheritance (parent → child)
- #35238 — Session chaining (sequential continuity)
- #33727 — Project as container for sessions
This proposal complements all of the above by providing a portable, structured context artifact rather than relying on session identity or live communication channels.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗