| .github/workflows | ||
| app | ||
| cli | ||
| docs | ||
| frontend | ||
| mcp_server | ||
| scripts | ||
| templates | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| AUTH_SETUP.md | ||
| claude-os-config.json | ||
| claude-os-state.json | ||
| claude-os-triggers.json | ||
| CLAUDE.md | ||
| CLAUDE_OS_DEVELOPER_GUIDE.md | ||
| demo_hybrid_indexing.py | ||
| entrypoint.sh | ||
| HOOK_SETUP_QUICK_START.md | ||
| HYBRID_INDEXING_COMPLETE.md | ||
| INITIALIZE_PROJECT_HOOKS_FIX.md | ||
| install.sh | ||
| PISTN_TEST_RESULTS.md | ||
| PROJECT_SETUP_AND_COMMANDS.md | ||
| pytest.ini | ||
| README.md | ||
| README_TESTING.md | ||
| requirements.txt | ||
| restart_services.sh | ||
| run_tests.sh | ||
| setup.sh | ||
| setup_native.sh | ||
| SHARING_GUIDE.md | ||
| start_all_services.sh | ||
| start_mcp_server.sh | ||
| start_redis_workers.sh | ||
| stop_all_services.sh | ||
| TEST_COVERAGE.md | ||
| test_hybrid_indexing.py | ||
| test_real_time_learning.py | ||
| TEST_RESULTS.md | ||
| TESTING_STATUS.md | ||
| WHAT_IS_CLAUDE_OS.md | ||
| WHAT_IS_CLAUDE_OS.pdf | ||
Claude OS
AI Memory & Knowledge Base System for Claude Code
Share with your team • Initialize projects in seconds • Never lose context again
🚀 What is Claude OS?
Claude OS is Claude Code's personal memory system - making AI the best coding assistant in the universe by remembering everything across sessions.
The Problem
You work with Claude Code on a feature, close the terminal, come back tomorrow... and Claude forgot everything. You explain the same architecture. You reference the same files. You repeat yourself constantly.
The Solution
Claude OS gives Claude persistent memory:
- 📝 Remembers decisions across all sessions
- 🔍 Searches past work automatically at session start
- 📚 Indexes your docs and makes them searchable
- 🧠 Learns patterns that improve over time
- 🤝 Shares with your team - one install, unlimited projects
Key Features
✅ Lightning-Fast Indexing - NEW! Tree-sitter hybrid indexing: 10,000 files in 30 seconds (vs 3-5 hours)
✅ One-Command Project Init - /claude-os-init and you're done
✅ Automatic Context Loading - Starts every session with relevant memories
✅ Session Management - Track work, save progress, resume later
✅ Documentation Ingestion - Auto-indexes your docs during setup
✅ Agent-OS Integration - Optional spec-driven development with 8 specialized agents
✅ Flexible AI - Choose local Ollama (free) or OpenAI API (paid)
✅ Team Sharing - ./install.sh for coworkers, works instantly
✅ 100% Local - Never leaves your machine, fully private
✅ Template System - Commands and skills shared via symlinks
⚡ NEW: Hybrid Indexing System
Claude OS v2.0 introduces lightning-fast tree-sitter based indexing!
The Problem with Traditional Indexing
Previous versions embedded EVERY file, which was painfully slow for large codebases:
- Pistn project (10,000 Ruby files): 3-5 hours to index
- Must complete before Claude can start working
- High resource usage, blocks productive coding
The Solution: Hybrid Two-Phase Indexing
Inspired by Aider's approach, Claude OS now uses:
Phase 1: Structural Index (30 seconds)
- ⚡ Parse files with tree-sitter (no LLM calls!)
- 📊 Extract symbols only (classes, functions, signatures)
- 🔗 Build dependency graph
- 🏆 PageRank importance scoring
- ✅ Ready to code immediately!
Phase 2: Semantic Index (optional, background)
- 🎯 Selective embedding (top 20% most important files)
- 📚 Full embedding for documentation
- 🔍 Deep semantic search when needed
- ⏰ Runs in background while you code
Performance Comparison
| Feature | Before | After (Hybrid) |
|---|---|---|
| Pistn (10k files) | 3-5 hours | 30 seconds + 20 min optional |
| Files embedded | 100,000+ chunks | ~20,000 chunks (80% reduction) |
| Start coding | After full index | Immediately! |
| Resource usage | High Ollama load | Minimal CPU/memory |
| Query speed | Semantic search | Instant structural + semantic |
📖 Read the full design: docs/HYBRID_INDEXING_DESIGN.md
⚡ Quick Start for Coworkers
Your coworker shared Claude OS with you? Here's the 3-minute setup:
Step 1: Clone and Install
# Clone the repository
git clone https://github.com/your-team/claude-os.git
cd claude-os
# Run the installer (handles everything)
./install.sh
The installer will:
- ✅ Set up Python environment
- ✅ Install all dependencies
- ✅ Configure MCP server
- ✅ Symlink commands and skills to
~/.claude/ - ✅ Optional: Install Agent-OS (8 agents by Builder Methods)
- ✅ Ask about AI provider (Ollama or OpenAI)
- ✅ Create start script
Step 2: Start Claude OS
./start.sh
This starts the MCP server at http://localhost:8051
Step 3: Initialize Your First Project
cd /path/to/your/project
In Claude Code, run:
/claude-os-init
Answer the questions (project name, tech stack, docs path, etc.) and you're done!
What you get:
- ✅ 4 knowledge bases created (memories, profile, index, docs)
- ✅ Documentation auto-indexed
- ✅ Codebase analyzed
- ✅ CLAUDE.md file with all context
- ✅ Ready to code with AI memory!
🎯 For First-Time Setup (Original Creator)
Prerequisites
Required:
- Python 3.11+ (
python3 --version) - Git (
git --version)
Optional:
- Node.js 16+ (for React UI)
Installation
# 1. Clone the repository
git clone https://github.com/brobertsaz/claude-os.git
cd claude-os
# 2. Run the setup script
./setup.sh
# 3. Start all services
./start_all_services.sh
The setup script automatically installs:
- ✅ Ollama (if not present) + LLM models
- ✅ Redis (if not present) for caching/queues
- ✅ Python virtual environment
- ✅ All Python dependencies
- ✅ SQLite database
- ✅ Frontend dependencies (if Node.js present)
Visit http://localhost:5173 to use the web UI.
⚠️ IMPORTANT: Consolidate Your Files (Required for Team Sharing)
If you plan to share Claude OS with your team, you MUST run the consolidation script after setup:
./cli/claude-os-consolidate.sh
What this does:
- Moves all commands from
~/.claude/commands/totemplates/commands/ - Moves all skills from
~/.claude/skills/totemplates/skills/ - Creates symlinks so your local environment still works
- Enables team members to install Claude OS with
./install.sh
Without consolidation: Your coworkers' installations will be broken (symlinks will point to empty directories).
Then commit to git:
git add templates/ cli/ install.sh SHARING_GUIDE.md
git commit -m "Add packaging system for sharing"
git push
Now your team can clone and use ./install.sh!
🎨 The /claude-os-init Command
Initialize any project with Claude OS in under 2 minutes:
What It Does
cd /your/project
In Claude Code:
/claude-os-init
The command will:
-
Ask Questions Interactively:
- Project name (auto-detects from folder)
- Tech stack (Ruby on Rails, Python, Node.js, etc.)
- Database (PostgreSQL, MySQL, etc.)
- Development environment (Docker, Local, etc.)
- Brief description
- Documentation directory to ingest (optional)
-
Create Project in Claude OS:
- Calls API to create project
- Creates 4 knowledge bases automatically:
{project}-project_memories- Claude's memory{project}-project_profile- Architecture & standards{project}-project_index- Codebase index{project}-knowledge_docs- Your documentation
-
Set Up Project Structure:
your-project/ ├── CLAUDE.md # Auto-loaded every session! ├── .claude/ # Commands, skills, agents │ ├── ARCHITECTURE.md │ ├── CODING_STANDARDS.md │ └── DEVELOPMENT_PRACTICES.md └── .claude-os/ # Config and state (git-ignored) ├── config.json └── hooks.json -
Ingest Documentation:
- Scans your docs directory
- Uploads all files to
{project}-knowledge_docs - Creates vector embeddings for search
-
Analyze Codebase:
- Runs
initialize-projectskill - Generates coding standards
- Documents architecture
- Indexes key files
- Runs
-
Ready to Code:
- Claude now knows your project
- Memory persists across sessions
- Context auto-loads on session start
🧠 How Claude OS Works
Session Workflow
Every Claude Code session automatically:
-
Checks for Active Session
- Reads
claude-os-state.json - Prompts: Continue working? Start something new?
- Reads
-
Loads Context
- Searches
{project}-project_memoriesfor recent work - Loads relevant patterns and decisions
- Shows what it remembers
- Searches
-
Works With Memory
- Saves insights with
/claude-os-remember - Searches memories with
/claude-os-search - References past decisions automatically
- Saves insights with
-
Ends Session
- Saves session summary
- Updates memories
- Tracks what was accomplished
Available Commands
All these work in any initialized project:
/claude-os-init- Initialize new project/claude-os-search [query]- Search memories & docs/claude-os-remember [content]- Quick save to memories/claude-os-save [title]- Full-featured save with KB selection/claude-os-list- List all knowledge bases/claude-os-session [action]- Manage development sessions/claude-os-triggers- Manage trigger phrases
Available Skills
initialize-project- Analyze codebase and generate standardsremember-this- Auto-save when you say "remember this:"memory- Simple memory management
🤖 Agent-OS: Spec-Driven Development (Optional)
Created by Builder Methods (CasJam Media LLC) MIT Licensed • Optional Integration with Claude OS
Agent-OS adds structured workflows for planning and implementing features using 8 specialized agents.
Claude OS optionally integrates with Agent-OS during installation. Agent-OS is a separate open-source project created by Builder Methods, and we're grateful for their work in creating such powerful spec-driven development tools.
When to Use Agent-OS
Enable Agent-OS during /claude-os-init if you want:
- Structured feature planning with iterative requirements gathering
- Detailed specifications before coding
- Task breakdowns with clear implementation steps
- Verification workflows to ensure completeness
The 8 Agents
Specification Workflow:
spec-initializer- Initialize new spec directoriesspec-shaper- Gather requirements through 1-3 questions at a timespec-writer- Create detailed technical specificationstasks-list-creator- Break specs into actionable tasks
Implementation Workflow:
implementer- Implement features following task listimplementation-verifier- Verify implementation completenessspec-verifier- Verify specs and tasks consistencyproduct-planner- Create product documentation
Agent-OS Commands
Available when enabled:
/new-spec- Initialize a new feature specification/create-spec- Full specification workflow (gather requirements → create spec → generate tasks)/plan-product- Create product mission, roadmap, and tech stack docs/implement-spec- Implement a specification following its tasks
How It Works
1. User: "/new-spec user-authentication"
→ Agent creates spec directory structure
2. User: "/create-spec"
→ spec-shaper asks 1-3 questions at a time
→ Gathers requirements iteratively
→ Identifies reusable code
→ Collects visual assets
3. Agent: spec-writer creates detailed specification
→ tasks-list-creator generates actionable tasks
4. User: "/implement-spec user-authentication"
→ implementer follows tasks step-by-step
→ implementation-verifier checks completeness
5. Result: Fully specified, implemented, and verified feature!
Agent-OS Project Structure
When enabled, your project gets:
your-project/
├── agent-os/
│ ├── config.yml # Agent-OS configuration
│ ├── product/ # Product documentation
│ │ ├── mission.md # Product mission
│ │ ├── roadmap.md # Feature roadmap
│ │ └── tech-stack.md # Technology stack
│ ├── specs/ # Feature specifications
│ │ └── YYYY-MM-DD-feature-name/
│ │ ├── planning/
│ │ │ ├── requirements.md
│ │ │ └── visuals/
│ │ ├── spec.md
│ │ └── tasks.md
│ └── standards/ # Coding standards (as skills)
└── .claude/agents/agent-os/ # 8 agents (symlinked)
AI Provider Options
Agent-OS requires AI for advanced features:
Option 1: Ollama (Local, Free)
- Requires 8GB+ RAM
- Fully private, no data leaves your machine
- Install:
https://ollama.ai - Then:
ollama pull llama2
Option 2: OpenAI API (Cloud, Paid)
- Works on any machine
- ~$0.02 per request
- Requires API key (set during
./install.sh)
The installer will ask which you prefer!
Integration with Claude OS
Agent-OS agents deeply integrate with Claude OS:
- Search memories before creating specs (avoid reinventing)
- Save decisions to project_memories during planning
- Reference patterns from previous work
- Build knowledge that improves over time
This is the complete AI development system!
🏗️ Architecture
┌─────────────────────────────────────────────────┐
│ Claude Code CLI │
│ (with Claude OS integration) │
└───────────────────┬─────────────────────────────┘
│ MCP HTTP
┌───────────────────▼─────────────────────────────┐
│ MCP Server (Port 8051) │
│ FastAPI Backend │
└───────────────────┬─────────────────────────────┘
│
┌───────────┴────────────┐
│ │
┌───────▼────────────┐ ┌────────▼──────────┐
│ RAG Engine │ │ React UI │
│ (llama-index) │ │ (Port 5173) │
│ • Vector Search │ │ • Project Mgmt │
│ • Hybrid Search │ │ • KB Browser │
│ • Reranking │ │ • Doc Upload │
└───────┬────────────┘ └───────────────────┘
│
┌───────▼────────────────────────────────────────┐
│ SQLite + sqlite-vec (Local Database) │
│ • projects │
│ • knowledge_bases │
│ • documents (with embeddings) │
│ • Single-file database │
└────────────────────────────────────────────────┘
│
└─────────────────────┐
│
┌─────────▼──────┐
│ Ollama │
│ (Port 11434) │
│ • llama3.1 │
│ • Embeddings │
└────────────────┘
Template System
claude-os/
├── templates/ # Shared with all projects
│ ├── commands/ # Slash commands (symlinked to ~/.claude/)
│ │ ├── claude-os-init.md
│ │ ├── claude-os-search.md
│ │ └── ...
│ ├── skills/ # Skills (symlinked to ~/.claude/)
│ │ ├── initialize-project/
│ │ ├── remember-this/
│ │ └── memory/
│ └── project-files/ # Files created during /claude-os-init
│ ├── CLAUDE.md.template
│ └── .claude-os/
│ ├── config.json.template
│ └── hooks.json.template
├── cli/ # CLI tools
│ └── claude-os-consolidate.sh
├── install.sh # One-command setup for coworkers
└── start.sh # Start services
Benefits:
- ✅ Update once, all projects benefit
- ✅ Symlinks mean instant updates
- ✅ Easy to share with team
- ✅ Consistent across projects
📚 Managing Knowledge Bases
Via Web UI
- Visit http://localhost:5173
- Create Knowledge Base:
- Click "Create Knowledge Base"
- Choose type (Generic, Code, Documentation, Agent_OS)
- Upload Documents:
- Select KB from dropdown
- Drag & drop files or click upload
- Supports .md, .txt, .pdf, .py, .js, .ts, .json, .yaml
- Query:
- Type question in search box
- View answer with source citations
Via CLI
# Search your project memories
/claude-os-search "how did we implement authentication?"
# Save a quick insight
/claude-os-remember "Fixed bug in user controller by adding validation"
# Full-featured save
/claude-os-save "Authentication Pattern" my-app-project_profile Architecture
Auto-Created KBs
When you run /claude-os-init, you get 4 knowledge bases:
-
{project}-project_memories- Claude's memory for decisions, patterns, solutions
- Automatically saved during sessions
- Searched at session start
-
{project}-project_profile- Architecture, coding standards, practices
- Generated by
initialize-projectskill - Updated as project evolves
-
{project}-project_index- Automated codebase index
- Tracks file structure
- Updates on git commits (with hooks)
-
{project}-knowledge_docs- Your documentation
- Auto-ingested during init
- Add more via UI or CLI
🤝 Team Collaboration
Sharing Claude OS
Step 1: Package for sharing
cd /path/to/claude-os
./cli/claude-os-consolidate.sh # Move files to templates/
git add templates/ cli/ install.sh
git commit -m "Ready for team sharing"
git push
Step 2: Share repo URL with team
Send teammates:
- Repo URL
- Link to
SHARING_GUIDE.mdin the repo
Step 3: They install (3 minutes)
git clone <your-repo-url>
cd claude-os
./install.sh
./start.sh
Done! They can now use /claude-os-init on any project.
Per-Project Setup
Each team member:
- Runs
/claude-os-initin their project - Gets their own knowledge bases
- CLAUDE.md is committed to git (shared)
- .claude-os/ state is git-ignored (personal)
Result: Team shares context via CLAUDE.md, but each person has their own AI memory.
⚙️ Configuration
Environment Variables
# SQLite Database
SQLITE_DB_PATH=data/claude-os.db # Default: data/claude-os.db
# Ollama
OLLAMA_HOST=http://localhost:11434 # Default: localhost:11434
OLLAMA_MODEL=llama3.1:latest # Default: llama3.1:latest
# MCP Server
MCP_SERVER_HOST=0.0.0.0 # Default: 0.0.0.0
MCP_SERVER_PORT=8051 # Default: 8051
Project Configuration
Each project has .claude-os/config.json:
{
"project_name": "my-app",
"claude_os_url": "http://localhost:8051",
"knowledge_bases": {
"memories": "my-app-project_memories",
"profile": "my-app-project_profile",
"index": "my-app-project_index",
"docs": "my-app-knowledge_docs"
},
"docs_settings": {
"watch_paths": ["./docs", "./knowledge_docs"],
"auto_ingest_patterns": ["*.md", "*.txt", "*.pdf"]
},
"tech_stack": "Ruby on Rails",
"database": "MySQL"
}
📊 Performance
Native Ollama Setup:
- Response time: ~40 seconds per query
- GPU acceleration: Full Metal GPU on Apple Silicon
- Memory usage: 8-10GB (models + context)
- CPU usage: 12 cores (M4 Pro)
Why it's fast:
- Direct GPU acceleration (no virtualization)
- Efficient vector search in SQLite
- Optimized RAG engine with caching
- Single-file database with minimal overhead
🛠️ Scripts Guide
Installation & Setup
./install.sh - Team Member Setup ⭐
./install.sh
For coworkers joining the team:
- ✅ Creates
~/.claude/directories - ✅ Symlinks all commands and skills
- ✅ Sets up Python environment
- ✅ Installs dependencies
- ✅ Configures MCP server
./setup.sh - First-Time Setup
./setup.sh
For the original creator:
- ✅ Installs Ollama + Redis (if needed)
- ✅ Downloads LLM models (~5-10 GB)
- ✅ Sets up Python environment
- ✅ Creates database
./cli/claude-os-consolidate.sh - Organize Files
./cli/claude-os-consolidate.sh
One-time consolidation:
- Moves commands to
templates/ - Moves skills to
templates/ - Creates symlinks
- Prepares for git commit
Service Management
./start.sh or ./start_all_services.sh - Start Everything
./start.sh
Starts:
- 🔌 MCP Server (port 8051)
- 🎨 React Frontend (port 5173)
- 🤖 RQ Workers
- 💾 Redis
- 🧠 Ollama
./stop_all_services.sh - Stop All
./stop_all_services.sh
./restart_services.sh - Restart
./restart_services.sh
🐛 Troubleshooting
"Command not found: /claude-os-init"
Symlinks weren't created. Re-run:
cd /path/to/claude-os
./install.sh
"Connection refused to localhost:8051"
Claude OS server isn't running:
cd /path/to/claude-os
./start.sh
"Project already exists"
Project name is taken. Choose a different name or delete via UI at http://localhost:5173
Port Already in Use
# Find process on port 8051
lsof -i :8051
# Kill if needed
kill -9 <PID>
Ollama Issues
# Check if running
ollama list
# Start manually
ollama serve
# Check for model
ollama list | grep llama3.1
📁 Project Structure
claude-os/
├── templates/ # NEW: Shared templates system
│ ├── commands/ # Slash commands
│ ├── skills/ # Skills
│ └── project-files/ # Files created during init
├── cli/ # NEW: CLI tools
│ └── claude-os-consolidate.sh
├── app/ # Backend application
│ ├── core/ # Core modules
│ │ ├── sqlite_manager.py
│ │ ├── rag_engine.py
│ │ └── ...
│ └── db/ # Database schemas
├── frontend/ # React UI (Vite)
│ ├── src/
│ └── public/
│ └── assets/
│ └── claude-os-hero.png
├── mcp_server/ # MCP Server (HTTP)
│ └── server.py # FastAPI + MCP endpoints
├── data/ # SQLite database
│ └── claude-os.db
├── logs/ # Service logs
├── install.sh # NEW: Coworker setup
├── start.sh # NEW: Start services
├── SHARING_GUIDE.md # NEW: Team sharing docs
└── README.md # This file
📖 Additional Documentation
Getting Started
- SHARING_GUIDE.md - 🤝 How to share with your team
- templates/README.md - 📂 Template system documentation
Core Features
- docs/SELF_LEARNING_SYSTEM.md - 🧠 How Claude learns automatically
- docs/REAL_TIME_LEARNING_GUIDE.md - Real-time learning usage
- docs/MEMORY_MCP_GUIDE.md - Persistent memory guide
Technical Documentation
- docs/API_REFERENCE.md - 🔌 Complete API Reference (all endpoints, examples, authentication)
- docs/HYBRID_INDEXING_DESIGN.md - ⚡ Hybrid indexing architecture
- README_NATIVE_SETUP.md - Detailed native setup
- NATIVE_VS_DOCKER_DECISION.md - Why native Ollama
- PERFORMANCE_TEST_RESULTS.md - Benchmark results
🤝 Contributing
This is a team development tool. Feel free to:
- Modify for your specific needs
- Add new commands and skills
- Optimize RAG strategies
- Contribute improvements back
🙏 Acknowledgments
Agent-OS Integration
Claude OS optionally integrates with Agent-OS by Builder Methods (CasJam Media LLC).
- Project: Agent-OS - Spec-driven development workflow system
- Author: Builder Methods (CasJam Media LLC)
- License: MIT
- Repository: https://github.com/builder-methods/agent-os
Agent-OS provides 8 specialized agents for structured feature planning and implementation. We're grateful to Builder Methods for creating such powerful tools and for licensing them under MIT, making this integration possible.
If you find Agent-OS valuable, consider:
- ⭐ Starring their repository
- 📣 Sharing it with other developers
- 🤝 Contributing to their project
📄 License
MIT License - Use it freely!
Note: This project (Claude OS) is MIT licensed. Agent-OS, when installed, is a separate project also MIT licensed by Builder Methods (CasJam Media LLC). See the Agent-OS repository for their specific license terms.
🎯 Next Steps
For Original Creator
- Run
./setup.sh(first time) - Run
./cli/claude-os-consolidate.sh(organize files) - Commit templates to git
- Share repo with team
For Team Members
- Clone the repo
- Run
./install.sh - Run
./start.sh - Use
/claude-os-initin your projects
For Everyone
- Use
/claude-os-searchto find past work - Use
/claude-os-rememberto save insights - Use
/claude-os-sessionto track work - Enjoy never losing context again!
Claude Code + Claude OS = Invincible! 🚀
Built by AI coders, for AI coders