Intelligent context window management for Claude Code.
ContextOS is a Claude Code plugin that optimizes context window usage through:
ContextOS is built with a local-first, zero-telemetry architecture. We understand that your context window often contains sensitive code and data.
~/.claude/contextos/.To verify that no local environment data is included in the package, you can run:
npm pack --dry-run
This will show you the exact list of files bundled in the distribution.
# From npm (recommended)
claude plugin install contextos
# From source
git clone https://github.com/johnnyhliang/contextos
cd contextos
npm install && npm run build
claude plugin add ./contextos
Five engines working together:
1. Input Gate — Content-aware compression
2. Context Ledger — Tracks what's in the context window
3. Eviction — ARC policy + pin table + working set
4. Fault Handler — Serves cached content on demand
5. L2 Cache — SQLite with full content + compressed summaries
ContextOS uses Claude Code's hook system:
All hooks run transparently — no user intervention needed.
# Install dependencies
npm install
# Build (TypeScript + MCP server bundle)
npm run build
# Run tests
npm test
# Type-check only
npm run typecheck
# Watch mode
npm run dev
# Bump version (syncs package.json and plugin.json)
npm run bump-version
See CONTRIBUTING.md.
See CHANGELOG.md.
MIT — see LICENSE.
Matches all tools
Hooks run on every tool call, not just specific ones
Admin access level
Server config contains admin-level keywords
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Executes bash commands
Executes bash commands
Hook triggers when Bash tool is used
Hook triggers when Bash tool is used
npx claudepluginhub johnnyhliang/contextos --plugin contextosOpus 4.8-aware context optimization: silent-by-default hooks, honest NET token savings, big-file map-then-load, Context Control Center, per-task tracking, prompt coach
MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.
Persistent local memory for Claude Code. Cross-session recall with vector search, automatic archiving, zero cloud dependencies.
Persistent memory for Claude Code. Capture work across sessions and recall relevant context.
Memory compression system for Claude Code - persist context across sessions
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). Proactively activates in projects with cacheComponents: true, providing patterns for 'use cache' directive, cacheLife(), cacheTag(), cache invalidation, and parameter permutation rendering.