Lossless, project-scoped memory for AI tools
StackMemory is a memory runtime for AI coding and writing tools that preserves full project context across:
- chat thread resets
- model switching
- editor restarts
- long-running repos with thousands of interactions
Instead of a linear chat log, StackMemory organizes memory as a call stack of scoped work (frames), allowing context to unwind without lossy compaction.
Memory is storage. Context is a compiled view.
Modern AI tools forget:
- why decisions were made
- which constraints still apply
- what changed earlier in the repo
- what tools already ran and why
StackMemory fixes this by:
- storing everything losslessly (events, tool calls, decisions) with infinite remote retention
- using LLM-driven retrieval to inject only the most relevant context
- organizing memory as a call stack with up to 10,000 frames instead of linear chat logs
- providing configurable importance scoring to prioritize what matters for your workflow
- enabling team collaboration through shared and individual frame stacks
| Concept | Meaning |
|---|---|
| Project | One GitHub repo (initial scope) |
| Frame | A scoped unit of work (like a function call) |
| Call Stack | Nested frames; only the active path is "hot" |
| Event | Append-only record (message, tool call, decision) |
| Digest | Structured return value when a frame closes |
| Anchor | Pinned fact (DECISION, CONSTRAINT, INTERFACE) |
Frames can span:
- multiple chat turns
- multiple tool calls
- multiple sessions
- Cloud-backed memory runtime
- Fast indexing + retrieval
- Durable storage
- Per-project pricing
- Works out-of-the-box
- SQLite-based
- Fully inspectable
- Offline / air-gapped
- Intentionally N versions behind
- No sync, no org features
OSS is for trust and inspection. Hosted is for scale, performance, and teams.
StackMemory integrates as an MCP tool and is invoked on every interaction in:
- Claude Code
- compatible editors
- future MCP-enabled tools
The editor never manages memory directly; it asks StackMemory for the context bundle.
stackmemory projects create \
--repo https://github.com/org/repoThis creates a project-scoped memory space tied to the repo.
npm install -g @stackmemoryai/stackmemory@latest# Automatic setup - configures MCP and session hooks
npm run claude:setupThis automatically:
- Creates
~/.claude/stackmemory-mcp.jsonMCP configuration - Sets up session initialization hooks
- Updates
~/.claude/config.jsonwith StackMemory integration
Manual setup alternative:
Click to expand manual setup steps
Create MCP configuration:
mkdir -p ~/.claude
cat > ~/.claude/stackmemory-mcp.json << 'EOF'
{
"mcpServers": {
"stackmemory": {
"command": "stackmemory",
"args": ["mcp-server"],
"env": { "NODE_ENV": "production" }
}
}
}
EOFUpdate Claude config:
{
"mcp": {
"configFiles": ["~/.claude/stackmemory-mcp.json"]
}
}Claude Code sessions automatically capture tool calls, maintain context across sessions, and sync with Linear when configured.
Available MCP tools in Claude Code:
| Tool | Description |
|---|---|
get_context |
Retrieve relevant context for current work |
add_decision |
Record a decision with rationale |
start_frame |
Begin a new context frame |
close_frame |
Close current frame with summary |
create_task |
Create a new task |
update_task_status |
Update task status |
get_active_tasks |
List active tasks (with filters) |
get_task_metrics |
Get task analytics |
linear_sync |
Sync with Linear |
linear_update_task |
Update Linear issue |
linear_get_tasks |
Get tasks from Linear |
git clone https://github.com/stackmemory/stackmemory
cd stackmemorycargo run --bin stackmemory-mcp
# or
npm run devThis creates:
.memory/
└── memory.db # SQLite
All project memory lives locally.
{
"tools": {
"stackmemory": {
"command": "stackmemory-mcp",
"args": ["--local"]
}
}
}Each interaction: ingests events → updates indices → retrieves relevant context → returns sized bundle.
{
"hot_stack": [
{ "frame": "Debug auth redirect", "constraints": [...] }
],
"anchors": [
{ "type": "DECISION", "text": "Use SameSite=Lax cookies" }
],
"relevant_digests": [
{ "frame": "Initial auth refactor", "summary": "..." }
],
"pointers": [
"s3://logs/auth-test-0421"
]
}- 1 project
- Up to X MB stored
- Up to Y MB retrieval egress / month
- Per-project pricing
- Higher storage + retrieval
- Team sharing
- Org controls
No seat-based pricing.
StackMemory can automatically save context when using Claude Code, so your AI assistant has access to previous context and decisions.
# Add alias
echo 'alias claude="~/Dev/stackmemory/scripts/claude-code-wrapper.sh"' >> ~/.zshrc
source ~/.zshrc
# Use: claude (saves context on exit)# 1. Shell wrapper (recommended)
claude [--auto-sync] [--sync-interval=10]
# 2. Linear auto-sync daemon
./scripts/linear-auto-sync.sh start [interval]
# 3. Background daemon
./scripts/stackmemory-daemon.sh [interval] &
# 4. Git hooks
./scripts/setup-git-hooks.shFeatures: Auto-save on exit, Linear sync, runs only in StackMemory projects, configurable sync intervals.
Guarantees: Lossless storage, project isolation, survives session/model switches, inspectable local mirror.
Non-goals: Chat UI, vector DB replacement, tool runtime, prompt framework.
# Core
stackmemory init # Initialize project
stackmemory status # Current status
stackmemory progress # Recent activity
# Tasks
stackmemory tasks list [--status pending] # List tasks
stackmemory task add "title" --priority high
stackmemory task done <id>
# Search & Logs
stackmemory search "query" [--tasks|--context]
stackmemory log [--follow] [--type task]# Context
stackmemory context show [--verbose]
stackmemory context push "name" --type task
stackmemory context add decision "text"
stackmemory context pop [--all]
# Linear Integration
stackmemory linear setup # OAuth setup
stackmemory linear sync [--direction from_linear]
stackmemory linear auto-sync --start
stackmemory linear update ENG-123 --status done
# Analytics & Server
stackmemory analytics [--view|--port 3000]
stackmemory mcp-server [--port 3001]- Hosted: Private beta
- OSS mirror: Early preview
- MCP integration: Stable
- CLI: v0.3.1 - Full task, context, and Linear management
Phase 2 (Current): Query language, LLM retrieval, hybrid digests, scoring profiles
Phase 3: Team collaboration, shared stacks, frame handoff
Phase 4: Two-tier storage, enterprise features, cost optimization
- Hosted service: Proprietary
- Open-source mirror: Apache 2.0 / MIT (TBD)
- ML System Insights - Analysis of 300+ production ML systems
- Agent Instructions - Specific guidance for AI agents working with ML systems
- Product Requirements - Detailed product specifications
- Technical Architecture - System design and database schemas
- Beads Integration - Git-native memory patterns from Beads ecosystem