Persistent memory for Claude Code. Your decisions, lessons, and project context automatically saved and restored across sessions.
/plugin marketplace add contextstream/claude-code
/plugin install contextstream
- Claude Code installed
- ContextStream API key (free tier available)
jqinstalled (brew install jq/apt install jq)
export CONTEXTSTREAM_API_KEY="your-api-key"Add to your shell profile (~/.zshrc or ~/.bashrc) to persist.
The plugin uses Claude Code hooks to automatically:
- Load context on session start - Previous decisions, lessons, active tasks
- Inject smart context per message - Relevant information based on what you're working on
- Capture your work - File changes, commands, and patterns indexed automatically
- Learn from errors - Mistakes become lessons that surface in future sessions
- Preserve sessions - Full context saved before compaction, restored after
No manual tool calls needed. Hooks run automatically.
| Hook | When | What It Does |
|---|---|---|
| session-init | Session start | Loads decisions, lessons, tasks, plans |
| smart-context | Every message | Fetches relevant context for your query |
| on-file-change | Edit/Write | Indexes changes, updates dependency graph |
| on-bash | Bash commands | Captures commands, learns from errors |
| pre-compact | Before compaction | Saves full conversation state |
Claude can run these when explicit actions are needed:
| Script | Usage | Description |
|---|---|---|
cs-search.sh |
cs-search.sh "query" |
Search memory and code |
cs-recall.sh |
cs-recall.sh "question" |
Natural language recall |
cs-capture.sh |
cs-capture.sh decision "..." |
Capture decision or lesson |
cs-todos.sh |
cs-todos.sh list |
Manage todos |
cs-plans.sh |
cs-plans.sh list |
Manage implementation plans |
Start a new Claude Code session. You should see ContextStream context injected:
<contextstream>
<session id="...">
<workspace>Your Workspace</workspace>
<project>your-project</project>
</session>
...
</contextstream>
No context appearing?
- Check API key:
echo $CONTEXTSTREAM_API_KEY - Verify plugin:
/plugin list
API errors?
- Verify key at https://console.contextstream.io/api-keys
- Check connectivity:
curl -s https://api.contextstream.io/health
Scripts not found?
- Ensure
jqis installed:jq --version
- Docs: https://contextstream.io/docs
- Issues: https://github.com/contextstream/claude-code/issues
- Discord: https://discord.gg/contextstream
MIT