Skip to content

cdeust/Cortex-cowork

Repository files navigation

Cortex — Cowork Edition

Persistent memory for Claude Code in sandboxed environments

CI License: MIT Python 3.10+

SQLite storage, no PostgreSQL required. Works in Claude Cowork sandboxed environments.

Running locally with PostgreSQL? Use Cortex instead for full capabilities including the neural graph visualization.


Getting Started

claude plugin marketplace add cdeust/Cortex-cowork
claude plugin install cortex-cowork

Restart your Claude Code session, then run:

/cortex-setup-project

That's it. SQLite database created automatically, no external dependencies.


What Works

Feature Status
Remember / Recall Full support (SQLite + sqlite-vec)
Codebase seeding Full support
Session backfill Full support
Cognitive profiling Full support
Lifecycle hooks Full support (7 hooks)
Consolidation (decay, compression, CLS) Full support
Knowledge graph (entities, relationships) Full support
Causal chains, gap detection Full support
Agent team memory (transactive) Full support
Neural graph visualization Not available (requires PostgreSQL)
FlashRank reranking Not available (ONNX dependency)

How It Works

Same architecture as Cortex with SQLite replacing PostgreSQL:

  • Storage: SQLite with sqlite-vec for vector similarity search
  • Runtime: CORTEX_RUNTIME=cowork set automatically by the plugin
  • Retrieval: Intent-aware query routing, vector + FTS fusion, heat-weighted ranking
  • Memory lifecycle: Thermodynamic heat/decay, predictive coding write gate, dream cycle consolidation

Hooks

Seven hooks integrate with Claude Code's lifecycle:

Hook Event What It Does
SessionStart Session opens Injects anchors + hot memories + checkpoint
UserPromptSubmit Before response Auto-recalls relevant memories
PostToolUse After Edit/Write/Bash Auto-captures significant actions
PostToolUse After Edit/Write/Read Primes related memories (spreading activation)
SessionEnd Session closes Dream cycle (decay, compress, CLS)
Compaction Context compacts Saves/restores checkpoint
SubagentStart Agent spawned Briefs agent with prior work

Differences from Full Cortex

Cortex Cortex-cowork
Storage PostgreSQL + pgvector SQLite + sqlite-vec
Vector index HNSW (pgvector) Flat scan (sqlite-vec)
Server-side fusion PL/pgSQL stored procedures Client-side Python
Reranking FlashRank ONNX Disabled
Neural graph Full 3D visualization Not available
Environment CLI, Docker Cowork, CLI

For large memory stores (1000+ memories), the full PostgreSQL version offers significantly faster retrieval via HNSW indexing and server-side fusion.


Scientific Foundation

Same 41 paper citations as the full version. See Cortex for the complete paper index.


License

MIT

Citation

@software{cortex2026,
  title={Cortex: Persistent Memory for Claude Code},
  author={Deust, Clement},
  year={2026},
  url={https://github.com/cdeust/Cortex}
}

About

Cortex for Claude Code Cowork — SQLite storage, no PostgreSQL required

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors