[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74957":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},74957,"openwolf","cytostack\u002Fopenwolf","cytostack","Sharper context. Fewer tokens. Open-source middleware for Claude Code.","https:\u002F\u002Fopenwolf.com",null,"TypeScript",1911,155,9,21,0,16,52,363,48,104.58,"GNU Affero General Public License v3.0",false,"main",true,[27,28,29,30,31,32,33,34],"anthropic","claude-ai","claude-code","cli","developer-tools","middleware","open-source","token-optimization","2026-06-12 04:01:16","\u003Cp align=\"center\">\n  \u003Cimg src=\"demo.gif\" alt=\"OpenWolf demo\" width=\"640\" \u002F>\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\">OpenWolf\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>A second brain for Claude Code.\u003C\u002Fstrong>\u003Cbr \u002F>\n  Project intelligence, token tracking, and invisible enforcement through 6 hook scripts. Zero workflow changes.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fopenwolf\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fopenwolf.svg\" alt=\"npm version\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-AGPL--3.0-blue.svg\" alt=\"License: AGPL-3.0\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fnodejs.org\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNode.js-20%2B-green.svg\" alt=\"Node.js\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n## Why OpenWolf Exists\n\nClaude 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.\n\nOpenWolf gives Claude a second brain: a file index so it knows what files contain before reading them, a learning memory that accumulates your preferences and past mistakes, and a token ledger that tracks everything. All through 6 invisible hook scripts that fire on every Claude action.\n\n## Token Comparison\n\nTested on a large active project. Same codebase, same prompts, different setups:\n\n```\nOpenClaw + Claude          ██████████████████████████████████████  ~3.4M tokens\nClaude CLI (no OpenWolf)   ████████████████████████████████        ~2.5M tokens\nOpenWolf + Claude CLI      ████████                                ~425K tokens\n```\n\n**OpenWolf saved ~80% of tokens** compared to bare Claude CLI on the same project.\n\nAcross 20 projects, 132+ sessions: average token reduction of 65.8%, with 71% of repeated file reads caught and blocked. These are numbers from real usage, not benchmarks. Your results will vary by project size and usage patterns.\n\n## Quick Start\n\n```bash\nnpm install -g openwolf\ncd your-project\nopenwolf init\n```\n\nThat's it. Use `claude` normally. OpenWolf is watching.\n\n## What It Creates\n\n`openwolf init` creates a `.wolf\u002F` directory in your project:\n\n| File | Purpose |\n|------|---------|\n| `anatomy.md` | Project file map with descriptions and token estimates |\n| `cerebrum.md` | Learned preferences, corrections, Do-Not-Repeat list |\n| `memory.md` | Chronological action log with token estimates |\n| `buglog.json` | Bug fix memory, searchable, prevents re-discovery |\n| `token-ledger.json` | Lifetime token tracking and session history |\n| `hooks\u002F` | 6 Claude Code lifecycle hooks (pure Node.js) |\n| `config.json` | Configuration with sensible defaults |\n| `identity.md` | Agent persona for this project |\n| `OPENWOLF.md` | Instructions Claude follows every session |\n\n## How It Works\n\nBefore Claude reads a file, OpenWolf tells it what the file contains and how large it is. If Claude already read that file this session, OpenWolf warns it. Before Claude writes code, OpenWolf checks your `cerebrum.md` for known mistakes. After every write, it auto-updates the project map and logs token usage. You see none of this. It just happens.\n\n```\nYou type a message\n    ↓\nClaude decides to read a file\n    ↓\nOpenWolf: \"anatomy.md says this file is ~380 tokens. Description: Main entry point.\"\n    ↓\nClaude reads the file\n    ↓\nOpenWolf: logs the read, estimates tokens, checks for repeated reads\n    ↓\nClaude writes code\n    ↓\nOpenWolf: checks cerebrum.md - no known mistakes matched\n    ↓\nClaude finishes\n    ↓\nOpenWolf: updates anatomy.md, appends to memory.md, updates token ledger\n```\n\n## The .wolf\u002F Files\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>cerebrum.md\u003C\u002Fstrong> - the learning memory\u003C\u002Fsummary>\n\nClaude updates this file when you correct it, express a preference, or make a decision. The Do-Not-Repeat list prevents the same mistake across sessions.\n\n```markdown\n## Do-Not-Repeat\n\n- 2026-03-10: Never use `var` - always `const` or `let`\n- 2026-03-11: Don't mock the database in integration tests - use the real connection\n- 2026-03-14: The auth middleware reads from `cfg.talk`, not `cfg.tts` - got burned twice\n\n## User Preferences\n\n- Prefers functional components over class components\n- Always use named exports, never default exports\n- Tests go in `__tests__\u002F` next to the source file\n\n## Key Learnings\n\n- This project uses pnpm workspaces with strict hoisting\n- The API rate limiter uses a sliding window, not fixed buckets\n- Auth middleware reads from env.JWT_SECRET, not config file\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>anatomy.md\u003C\u002Fstrong> - the project map\u003C\u002Fsummary>\n\nEvery file gets a description and token estimate. Claude reads this instead of opening files when the summary is enough.\n\n```markdown\n## src\u002F\n\n- `index.ts` - Main entry point. Exports createProgram() for CLI. (~180 tok)\n- `server.ts` - Express HTTP server with middleware chain. (~520 tok)\n\n## src\u002Fapi\u002F\n\n- `auth.ts` - JWT validation middleware. Reads from env.JWT_SECRET. (~340 tok)\n- `users.ts` - CRUD endpoints for \u002Fapi\u002Fusers. Pagination via query params. (~890 tok)\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>token-ledger.json\u003C\u002Fstrong> - the receipt\u003C\u002Fsummary>\n\nEvery session gets a line item. Lifetime totals tell you if OpenWolf is actually saving tokens.\n\n```json\n{\n    \"lifetime\": {\n        \"total_tokens_estimated\": 503978,\n        \"total_reads\": 287,\n        \"total_writes\": 269,\n        \"total_sessions\": 15,\n        \"anatomy_hits\": 198,\n        \"anatomy_misses\": 89,\n        \"repeated_reads_blocked\": 106,\n        \"estimated_savings_vs_bare_cli\": 2066959\n    }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>buglog.json\u003C\u002Fstrong> - the bug memory\u003C\u002Fsummary>\n\nBefore fixing anything, Claude checks if the fix is already known. After fixing, it logs the solution.\n\n```json\n{\n    \"id\": \"bug-012\",\n    \"error_message\": \"TypeError: Cannot read properties of undefined (reading 'map')\",\n    \"file\": \"src\u002Fcomponents\u002FUserList.tsx\",\n    \"root_cause\": \"API response was null when users array was expected\",\n    \"fix\": \"Added optional chaining: data?.users?.map() and fallback empty array\",\n    \"tags\": [\"null-check\", \"api-response\", \"react\"]\n}\n```\n\n\u003C\u002Fdetails>\n\n## Commands\n\n```\nopenwolf init              Initialize .wolf\u002F and register hooks\nopenwolf status            Show health, stats, file integrity\nopenwolf scan              Refresh the project structure map\nopenwolf scan --check      Verify anatomy matches filesystem (exits 1 if stale)\nopenwolf dashboard         Open the real-time web dashboard\nopenwolf daemon start      Start background task scheduler\nopenwolf daemon stop       Stop the scheduler\nopenwolf daemon restart    Restart the scheduler\nopenwolf daemon logs       View scheduler logs\nopenwolf cron list         Show all scheduled tasks\nopenwolf cron run \u003Cid>     Trigger a task manually\nopenwolf cron retry \u003Cid>   Retry a dead-lettered task\nopenwolf designqc          Capture full-page screenshots for design evaluation\nopenwolf bug search \u003Cterm> Search bug memory for known fixes\nopenwolf update            Update all registered projects to latest version\nopenwolf restore [backup]  Restore .wolf\u002F from a timestamped backup\n```\n\n## Design QC\n\nCapture full-page screenshots of your running app and let Claude evaluate the design.\n\n```bash\nopenwolf designqc\n```\n\nAuto-detects your dev server, captures viewport-height JPEG sections of every route, and saves them to `.wolf\u002Fdesignqc-captures\u002F`. Then tell Claude to read the screenshots and evaluate. Requires `puppeteer-core`.\n\n## Reframe\n\nAsk Claude to help you pick a UI framework. OpenWolf ships a curated knowledge base of 12 frameworks (shadcn\u002Fui, Aceternity, Magic UI, DaisyUI, HeroUI, Chakra, Flowbite, Preline, Park UI, Origin UI, Headless UI, Cult UI) with battle-tested migration prompts. Claude reads `.wolf\u002Freframe-frameworks.md`, asks you a few questions, and executes the migration with the right prompt for your project.\n\n## How OpenWolf Compares\n\nOpenWolf is not an AI wrapper. It is 6 hook scripts and a `.wolf\u002F` directory. It doesn't run your AI for you or change your workflow. It gives Claude Code what it lacks: a project map so it reads less, a memory so it learns faster, and a ledger so you see where tokens go.\n\n## Requirements\n\n- Node.js 20+\n- Claude Code CLI\n- Windows, macOS, or Linux\n- Optional: PM2 for persistent background tasks\n- Optional: `puppeteer-core` for Design QC screenshots\n\n## Limitations\n\n- Claude Code hooks are a relatively new feature. OpenWolf falls back to `CLAUDE.md` instructions when hooks don't fire.\n- Token tracking is estimation-based (character-to-token ratio), not exact API counts. Accurate to within ~15%.\n- `cerebrum.md` depends on Claude following instructions to update it after corrections. Compliance is ~85-90%, not 100%.\n- This is v1.0.4. Things may break. [File issues](https:\u002F\u002Fgithub.com\u002Fcytostack\u002Fopenwolf\u002Fissues).\n\n## Origin Story\n\nWe were building products with Claude Code at Cytostack when we noticed something off. Sessions were eating through tokens faster than they should. When we dug in, we found Claude re-reading the same files multiple times, scanning entire directories to find one function, and having no way to know what a file contained without opening it. There was no project map, no read awareness, no token visibility. So we built the tooling we wished existed -- a file index so Claude reads less, a learning memory so it gets smarter, and a ledger that tracks every token. That became OpenWolf.\n\n## License\n\n[AGPL-3.0](LICENSE)\n\n## Author\n\nBuilt by Farhan Palathinkal Afsal - [Cytostack](https:\u002F\u002Fgithub.com\u002Fcytostack)\n","OpenWolf 是一个为 Claude Code 设计的开源中间件，旨在通过优化上下文和减少 token 使用来提升开发效率。其核心功能包括项目文件索引、学习记忆机制以及 token 跟踪系统，通过六个钩子脚本实现对 Claude 行动的无感增强，无需改变现有工作流程。特别适用于大型代码库或需要频繁与 Claude 交互的场景中，能够显著降低 token 消耗（平均节省约 65.8% 的 tokens），提高 Claude 对项目结构的理解能力和响应速度。使用 TypeScript 编写，并以 AGPL-3.0 许可证发布。",2,"2026-06-11 03:51:42","high_star"]