Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Working memory for Claude Code - persistent context and multi-instance coordination
| Date | Stars |
|---|---|
| 2026-07-31 | 452 |
| 2026-08-06 | 451 |
Today
-1 stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Claude Cognitive
> Working memory for Claude Code — persistent context and multi-instance coordination
[](https://opensource.org/licenses/MIT)
[]()
---
## The Problem
Claude Code is powerful but stateless. Every new instance:
- **Rediscovers** your codebase from scratch
- **Hallucinates** integrations that don't exist
- **Repeats** debugging you already tried
- **Burns tokens** re-reading unchanged files
With large codebases (50k+ lines), this becomes painful fast.
---
## The Solution
**Claude Cognitive** gives Claude Code working memory through two complementary systems:
### 1. Context Router
**Attention-based file injection** with cognitive dynamics:
- **HOT** (>0.8): Full file injection - active development
- **WARM** (0.25-0.8): Headers only - background awareness
- **COLD** (<0.25): Evicted from context
Files **decay** when not mentioned, **activate** on keywords, and **co-activate** with related files.
### 2. Pool Coordinator
**Multi-instance state sharing** for long-running sessions:
- **Automatic mode**: Detects completions/blockers from conversation (every 5min)
- **Manual mode**: Explicit `pool` blocks for critical coordination
- Works with persistent sessions (days/weeks), not just short bursts
---
## Results
**Token Savings:**
- Cold start: **79%** (120K → 25K chars)
- Warm context: **70%** (80K → 24K chars)
- Focused work: **75%** (60K → 15K chars)
**Average: 64-95% depending on codebase size and work pattern.**
**Developer Experience:**
- ✅ New instances productive in **first message**
- ✅ Zero hallucinated imports/integrations
- ✅ No duplicate work across 8+ concurrent instances
- ✅ Persistent memory across days-long sessions
**Validated on:**
- 1+ million line production codebase (3,200+ Python modules)
- 4-node distributed architecture
- 8 concurrent Claude Code instances
- Multi-day persistent sessions
---
## Quick Start
### 1. Install Scripts
```bash
# Clone to your home directory
cd ~
git clone https://github.com/GMaN1911/claude-cognitive.git .claude-cognitive
# Copy scripts
cp -r .claude-cognitive/scripts ~/.claude/scripts/
# Set up hooks (adds to existing config)
cat .claude-cognitive/hooks-config.json >> ~/.claude/settings.json
```
> **Note:** The repo contains a `.claude-dev/` directory for development/dogfooding purposes only. **Do not** copy this to your projects—it's not part of the user-facing installation. Use your own project-local `.claude/` directory instead (see step 2).
### 2. Initialize Your Project
```bash
cd /path/to/your/project
# Create .claude directory
mkdir -p .claude/{systems,modules,integrations,pool}
# Copy templates
cp -r ~/.claude-cognitive/templates/* .claude/
# Edit .claude/CLAUDE.md with your project info
# Edit .claude/systems/*.md to describe your architecture
```
### 3. Set Instance ID
```bash
# Add to ~/.bashrc for persistence:
export CLAUDE_INSTANCE=A
# Or per-terminal:
export CLAUDE_INSTANCE=B
```
### 4. Verify It's Working
```bash
# Start Claude Code
claude
# First message - check for context injection:
# Should see: "ATTENTION STATE [Turn 1]" with HOT/WARM/COLD counts
# Query pool activity:
python3 ~/.claude/scripts/pool-query.py --since 1h
```
### 5. Create Keywords Config (Required)
Create `.claude/keywords.json` in your project root:
```bash
cp ~/.claude-cognitive/templates/keywords.json.example .claude/keywords.json
```
Edit to match your project's documentation files and relevant keywords.
**Full setup guide:** [SETUP.md](./SETUP.md)
**Customization guide:** [CUSTOMIZATION.md](./CUSTOMIZATION.md)
---
## Project Configuration
Create `.claude/keywords.json` in your project root to define project-specific keywords:
```json
{
"keywords": {
"path/to/doc.md": ["keyword1", "keyword2", "phrase to match"]
},
"co_activation": {
"path/to/doc.md": ["related/doc.md"]
},
Excerpt of 13,801 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:edea09b7fec7da0f, topic:developer-tools