🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman
Terminal session recorder for Claude Code
Wake records your shell sessions so Claude Code can read commands, outputs, and git context from your own machine. It runs a local shell wrapper, stores session data in SQLite, and exposes it through a `wake-mcp` server that Claude Code can query.
Builders who want Claude Code to see their terminal history without copy-pasting.
You can ask Claude Code about what you just did in the terminal and get answers from recorded context.
What it does
Records terminal sessions
`wake shell` captures commands, outputs, and session context inside a PTY-backed shell.
Shell hooks for command events
`wake init zsh` or `wake init bash` installs hooks that send command start and end events to Wake.
Claude Code MCP server
`wake-mcp` exposes session status, recent commands, full outputs, search, dumps, and annotations to Claude Code.
Tiered retrieval
`wake_list_commands` shows metadata first, and `wake_get_output` fetches full output only when needed.
Local LLM summaries
A bundled Qwen3-0.6B model summarizes large command outputs locally and adds short summaries to history.
Retention and pruning
`wake prune` removes old sessions, with config and flags for age limits and dry runs.
How to get it
- 1Run
curl -sSf https://raw.githubusercontent.com/joemckenney/wake/main/install.sh | sh
- 2Add to ~/.zshrc or ~/.bashrc
eval "$(wake init zsh)" # or: wake init bash
- 3Add the MCP server to Claude Code
claude mcp add --transport stdio --scope user wake-mcp -- wake-mcp
- 4Run
$ wake shell $ kubectl logs deploy/api-server | tail -100 # wall of errors $ kubectl describe pod api-server-7f8b9 # more stuff you don't have time to read
- 5Or use environment variables (take precedence over config file)
export WAKE_RETENTION_DAYS=14 export WAKE_MAX_OUTPUT_MB=10
- 6The default build and pre-built binaries use CPU inference, which is fast enough for the…
cargo build --release --features cuda # NVIDIA (requires CUDA toolkit) cargo build --release --features metal # Apple Silicon
README
wake
The trail you leave behind.
Wake records your terminal sessions—commands, outputs, git context—so Claude Code can see what you've been doing.
Installation
curl -sSf https://raw.githubusercontent.com/joemckenney/wake/main/install.sh | sh
Setup
Add to ~/.zshrc or ~/.bashrc:
eval "$(wake init zsh)" # or: wake init bash
Add the MCP server to Claude Code:
claude mcp add --transport stdio --scope user wake-mcp -- wake-mcp
Usage
The Workflow
- Start —
wake shell - Work — builds, deploys, debugging
- Ask Claude — it sees your terminal history, no copy-pasting
Example
$ wake shell
$ kubectl logs deploy/api-server | tail -100
# wall of errors
$ kubectl describe pod api-server-7f8b9
# more stuff you don't have time to read
You: Summarize what's happening with the API server
Claude: The API server is crash-looping. From the logs, it's failing to connect to Redis on startup—connection refused to
redis:6379. The pod events show 5 restarts in the last 10 minutes. Looks like the Redis service might be down.
CLI Reference
wake shell # Start recorded session
wake status # Current session info
wake log # Recent commands
wake search "error" # Search history
wake dump # Export session as markdown
wake annotate "note" # Add a breadcrumb for context
wake prune # Delete old sessions
wake prune --dry-run # Preview what would be deleted
wake prune --force # Skip confirmation
wake prune --older-than 7 # Override retention period (days)
wake update # Update to latest version
wake update --check # Check for updates without installing
wake llm status # Check model status (downloaded/loaded)
wake llm download # Pre-download model (optional, auto-downloads on first use)
wake llm clean # Remove orphaned models from previous versions
wake llm clean --dry-run # Preview what would be deleted
MCP Tools
Claude Code uses these tools via the MCP server:
| Tool | Purpose |
|---|---|
wake_status | Current session info |
wake_list_commands | List recent commands with metadata and summaries (no full output) |
wake_get_output | Fetch full output for specific command IDs |
wake_log | Recent commands with truncated output |
wake_search | Search command history |
wake_dump | Export session as markdown |
wake_annotate | Add notes to the session |
The wake_list_commands + wake_get_output pattern enables tiered retrieval—Claude sees command metadata first, then fetches full output only when needed. This reduces context usage for long sessions.
Configuration
Create ~/.wake/config.toml:
[retention]
days = 21 # Delete sessions older than this (default: 21)
[output]
max_mb = 5 # Max output size per command in MB (default: 5)
[summarization]
enabled = false # Disable LLM summarization (default: true)
min_bytes = 500 # Minimum output size to trigger summarization (default: 1024)
Or use environment variables (take precedence over config file):
export WAKE_RETENTION_DAYS=14
export WAKE_MAX_OUTPUT_MB=10
Old sessions are automatically pruned on each wake shell start.
LLM Summarization
Wake automatically summarizes command outputs using a local LLM (Qwen3-0.6B). Summaries appear in wake_list_commands output, helping Claude quickly understand what happened without reading full output.
Enabled by default. On first run, the model (~380MB) downloads automatically.
- CPU-friendly — The small model runs efficiently without a GPU
- Privacy — All inference happens locally, nothing leaves your machine
- Manual download —
wake llm downloadto pre-download the model - Disable — Set
enabled = falsein config if you don't want summarization
How it works:
- When a command completes with output >
min_bytes, it's queued for summarization - A background task runs inference on the local model
- Summaries are stored in the database and exposed via MCP tools
GPU acceleration (build from source):
The default build and pre-built binaries use CPU inference, which is fast enough for the small model. For faster inference on supported hardware, build with GPU features:
cargo build --release --features cuda # NVIDIA (requires CUDA toolkit)
cargo build --release --features metal # Apple Silicon
How It Works
┌─────────────────────────────────────────────────────────────────────┐
│ wake shell │
│ │
│ ┌───────────┐ ┌─────────────┐ ┌──────────────────────┐ │
│ │ Your │ pty │ Shell │ hook │ Unix Socket │ │
│ │ Terminal │◄─────►│ (zsh/bash) │─────►│ ~/.wake/sockets/* │ │
│ └───────────┘ └─────────────┘ └──────────┬───────────┘ │
│ │ │ │ │
│ │ │ stdout │ cmd events │
│ │ ▼ ▼ │
│ │ ┌────────────────────────────────┐ │
│ │ │ Output Buffer │ │
│ │ └───────────────┬────────────────┘ │
│ │ │ │
│ │ ▼ │
│ │ ┌─────────────┐ ┌──────────────┐ │
│ │ │ SQLite DB │◄───│ LLM Summary │ │
│ │ │ ~/.wake/ │ │ (background) │ │
│ │ └─────────────┘ └──────────────┘ │
└────────┼────────────────────────────────────────────────────────────┘
│ ▲
│ you │ reads
▼ │
┌──────────────┐ ┌──────────────┐ ┌───────────┐
│ Human at │ │ wake-mcp │ mcp │ Claude │
│ Keyboard │ │ MCP Server │◄────────►│ Code │
└──────────────┘ └──────────────┘ └───────────┘
Components
| Component | Purpose |
|---|---|
wake shell | Spawns a PTY, captures all I/O, listens for hook events |
| Shell hooks | Installed via wake init, notify wake when commands start/end |
| Unix socket | IPC between shell hooks and the wake process |
| SQLite DB | Stores sessions, commands, outputs, annotations, summaries |
| LLM engine | Background task that summarizes command outputs locally |
wake-mcp | MCP server that exposes wake data to Claude Code |
Data Flow
wake shellspawns your shell inside a PTY and sets$WAKE_SESSION- Shell hooks fire on each command, sending metadata via Unix socket
- PTY output is captured and associated with the current command
- On command completion, exit code + output are written to SQLite
- Large outputs are queued for LLM summarization in the background
- Claude Code queries
wake-mcp, which reads from the database
Constraints
- One session per shell — Each
wake shellcreates an isolated session - Output truncation — Commands with >5MB output are truncated (configurable)
- Auto-cleanup — Sessions older than 21 days are automatically deleted (configurable)
- Local only — All data stays in
~/.wake/, nothing leaves your machine - Shell support — Hooks work with zsh and bash (fish/other shells not yet supported)
Building from Source
git clone https://github.com/joemckenney/wake
cd wake
cargo build --release
# With GPU acceleration (optional)
cargo build --release --features cuda # NVIDIA
cargo build --release --features metal # Apple Silicon
License
MIT
Files in the repo
- .claude
- .github
- assets
- crates
- scripts
- .gitignore
- Cargo.lock
- Cargo.toml
- CLAUDE.md
- install.sh
- LICENSE
- README.md
- rustfmt.toml
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tools
The best-benchmarked open-source AI memory system. And it's free.
Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.