StackMemory is a lossless, project-scoped memory runtime that changes how AI tools maintain context. Key architectural principles:
- Frame-based memory: Call stack metaphor with up to 10,000 frames (not linear chat logs)
- Two-tier storage: Local SQLite (30-day retention) + infinite remote storage (S3/TimeSeries DB)
- LLM-driven retrieval: Context selection using compressed summaries to find the right frame depth
- Hybrid digests: 60% deterministic extraction, 40% AI-generated summaries created during idle time
- Configurable scoring: Tool importance scores (search: 0.95, grep: 0.15) with customizable weight profiles
- Team collaboration: Dual stack architecture supporting individual and shared frames with handoff
- Natural language: "provide context from the last day", "show Alice's auth work"
- Structured queries: TypeScript interfaces with time/content/frame/people filters
- Hybrid syntax: Command-line style, inline modifiers, template patterns
- Smart shortcuts: today, yesterday, bugs, features, critical, my work
- Retrieval latency: p50 < 50ms, p99 < 500ms
- Max stack depth: 10,000 frames
- Storage: 2GB local, infinite remote
- Incremental GC: 100 frames/cycle to avoid UI freezes
- Ensure you're logged into npm:
npm login - Verify login status:
npm whoami - If token expired, create new:
npm token create
-
Test in Sandbox First
# Create sandbox environment ./scripts/create-sandbox.sh # Test in sandbox /tmp/stackmemory-sandbox/[timestamp]/run-sandbox.sh test /tmp/stackmemory-sandbox/[timestamp]/run-sandbox.sh linear-sync /tmp/stackmemory-sandbox/[timestamp]/run-sandbox.sh mcp-server
-
Run Tests & Lint
npm test npm run lint -
Update Version
- Update version in package.json
- Create release notes in RELEASE_NOTES_v[version].md
-
Commit Changes
git add . git commit -m "Release v[version]: [features]"
-
Publish to NPM
npm publish # If 2FA enabled, use: npm publish --otp=[code]
npm error 401 Unauthorized
npm error Access token expired or revoked
Solution: Complete npm login process
- Run
npm login - Complete authentication in browser
- Retry publish
npm error 404 Not Found - PUT
Solution: This usually means authentication failed
- Verify package name in package.json
- Ensure you have publish permissions
- Re-authenticate with
npm login
npm error This operation requires a one-time password
Solution: Use npm publish --otp=[6-digit-code]
The sandbox environment lets you test StackMemory in isolation before publishing.
./scripts/create-sandbox.shThis creates:
- Isolated environment in
/tmp/stackmemory-sandbox/[timestamp] - Complete npm install and build
- Test project for initialization
- Helper script
run-sandbox.sh
# Check status
/tmp/stackmemory-sandbox/[timestamp]/run-sandbox.sh status
# Test MCP server
/tmp/stackmemory-sandbox/[timestamp]/run-sandbox.sh mcp-server
# Test Linear sync
export LINEAR_API_KEY="your_key"
/tmp/stackmemory-sandbox/[timestamp]/run-sandbox.sh linear-sync
# Run any CLI command
/tmp/stackmemory-sandbox/[timestamp]/run-sandbox.sh cli [command]
# Clean up
/tmp/stackmemory-sandbox/[timestamp]/run-sandbox.sh clean- Set
LINEAR_API_KEYenvironment variable - Test both API key and OAuth methods
- Verify task sync bidirectionally
- Test startup without errors
- Verify Claude Desktop config integration
- Check protocol responses
- Verify 24-hour cache mechanism
- Test version comparison logic
- Ensure non-intrusive notifications
- Check
.stackmemory/progress.jsoncreation - Verify session tracking
- Test Linear sync status updates
- Version Bump: Update package.json version
- Documentation: Create release notes
- Sandbox Test: Full test in isolated environment
- Main Repo Test: Run tests and lint
- Commit: Descriptive commit message
- Publish: npm publish with OTP if required
- Verify: Check npm registry for new version
- Tag: Create git tag for release
package.json- Version and dependenciesCHANGELOG.md- User-facing changesRELEASE_NOTES_v*.md- Detailed release information.stackmemory/progress.json- Progress trackingdocs/releases/- Historical release documentationscripts/create-sandbox.sh- Sandbox creation script
LINEAR_API_KEY- Linear API authenticationSTACKMEMORY_ENV- Environment mode (sandbox/production)STACKMEMORY_DEBUG- Enable debug logging
stackmemory init- Initialize in projectstackmemory status- Show current statusstackmemory push/pop- Manage context stack
stackmemory linear auth- OAuth authenticationstackmemory linear sync- Sync with Linearstackmemory linear auto-sync- Enable auto-sync
stackmemory mcp-server- Start MCP serverstackmemory update-check- Check for updatesstackmemory progress- View progress tracking
stackmemory --debug [command]- Run with debug outputstackmemory --version- Show version