{"id":47577382,"url":"https://github.com/nadimtuhin/claude-token-optimizer","last_synced_at":"2026-05-13T17:39:07.523Z","repository":{"id":323563280,"uuid":"1093765626","full_name":"nadimtuhin/claude-token-optimizer","owner":"nadimtuhin","description":"Reusable setup prompts for optimizing Claude Code documentation. Achieve 90% token savings on any project in 5 minutes.","archived":false,"fork":false,"pushed_at":"2025-11-10T21:59:53.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-10T22:19:10.055Z","etag":null,"topics":["ai-assistant","automation","claude-code","developer-tools","documentation","setup-template","token-optimization"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nadimtuhin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T20:10:25.000Z","updated_at":"2025-11-10T21:59:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nadimtuhin/claude-token-optimizer","commit_stats":null,"previous_names":["nadimtuhin/claude-token-optimizer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nadimtuhin/claude-token-optimizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadimtuhin%2Fclaude-token-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadimtuhin%2Fclaude-token-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadimtuhin%2Fclaude-token-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadimtuhin%2Fclaude-token-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nadimtuhin","download_url":"https://codeload.github.com/nadimtuhin/claude-token-optimizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadimtuhin%2Fclaude-token-optimizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31822903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-assistant","automation","claude-code","developer-tools","documentation","setup-template","token-optimization"],"created_at":"2026-03-31T06:00:20.564Z","updated_at":"2026-04-15T02:00:49.715Z","avatar_url":"https://github.com/nadimtuhin.png","language":"Shell","funding_links":[],"categories":["Productivity Tools"],"sub_categories":["Cost Optimization"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🚀 Claude Token Optimizer\n\n**Stop wasting Claude Code's context on old docs**\n\nCut token usage by 90% so Claude can focus on your actual code\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub stars](https://img.shields.io/github/stars/nadimtuhin/claude-token-optimizer?style=social)](https://github.com/nadimtuhin/claude-token-optimizer/stargazers)\n[![Version](https://img.shields.io/badge/version-1.4.0-blue.svg)](https://github.com/nadimtuhin/claude-token-optimizer/releases)\n\n\u003c/div\u003e\n\n---\n\n## The Problem\n\nClaude Code loads everything at session start. My RedwoodJS project was burning **11,000 tokens** before I even started coding - that's 1,783 lines of documentation, old session notes, and completed task history eating into my context window.\n\n## The Solution\n\nStructure your docs so Claude only loads what it needs:\n- **4 essential files** at startup (~800 tokens)\n- **Everything else** available but never auto-loaded (0 tokens)\n- **Topic-based learnings** you load as needed (~500 tokens each)\n\nReal result: 11,000 → 1,300 tokens. That's 9,700 tokens freed up for your code.\n\n## Quick Setup\n\nRun this in your project root:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/nadimtuhin/claude-token-optimizer/main/init.sh | bash\n```\n\nIt'll ask about your project type and create the optimized structure. Takes about 2 minutes.\n\n### What You Get\n\n```\nyour-project/\n├── CLAUDE.md                    # Claude reads this first\n├── .claudeignore                # Keeps old docs from loading\n│\n├── .claude/\n│   ├── COMMON_MISTAKES.md       # Your top 5 critical bugs\n│   ├── QUICK_START.md           # Common commands\n│   ├── ARCHITECTURE_MAP.md      # Where things are\n│   ├── completions/             # Task history (0 tokens)\n│   └── sessions/                # Old work (0 tokens)\n│\n└── docs/\n    ├── INDEX.md\n    ├── learnings/               # Load these as needed\n    └── archive/                 # Old docs (0 tokens)\n```\n\n## How It Works\n\n**Before:**\n```\nSession start loads:\n├── All docs           → 8,000 tokens\n├── Old sessions       → 2,000 tokens\n├── Task history       → 1,000 tokens\n└── Misc               → ???\n                Total: ~11,000 tokens\n```\n\n**After:**\n```\nSession start loads:\n├── CLAUDE.md          → 450 tokens\n├── COMMON_MISTAKES.md → 350 tokens\n├── QUICK_START.md     → 100 tokens\n└── ARCHITECTURE_MAP.md→ 150 tokens\n                Total: ~800 tokens (90% reduction)\n\nEverything else?\nAvailable when you ask, but costs 0 tokens until you do.\n```\n\n## Framework-Specific Setup\n\nGot patterns for 9 frameworks with common mistakes and best practices:\n\n| Framework | Example |\n|-----------|---------|\n| Express.js | [examples/express.md](examples/express.md) |\n| Next.js | [examples/nextjs.md](examples/nextjs.md) |\n| Vue.js | [examples/vue.md](examples/vue.md) |\n| Nuxt.js | [examples/nuxtjs.md](examples/nuxtjs.md) |\n| Angular | [examples/angular.md](examples/angular.md) |\n| Django | [examples/django.md](examples/django.md) |\n| Rails | [examples/rails.md](examples/rails.md) |\n| NestJS | [examples/nestjs.md](examples/nestjs.md) |\n| Laravel | [examples/laravel.md](examples/laravel.md) |\n\nEach includes the top 5 critical mistakes for that framework (N+1 queries, auth issues, etc).\n\n### Manual Setup\n\nIf you want more control or framework-specific patterns:\n\n1. Copy [`UNIVERSAL_SETUP.md`](UNIVERSAL_SETUP.md)\n2. Paste it into Claude Code\n3. Answer Claude's questions\n4. Get framework-specific patterns included\n\n## After Setup\n\n1. **Add your critical bugs** to `.claude/COMMON_MISTAKES.md`\n   Only add bugs that took \u003e1 hour to debug. Keep it short.\n\n2. **Document your commands** in `.claude/QUICK_START.md`\n   `npm run dev`, database commands, whatever you use daily.\n\n3. **Map your architecture** in `.claude/ARCHITECTURE_MAP.md`\n   Where controllers live, how routing works, etc.\n\n4. **Create topic files** in `docs/learnings/` as you learn\n   One file per topic (testing, API design, deployment)\n\n5. **Archive completed work**\n   Task docs go to `.claude/completions/`, old sessions to `.claude/sessions/archive/`\n\nClaude loads only what it needs. Everything else sits there at 0 token cost until you explicitly ask for it.\n\n## Real Numbers\n\nMy RedwoodJS project:\n- Before: 8,000 tokens at startup, 11,000 total\n- After: 800 tokens at startup, 1,300 total\n- **7,200 tokens freed up** for actual code\n\nYour mileage will vary, but 83-87% reduction is typical across frameworks.\n\n## FAQ\n\n**Is the bash script safe?**\nIt only creates files, never deletes. You can read the [source](init.sh) - it's ~470 lines.\n\n**Works with my framework?**\nYes. The bash script creates a universal structure. Works with any language/framework. We have specific patterns for 8 popular ones, but it's not required.\n\n**What if I have existing docs?**\nThe setup works alongside them. You can migrate gradually or keep both.\n\n**Can I customize it?**\nEverything. Edit files, change structure, adjust what loads. It's just markdown files and a `.claudeignore`.\n\n**How do I maintain it?**\nWhen you hit a critical bug that took \u003e1 hour, add it to `COMMON_MISTAKES.md`. That's the main upkeep. Rest is optional.\n\n## Related Projects\n\n**[Claude Workflows](https://github.com/nadimtuhin/claude-workflows)** - Systematic workflow commands for Claude Code\n\nWhile this repo optimizes **what Claude knows** (documentation), Claude Workflows optimizes **what Claude does** (processes). They work great together:\n\n- This repo: Documentation structure (4 core files, 0-token historical context)\n- Workflows: Process automation (`/dev:start-feature`, `/git:commit`, `/test:run`)\n\nBoth use the same principle: 0 tokens until you need them.\n\n## Contributing\n\nWant to add a framework? Copy one of the [examples](examples/), test it on a real project, and submit a PR with token savings.\n\nNeeded:\n- Flask/FastAPI\n- Spring Boot\n- Go (Gin/Echo/Fiber)\n- Rust (Actix/Axum)\n- Phoenix\n- ASP.NET Core\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Need Help?\n\n- Bug? [Open an issue](https://github.com/nadimtuhin/claude-token-optimizer/issues)\n- Question? [Start a discussion](https://github.com/nadimtuhin/claude-token-optimizer/discussions)\n- Love it? Star the repo\n\n## License\n\nMIT - use it however you want.\n\n---\n\nBuilt because I was tired of Claude loading 11,000 tokens of docs I wrote 3 months ago.\n\nNow it loads 800 tokens and I actually have room to code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnadimtuhin%2Fclaude-token-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnadimtuhin%2Fclaude-token-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnadimtuhin%2Fclaude-token-optimizer/lists"}