{"_id":"@aegntic/cldcde-context-tracker","name":"@aegntic/cldcde-context-tracker","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aegntic/cldcde-context-tracker","version":"1.0.0","description":"A persistent context window monitor addon for Claude Code CLI that shows real-time token usage with visual indicators","main":"lib/context-monitor.js","type":"module","bin":{"cldcde-context-tracker":"bin/install.js"},"scripts":{"install-addon":"node bin/install.js","uninstall-addon":"node bin/uninstall.js","postinstall":"node bin/install.js","preuninstall":"node bin/uninstall.js"},"keywords":["claude","claude-code","context-window","token-counter","cli-addon","ai","anthropic","monitoring","terminal","productivity"],"author":{"name":"AEGNTIC","url":"https://github.com/aegntic"},"license":"MIT","engines":{"node":">=18.0.0"},"dependencies":{"chalk":"^5.3.0"},"repository":{"type":"git","url":"git+https://github.com/aegntic/cldcde.git","directory":"context-win"},"bugs":{"url":"https://github.com/aegntic/cldcde/issues"},"homepage":"https://github.com/aegntic/cldcde/tree/context-win#readme","publishConfig":{"access":"public"},"_id":"@aegntic/cldcde-context-tracker@1.0.0","gitHead":"1fa4f7d8ba6c59f7d89763b89dad0b2762ccf64d","_nodeVersion":"20.19.4","_npmVersion":"11.4.2","dist":{"integrity":"sha512-Rrp7aPOW629r9MaP1yuV4XxSbTr+wZ+v9TfnzuzVG1cVSUtq8sFQzre/xBk3x+dnge7/oQdicu04154ub20sDg==","shasum":"647941d6257679bdd620a4d4beac59566af94b4d","tarball":"https://registry.npmjs.org/@aegntic/cldcde-context-tracker/-/cldcde-context-tracker-1.0.0.tgz","fileCount":6,"unpackedSize":17792,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAelJVF698uMRNpBK3GVPPSPIc32Y1LZ5M5rz5hfyp89AiAum0uJtM5ZPJ9suMGqHxAekk1uClcnq1Z2FnxHiuBkxA=="}]},"_npmUser":{"name":"catface","email":"catface@aegntic.ai"},"directories":{},"maintainers":[{"name":"catface","email":"catface@aegntic.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cldcde-context-tracker_1.0.0_1754401370583_0.5395557690797541"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-05T13:42:50.449Z","1.0.0":"2025-08-05T13:42:50.733Z","modified":"2025-08-05T13:42:50.947Z"},"maintainers":[{"name":"catface","email":"catface@aegntic.ai"}],"description":"A persistent context window monitor addon for Claude Code CLI that shows real-time token usage with visual indicators","homepage":"https://github.com/aegntic/cldcde/tree/context-win#readme","keywords":["claude","claude-code","context-window","token-counter","cli-addon","ai","anthropic","monitoring","terminal","productivity"],"repository":{"type":"git","url":"git+https://github.com/aegntic/cldcde.git","directory":"context-win"},"author":{"name":"AEGNTIC","url":"https://github.com/aegntic"},"bugs":{"url":"https://github.com/aegntic/cldcde/issues"},"license":"MIT","readme":"# CLDCDE Context Tracker\n\nA tiny, persistent context window monitor that lives just below the text input in Claude Code CLI. Shows real-time token usage with color-coded visual indicators.\n\n## Features\n\n- 🔢 **Real-time token counting** - Estimates tokens as you type\n- 📊 **Visual progress bar** - Color-coded usage indicator (green → yellow → red)\n- ⚡ **Lightweight** - Minimal performance impact\n- 🔄 **Persistent** - One-time install, always available\n- 🎨 **Elegant** - Clean, unobtrusive display below input\n\n## Preview\n\n```\nYour input appears here...\n1,247 tokens [████████░░░░░░░░░░░░] 6.2%\n```\n\n## Installation\n\n### Install via npm\n\n```bash\nnpm install -g @aegntic/cldcde-context-tracker\ncldcde-context-tracker\n```\n\n### Install from GitHub\n\n```bash\ngit clone -b context-win https://github.com/aegntic/cldcde.git\ncd cldcde\nnpm install\nnpm run install-addon\n```\n\n### Manual Installation\n\n1. Clone this repository\n2. Run the installation script:\n   ```bash\n   node bin/install.js\n   ```\n3. Add the alias to your shell (will be prompted):\n   ```bash\n   echo \"alias claude-monitor='node ~/.claude/addons/claude-with-monitor.js'\" >> ~/.bashrc\n   source ~/.bashrc\n   ```\n\n## Usage\n\n### With Context Tracker\n```bash\nclaude-monitor  # Start Claude with context tracker enabled\n```\n\n### Without Context Tracker\n```bash\nclaude  # Regular Claude Code CLI (tracker disabled)\n```\n\n## Features\n\n### Token Estimation\n- Accurate estimation based on character count, word patterns, and content type\n- Accounts for code blocks and markdown formatting\n- Updates in real-time as you type\n\n### Visual Indicators\n- **Green (0-25%)**: `1,247 tokens [████░░░░░░░░░░░░░░░░] 6.2%`\n- **Yellow (25-50%)**: `52,441 tokens [██████████░░░░░░░░░░] 26.2%`\n- **Orange (50-75%)**: `101,892 tokens [███████████████░░░░░] 50.9%`\n- **Red (75-90%)**: `157,223 tokens [██████████████████░░] 78.6%`\n- **Critical (90%+)**: `183,455 tokens [███████████████████░] 91.7% ⚠️`\n\n### Smart Monitoring\n- Only displays when typing or editing\n- Clears when not in use\n- Toggleable (Ctrl+M to hide/show)\n- No interference with Claude's normal operation\n\n## Configuration\n\nThe monitor is configured through `~/.claude/hooks.json`:\n\n```json\n{\n  \"preCommand\": [\n    {\n      \"name\": \"context-monitor\",\n      \"script\": \"~/.claude/addons/context-monitor.js\",\n      \"enabled\": true,\n      \"description\": \"Display context window usage monitor\"\n    }\n  ]\n}\n```\n\n## Token Limits\n\n- **Claude 3.5 Sonnet**: 200,000 tokens (~150,000 words)\n- **Claude 3 Opus**: 200,000 tokens\n- **Claude 3 Haiku**: 200,000 tokens\n\n## Troubleshooting\n\n### Monitor not appearing\n```bash\n# Check if Claude hooks are enabled\nls ~/.claude/hooks.json\n\n# Verify addon files exist\nls ~/.claude/addons/\n\n# Reinstall if needed\nnpm run install-addon\n```\n\n### Token count seems off\nThe monitor uses estimation based on:\n- ~3.5 characters per token average\n- Code blocks (+10 tokens each)\n- Markdown formatting (+0.5 tokens per symbol)\n\nFor exact counts, the final submission to Claude will show precise usage.\n\n### Shell alias not working\n```bash\n# Add to your shell config\necho 'alias claude-monitor=\"node ~/.claude/addons/claude-with-monitor.js\"' >> ~/.bashrc\nsource ~/.bashrc\n\n# Or for Zsh\necho 'alias claude-monitor=\"node ~/.claude/addons/claude-with-monitor.js\"' >> ~/.zshrc\nsource ~/.zshrc\n```\n\n## Uninstallation\n\n```bash\nnpm run uninstall-addon\n# or\nnode bin/uninstall.js\n```\n\nThen remove the alias from your shell configuration:\n```bash\n# Edit ~/.bashrc or ~/.zshrc and remove the claude-monitor alias line\n```\n\n## How It Works\n\n1. **Installation**: Copies monitor script to `~/.claude/addons/`\n2. **Hooks**: Registers with Claude's hook system\n3. **Wrapper**: Creates a wrapper script that intercepts input\n4. **Monitoring**: Attaches to stdin stream to count tokens in real-time\n5. **Display**: Shows compact monitor below input area\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Commit changes: `git commit -m 'Add amazing feature'`\n4. Push to branch: `git push origin feature/amazing-feature`\n5. Open a Pull Request\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Changelog\n\n### v1.0.0\n- Initial release\n- Real-time token counting\n- Color-coded progress bar\n- One-time installation\n- Shell alias integration\n\n---\n\n**Made with ❤️ for the Claude Code community**","readmeFilename":"README.md","_rev":"1-0857ceeae69830d52bcf717867d014fa"}