Caveman is a multi-agent AI coding skill/plugin that compresses LLM output tokens by ~65-75% using a 'caveman' terse communication style. It's not a library or service but a distributed configuration package that installs into 30+ AI coding agents (Claude Code, Codex, Gemini, Cursor, Windsurf, Cline, Copilot, opencode, OpenClaw, etc.) through their native plugin/extension/rule-file mechanisms. The core deliverable is a set of SKILL.md prompt files that instruct models to drop articles, filler, pleasantries, and hedging while preserving exact technical substance, code blocks, URLs, and paths. The architecture is a single Node.js installer (bin/install.js) that auto-detects installed agents and dispatches to per-provider installation paths. For Claude Code specifically, it adds SessionStart and UserPromptSubmit hooks plus a statusline badge. The repo includes several sub-skills: caveman-commit (terse conventional commits), caveman-review (one-line PR comments), caveman-compress (rewrites memory files like CLAUDE.md into caveman format to save input tokens), caveman-stats (reads session logs to report real token savings), and cavecrew (compressed subagent definitions for investigator/builder/reviewer patterns). There's also caveman-shrink, an MCP middleware proxy that compresses tool descriptions. The codebase demonstrates strong engineering practices: symlink-safe flag file writes with O_NOFOLLOW and ownership verification, atomic settings.json merges with JSONC tolerance, defensive hook validation before writes, idempotent install/uninstall cycles, and a three-arm eval harness (baseline/terse/skill) for honest token compression measurement. The Python compress tool has safety guards against exfiltrating sensitive files and verifies backup integrity before overwriting. Test coverage is substantial across installer e2e flows, hook symlink safety, opencode plugin lifecycle, and config resolution order.
ztk is a CLI proxy that reduces LLM token consumption by intercepting and compressing shell command output. It sits between AI agents (Claude Code, Cursor, Gemini CLI) and the shell, executing commands normally but returning filtered output through a six-stage pipeline. The tool removes noise like diff metadata, test runner verbosity, and redundant directory listings while preserving essential information such as error messages and exit codes. Built in Zig with zero dependencies, it features a Thompson NFA regex engine for runtime filters, SIMD-accelerated text processing, and an mmap'd session cache to avoid repeated output for unchanged commands.