Skip to main content
Back

OpenWolf Cuts Claude Code Token Usage by 65% With Open-Source Middleware

OpenWolf is open-source middleware that gives Claude Code persistent project memory and token tracking, cutting usage by up to 80% through six invisible lifecycle hooks.

Pro

Repo, Full Access
  • OpenWolf is free, open-source middleware for Claude Code that cuts token usage by up to 80% through six invisible lifecycle hooks.
  • It gives Claude a persistent project file index (anatomy.md), so it can decide whether to read a file based on its description and token estimate alone.
  • A cerebrum.md learning memory accumulates your corrections, preferences, and Do-Not-Repeat rules across sessions, preventing Claude from repeating the same mistakes.
  • Tested across 20 projects and 132+ sessions: 65.8% average token reduction, with 71% of repeated file reads caught and blocked.
  • Install with npm install -g openwolf then openwolf init — no workflow changes required; hooks fire invisibly on every Claude action.
  • Licensed AGPL-3.0, runs entirely on your machine with no external API calls. GitHub repo here.

OpenWolf is a free, open-source middleware layer for Claude Code that solves a problem anyone who has used the tool for real work has run into: Claude burns through tokens re-reading the same files over and over, has no memory of your preferences between sessions, and has no idea what your project looks like until it opens every file one by one. OpenWolf fixes all three of those things without changing how you work.

Claude works blind. That's the real problem.

Claude Code is powerful, but it works blind. It doesn't know what a file contains until it opens it. It can't tell a 50-token config from a 2,000-token module. It reads the same file multiple times in one session without noticing. It has no index of your project, no memory of your corrections, and no awareness of what it already tried.

The creator of OpenWolf, Dr. Farhan Palathinkal, tracked every file read across 132 sessions on 20 projects. 71% of all file reads were files Claude had already opened in that same session. On one project, Claude read server.ts four times in a single session. When Claude hits the context window ceiling, Anthropic's automatic context compaction kicks in, compressing conversation history to keep things moving, but by then you've already burned through tokens reading files you didn't need to read.

Six hooks. Zero workflow changes.

OpenWolf intercepts Claude Code's lifecycle using six Node.js scripts registered in .claude/settings.json. Hooks are user-defined shell commands that execute at specific points in Claude Code's lifecycle. They provide deterministic control over Claude Code's behavior, ensuring certain actions always happen rather than relying on the LLM to choose to run them. OpenWolf packages six of these into a ready-to-use bundle: