Autonomous Session Memory

MemCTX

Never lose context. Never repeat yourself.
Your AI pair programmer, now with perfect memory.

npm version downloads MIT Node
memctx — zsh
🧠
Session Captured
auth-flow refactor · 47 tool calls · 1h 23m
🤖
AI Summary Generated
Implemented JWT refresh token rotation, fixed edge case in middleware chain
💉
Context Injected → CLAUDE.md
Relevant history loaded for new session

The Problem

Your AI forgets.
MemCTX doesn't.

MemCTX transforms Claude Code into a context-aware development companion by automatically capturing, analyzing, and intelligently injecting your development history.

😫 Before MemCTX

Repeat context every single session
Lost conversation history forever
Manual session notes and docs
Forgotten architectural decisions
Painful context switching overhead

✨ With MemCTX

Automatic context injection on start
Fully searchable session history
AI-powered structured summaries
Decision tracking out of the box
Seamless session continuity

Features

Everything you need,
nothing you don't.

🧠

Smart Memory

Automatically captures every Claude Code session with full context and tool-use preservation.

🤖

AI Summaries

Claude analyzes each session and generates structured summaries with key insights and decisions.

📊

Beautiful Dashboard

Modern, responsive UI to browse, search, and analyze your complete development history.

🔍

Full-Text Search

Lightning-fast search across all sessions, conversations, and code snippets instantly.

📈

Live Monitoring

Real-time view of active sessions with WebSocket updates and live metrics.

🎯

Context Injection

Automatically injects relevant history into new sessions via CLAUDE.md for perfect continuity.

🏷️

Tags & Bookmarks

Organize sessions with custom tags and bookmark the moments that matter most.

📝

Session Notes

Add custom notes and annotations to any session for future reference and team sharing.

🌓

Dark / Light Theme

Beautiful adaptive themes that match your environment and preference perfectly.

Quick Start

Up and running
in 30 seconds.

Two commands. Zero configuration. You're done.

step 1 — install
# Install globally (choose one)
npm install -g memctx
pnpm add -g memctx
yarn global add memctx
step 2 — start the service
# Start the background worker
memctx start

# Open the dashboard (optional)
memctx open
optional — environment variables
# Required for AI summaries
export ANTHROPIC_API_KEY="sk-ant-..."

# Optional: Use a proxy provider
export ANTHROPIC_BASE_URL="https://your-proxy.com/v1"

# Optional: Custom port (default: 9999)
export MEMCTX_PORT=8080

# Optional: Custom database path
export MEMCTX_DB_PATH="/path/to/db.sqlite"

CLI Reference

Every command
at your fingertips.

CommandDescription
memctx installInstall hooks and start the daemon process
memctx startStart the background worker daemon
memctx stopStop the worker daemon gracefully
memctx restartRestart the worker daemon
memctx statusShow daemon status and health check
memctx openOpen the dashboard in your default browser
memctx search <query>Search sessions from the terminal
memctx exportExport all sessions as markdown files
memctx configShow current configuration
memctx uninstallRemove all hooks and stop daemon

Architecture

How it all
fits together.

A lightweight daemon hooks into Claude Code's lifecycle and handles everything automatically.

Claude Code CLI MemCTX Worker SQLite Database Anthropic AI API Dashboard React UI CLAUDE.md Context File hooks store summarize serve summary inject auto-load on next session
1

Session Start

Claude Code session begins → session-start hook fires automatically

2

Capture

MemCTX worker creates a session record in the local SQLite database

3

Observe

Every tool use is captured in real-time via the post-tool-use hook

4

End

Session ends → stop hook fires and finalizes the record

5

Summarize

Worker sends the full transcript to Claude for intelligent AI analysis

6

Store

Structured summary is stored in the database alongside the raw transcript

7

Inject

Next session auto-loads relevant context from CLAUDE.md — zero manual effort

8

Browse

View everything in the beautiful real-time dashboard at localhost:9999

Requirements

What you'll need.

🖥️ System Requirements

🟢
Node.js 18.0.0 or higher
🟢
Claude Code CLI installed
🟢
OS Linux, macOS, or Windows (WSL)

🔨 Build Tools

🐧
Linuxbuild-essential, python3
🍎
macOS — Xcode Command Line Tools
🪟
Windows — Visual Studio Build Tools
install build tools
# Ubuntu / Debian
sudo apt install build-essential python3

# macOS
xcode-select --install

# Windows — download from:
# https://visualstudio.microsoft.com/downloads/

Troubleshooting

Got an issue?
We've got answers.

Service won't start
# Check if port is already in use
lsof -i :9999

# Check logs for errors
tail -f /tmp/memctx.log

# Restart the service
memctx restart
Hooks not working
# Verify hooks are registered in settings
cat ~/.claude/settings.json | grep memctx

# Reinstall hooks from scratch
memctx uninstall
memctx install
SQLite compilation errors
# Rebuild native modules
npm rebuild better-sqlite3

# Or do a clean reinstall
npm uninstall -g memctx
npm install -g memctx
AI summaries not generating
# Check API key is set
echo $ANTHROPIC_API_KEY

# Set API key in shell
export ANTHROPIC_API_KEY="sk-ant-..."

# Or configure via the dashboard
memctx open  # → navigate to Settings

Roadmap

Where we're headed.

✅ v1.0 — Current
Session capture
AI summaries
Dashboard UI
Search & filter
Tags & bookmarks
Export functionality
🔮 v2.0 — Future
Multi-user support
Enterprise features
Advanced AI insights
Integration marketplace
Mobile app
Self-hosted option

Contributing

Open source &
community-driven.

We love contributions of all kinds — bug reports, feature ideas, or pull requests.

🐛

Report a Bug

Found something broken? Open a detailed issue so we can fix it fast.

Open Issue
💡

Request a Feature

Have a great idea? We want to hear it — vote or suggest new features.

Suggest Feature
🔧

Submit a PR

Ready to code? Read the contributing guide and dive right in.

Contributing Guide
development setup
# Clone repository
git clone https://github.com/bbhunterpk-ux/memctx.git
cd memctx

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Link locally for testing
npm link

# Verify it works
memctx install && memctx start

Community

Join the conversation.

Connect with thousands of developers who are building smarter with MemCTX.

Stars Forks Watchers

Built With

Our stack.

Special thanks to Anthropic, the Claude Code community, and all contributors.

Support

We're here to help.

License

MIT Licensed.

MIT License
Copyright (c) 2026 Fahad Aziz Qureshi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.