Vicem — Diet the Context, Pass the Baton
Hit Claude Code's 5-hour quota mid-feature? Or watching Cursor / Codex slow to a crawl after 150k tokens of context rot?
Vicem compacts your active coding session by 80–90% (via deterministic code skeletonization + lossless MCP on-demand rehydration) and hands off a clean
.vicem/BATON.mdacross Claude Code, Cursor, Codex CLI, Gemini CLI, Windsurf, Antigravity IDE, and Web AI in 3 seconds — with0npm dependencies and0network calls.⭐ Tip: Click Star (top-right) to bookmark this repo for the next time your coding agent hits a 5-hour quota limit or context rot.
⚡ 10-Second Quick Start (npx — Zero Install)
1. Run the Local Web Studio GUI or Pass a Baton Immediately
# Launch the local 3-column Desktop Utility GUI (12 agents, live token/quota telemetry)
npx -y @rakkunn/vicem gui
# Or pack a compressed baton from your current repo & hand off in 1 command
npx -y @rakkunn/vicem codex
npx -y @rakkunn/vicem claude
npx -y @rakkunn/vicem cursor
# Or auto-configure global `vicem` CLI + MCP servers across all installed agents
npx -y @rakkunn/vicem setup
2. Add as an MCP Server in 1 Line (Claude Code / Codex / Cursor)
# Claude Code
claude mcp add vicem -- npx -y @rakkunn/vicem mcp
# OpenAI Codex CLI
codex mcp add vicem -- npx -y @rakkunn/vicem mcp
Add to ~/.cursor/mcp.json, ~/.codeium/windsurf/mcp_config.json, or claude_desktop_config.json:
{
"mcpServers": {
"vicem": {
"command": "npx",
"args": ["-y", "@rakkunn/vicem", "mcp"]
}
}
}
Visual Overview

$ npx -y @rakkunn/vicem codex
╭─ VICEM CONTEXT BATON & DIET RECEIPT ──────────────────────────────────╮
│ Source Session : Claude Code (sess-9f3a2c · 42 turns harvested) │
│ Context Diet : 184,200 tok ($2.76) ──► 14,800 tok ($0.22) [-91.9%] │
│ Code Skeletons : 18 files compressed (31 bodies indexed in ledger) │
│ Security Guard : 2 secrets redacted (OPENAI_KEY, AWS_ACCESS_KEY) │
│ Relay Target : OpenAI Codex CLI (interactive TTY handoff ready) │
╰───────────────────────────────────────────────────────────────────────╯
[OK] [Vicem] Baton written to .vicem/BATON.md (182ms). Launching codex...
How Lossless Code Skeletonization + MCP Rehydration Works
Instead of lossy LLM summarization that forgets exact type contracts, Vicem keeps all imports, types, and signatures 100% intact inside .vicem/BATON.md while collapsing unchanged function bodies >= 12 lines into .vicem/ledger.json:
// What the receiving agent sees in .vicem/BATON.md (-85% tokens, disk file untouched):
export interface JwtPayload { sub: string; exp: number; role: 'admin' | 'user'; }
export async function verifySessionToken(rawToken: string, secret: string): Promise<JwtPayload> { /* ... */ }
When the receiving agent actually needs to edit verifySessionToken, it calls the MCP tool vicem_rehydrate("src/auth.ts", "verifySessionToken") to pull back the exact raw lines on demand (with automatic git HEAD and live-file SHA-256 staleness detection).
Direct CLI Commands & Offline Source Setup
# 1. Launch the interactive Desktop Utility GUI
vicem gui
# 2. Compact current bloated session in-place (Context Rot Rescue)
vicem self
# 3. Pass baton to any CLI, IDE, or Web AI target
vicem codex | vicem claude | vicem gemini | vicem cursor | vicem windsurf | vicem vscode | vicem web
# 4. Return baton to previous agent & auto-unmount temporary rules
vicem back
# 5. Extract & smart-patch code blocks from a Web AI clipboard reply
vicem land
# 6. Run <50ms environment & agent storage diagnostics
vicem doctor
git clone https://github.com/RAKKUNN/vicem.git && cd vicem
./vicem.mjs setup # or double-click setup.command (macOS/Linux) / setup.bat (Windows)
For browser-only air-gapped environments without Node.js, open index.html directly in Chrome, Edge, Brave, or Safari (enforced by connect-src 'none' CSP).
Supply-Chain Verification & Minimal TCB
Verify zero third-party dependencies and cryptographic artifact integrity in one command:
# 1. Confirm zero npm dependencies
node -e "console.log(JSON.parse(fs.readFileSync('package.json')).dependencies ?? '0 dependencies')"
# 2. Verify SHA-256 checksums of all core artifacts
shasum -a 256 -c SHA256SUMS
# 3. Run the 52-test automated suite
node --test test/*.test.mjs