A Chrome extension that tracks the environmental impact of AI usage on Claude.ai, built with React, TypeScript, and FastAPI.
- Real-time Token Counting: Automatically detects and counts tokens from Claude.ai conversations
- Environmental Impact Tracking: Calculates energy consumption, CO₂ emissions, and water usage
- Beautiful Dashboard: Modern React interface with Tailwind CSS
- Chrome Extension: Works as both popup and sidebar
- FastAPI Backend: Deployed on Render for token counting and environmental calculations
- Node.js (v18 or higher)
- Python 3.11+ (for backend)
- Chrome browser
git clone https://github.com/lidiann/HackMIT2025.git
cd HackMIT2025npm installnpm run dev- Opens at
http://localhost:8080 - Hot reload for React development
- Full development experience
# Build the extension
npm run build
# Load in Chrome:
# 1. Go to chrome://extensions/
# 2. Enable "Developer mode"
# 3. Click "Load unpacked"
# 4. Select the `dist` folder- Start the dev server:
npm run dev - Edit files in the
src/folder:src/components/- React componentssrc/pages/- Page componentssrc/hooks/- Custom hookssrc/services/- API services
- See changes instantly in the browser
- Build for extension:
npm run buildwhen ready
src/components/AIUsageDashboard.tsx- Main dashboardsrc/components/TokenCounter.tsx- Token counting interfacesrc/hooks/useAIUsage.ts- Data managementsrc/services/api.ts- API integrationcontent.js- Claude.ai monitoringbackground.js- Extension service worker
- Make changes to React files
- Run
npm run build - Go to
chrome://extensions/ - Click refresh on the extension
- Test on
https://claude.ai
HackMIT2025/
├── src/ # React frontend source
│ ├── components/ # React components
│ │ ├── AIUsageDashboard.tsx # Main dashboard
│ │ ├── TokenCounter.tsx # Token counter
│ │ └── ui/ # UI components
│ ├── hooks/ # Custom hooks
│ │ └── useAIUsage.ts # Data management
│ ├── services/ # API services
│ │ └── api.ts # Backend integration
│ └── pages/ # Page components
├── dist/ # Built Chrome extension
├── content.js # Claude.ai content script
├── background.js # Extension service worker
├── manifest.json # Extension configuration
├── server.py # FastAPI backend
└── requirements.txt # Python dependencies
If you want to run the backend locally:
# Install Python dependencies
pip install -r requirements.txt
# Set environment variable
export ANTHROPIC_API_KEY="your-api-key"
# Run the server
python server.pyThe extension uses the deployed backend by default at https://hackmit2025-pf5p.onrender.com.
- Tailwind CSS for styling
- shadcn/ui components
- Responsive design for popup and sidebar
- Dark/light mode support
- Click extension icon for quick access
- Compact 350x500px interface
- Quick token counting
- Right-click extension → "Open side panel"
- Full-height interface
- Complete dashboard experience
- Automatically detects input on Claude.ai
- Counts tokens when you send messages
- Updates dashboard in real-time
- Build:
npm run build - Zip the
distfolder - Upload to Chrome Web Store (or share zip file)
- Already deployed on Render
- Environment variables configured
- Auto-deploys from GitHub
- Check
dist/manifest.jsonexists - Verify all files in
dist/folder - Check Chrome console for errors
- Verify backend is running:
https://hackmit2025-pf5p.onrender.com/health - Check network connectivity
- Look for CORS errors
- Clear browser cache
- Restart dev server:
npm run dev - Check console for errors
MIT License - see LICENSE file for details
- Built for HackMIT 2025
- Uses Anthropic API for token counting
- Environmental impact calculations based on research data