Advanced productivity tracking and context optimization for AI-assisted development
Project description
Context Cleaner
Advanced productivity tracking and context optimization for AI-assisted development
Context Cleaner is a comprehensive productivity tracking tool designed specifically for developers using AI coding assistants like Claude Code. It provides intelligent context health monitoring, performance analytics, and optimization recommendations to maximize development productivity.
๐ฏ Key Features
๐ Productivity Tracking
- Development session monitoring with automatic boundary detection
- Context health scoring (0-100 scale) based on size, structure, and complexity
- Performance correlation analysis between context optimization and productivity
- Git integration for commit pattern analysis and productivity metrics
๐ Advanced Analytics
- Trend analysis across days, weeks, and months
- Pattern recognition for optimal work schedules and session lengths
- A/B testing framework for different context optimization strategies
- Productivity forecasting based on historical data and patterns
๐ Interactive Dashboard
- Web-based visualization of productivity trends and session analytics
- Real-time metrics with automatic refresh and live updates
- Actionable insights with specific optimization recommendations
- Mobile-responsive design for monitoring on any device
๐ก๏ธ Privacy-First Architecture
- Local-only processing - all data stays on your machine
- No external requests - zero network dependencies
- Complete data ownership with easy export and deletion
- Transparent operation with open-source codebase
๐ง Developer-Friendly CLI
- Simple installation via pip with zero configuration required
- Flexible commands for all productivity tracking and analysis needs
- Multiple output formats (JSON, YAML, text) for integration
- Comprehensive help and troubleshooting built-in
๐ Quick Start
Installation
# Install from PyPI
pip install context-cleaner
# Or install from source
git clone https://github.com/context-cleaner/context-cleaner.git
cd context-cleaner
pip install -e .
Basic Usage
# Start productivity tracking
context-cleaner start
# Launch interactive dashboard
context-cleaner dashboard
# Analyze recent productivity
context-cleaner analyze --days 7
# Export your data
context-cleaner export --output my-data.json
Dashboard Access
After running context-cleaner dashboard, visit http://localhost:8548 to access your productivity insights through an intuitive web interface.
๐ Usage Examples
Development Workflow Integration
# Start tracking at beginning of work session
context-cleaner start
# View real-time productivity dashboard
context-cleaner dashboard --port 8080
# Get daily productivity summary
context-cleaner analyze --days 1 --format text
# Weekly productivity report in JSON
context-cleaner analyze --days 7 --format json --output weekly-report.json
Productivity Analysis
# Comprehensive 30-day analysis
context-cleaner analyze --days 30
# Example output:
# ๐ PRODUCTIVITY ANALYSIS REPORT
# ================================
# ๐
Analysis Period: Last 30 days
# ๐ฏ Average Productivity Score: 87.3/100
# ๐ Total Sessions: 156
# โก Optimization Events: 45
# ๐ Most Productive Day: Tuesday
#
# ๐ก RECOMMENDATIONS:
# 1. Your productivity peaks at 3-4 PM - schedule complex tasks then
# 2. Context optimization events correlate with 18% productivity increase
# 3. Consider shorter sessions (< 90 minutes) for sustained performance
Data Management
# Export all data for backup
context-cleaner export --format json --output backup-$(date +%Y%m%d).json
# Show privacy information
context-cleaner privacy show-info
# Delete all collected data
context-cleaner privacy delete-all
๐ Dashboard Features
Productivity Metrics Overview
- Current productivity score with 7-day trend
- Session statistics including count, duration, and quality
- Optimization events tracking context improvements
- Health trend indicators showing improvement/decline patterns
Advanced Visualizations
- Time-series charts showing productivity trends over time
- Heatmaps indicating peak performance hours and days
- Session type analysis (debugging, coding, exploration, optimization)
- Correlation charts between context health and productivity
Actionable Insights
- Personalized recommendations based on individual productivity patterns
- Optimal scheduling suggestions for different types of development tasks
- Context optimization timing recommendations for maximum impact
- Performance alerts when productivity patterns change significantly
๐ง Configuration
Default Configuration
Context Cleaner works out-of-the-box with sensible defaults, but can be customized via configuration files.
Configuration File (Optional)
Create ~/.context_cleaner/config.yaml:
dashboard:
port: 8548
host: localhost
auto_refresh: true
cache_duration: 300
tracking:
enabled: true
sampling_rate: 1.0
session_timeout_minutes: 30
data_retention_days: 90
privacy:
local_only: true
encrypt_storage: true
require_consent: true
analysis:
health_thresholds:
excellent: 90
good: 70
fair: 50
max_context_size: 100000
Environment Variables
export CONTEXT_CLEANER_PORT=8080
export CONTEXT_CLEANER_DATA_DIR=~/my-productivity-data
export CONTEXT_CLEANER_LOG_LEVEL=DEBUG
๐งช Advanced Features
Custom Analytics
from context_cleaner import ProductivityAnalyzer, ContextCleanerConfig
# Initialize with custom configuration
config = ContextCleanerConfig.default()
analyzer = ProductivityAnalyzer(config)
# Analyze context health
result = await analyzer.analyze_context_health(context_data)
print(f"Health Score: {result.health_score}/100")
# Analyze productivity session
metrics = analyzer.analyze_productivity_session(session_data)
print(f"Productivity Score: {metrics.productivity_score}/100")
Integration with Development Tools
# Git hook integration (post-commit)
#!/bin/bash
context-cleaner analyze --days 1 --format json | jq '.avg_productivity_score'
# CI/CD integration
context-cleaner analyze --days 7 --format json > productivity-report.json
Custom Dashboard Themes
The dashboard supports custom CSS themes and can be extended with additional charts and metrics.
๐ Privacy & Security
Data Protection
- Local Storage: All data is stored locally in
~/.context_cleaner/data/ - No Telemetry: Zero external network requests or data transmission
- Encryption: Optional at-rest encryption for sensitive productivity data
- Data Retention: Configurable automatic cleanup after specified period
Privacy Controls
- Granular Tracking: Choose exactly what metrics to collect
- Easy Deletion: One-command complete data removal
- Data Export: Full data portability in standard formats
- Transparent Operation: Open-source code for complete auditability
Security Features
- Input Validation: Comprehensive sanitization of all data
- Resource Limits: Built-in protection against resource exhaustion
- Safe Defaults: Conservative configuration prioritizing privacy
- Error Isolation: System continues working even with component failures
๐๏ธ Architecture
Core Components
Context Cleaner Architecture
โโโ ๐ Analytics Engine
โ โโโ ProductivityAnalyzer - Core analysis algorithms
โ โโโ TrendCalculator - Time-series analysis
โ โโโ ImpactEvaluator - Optimization effectiveness
โโโ ๐ Dashboard System
โ โโโ Web Server - FastAPI-based interface
โ โโโ Data Visualization - Interactive charts
โ โโโ Real-time Updates - Live metric streaming
โโโ ๐๏ธ Data Management
โ โโโ Session Tracking - Development session boundaries
โ โโโ Storage System - Local SQLite database
โ โโโ Privacy Controls - Data export/deletion
โโโ ๐ง CLI Interface
โโโ Command Processing - Argument parsing and validation
โโโ Output Formatting - Text/JSON/YAML formats
โโโ Configuration - Settings and preferences
Data Flow
- Data Collection - Monitor development sessions and context changes
- Analysis Processing - Calculate health scores and productivity metrics
- Pattern Recognition - Identify trends and optimization opportunities
- Insight Generation - Create actionable recommendations
- Visualization - Present insights through dashboard or CLI
๐ API Reference
Command Line Interface
context-cleaner [OPTIONS] COMMAND [ARGS]...
Commands:
start Start productivity tracking
dashboard Launch web dashboard
analyze Analyze productivity trends
export Export all data
privacy Privacy and data management
config-show Show current configuration
Python API
from context_cleaner import ContextCleanerConfig, ProductivityAnalyzer
# Configuration
config = ContextCleanerConfig.from_file('config.yaml')
config = ContextCleanerConfig.from_env() # Environment variables
config = ContextCleanerConfig.default() # Sensible defaults
# Analytics
analyzer = ProductivityAnalyzer(config)
result = await analyzer.analyze_context_health(data)
metrics = analyzer.analyze_productivity_session(session_data)
# Dashboard
from context_cleaner import ProductivityDashboard
dashboard = ProductivityDashboard(config)
dashboard.start_server(host="localhost", port=8548)
๐งช Development
Development Setup
# Clone repository
git clone https://github.com/context-cleaner/context-cleaner.git
cd context-cleaner
# Install development dependencies
pip install -e .[dev]
# Run tests
pytest
# Code formatting
black src/
flake8 src/
# Type checking
mypy src/
Testing
# Run all tests
pytest
# Run specific test categories
pytest -m unit # Unit tests only
pytest -m integration # Integration tests only
# Coverage report
pytest --cov=context_cleaner --cov-report=html
Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/awesome-feature - Make changes and add tests
- Run test suite:
pytest - Submit a pull request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Support
Documentation
Community
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and community support
- Documentation - Comprehensive guides and tutorials
Commercial Support
For enterprise support, custom integrations, and consulting services, please contact us at team@context-cleaner.dev.
๐ฏ Roadmap
Version 0.2.0 (Next Release)
- Advanced ML Analytics: Machine learning-powered productivity insights
- Team Features: Aggregated (anonymized) team productivity metrics
- IDE Integration: Direct integration with popular development environments
- Extended Git Integration: Branch-based productivity tracking
Version 0.3.0 (Future)
- Cross-Project Analytics: Multi-repository productivity tracking
- Advanced Forecasting: Predictive productivity modeling
- Custom Metrics: User-defined productivity indicators
- API Integration: Webhooks and external service integration
Long-term Vision
- AI-Powered Coaching: Personalized productivity improvement recommendations
- Collaboration Analytics: Pair programming and code review productivity
- Performance Benchmarking: Industry-wide anonymous productivity comparisons
- Ecosystem Integration: Seamless integration with development tool ecosystems
Context Cleaner - Transforming AI-assisted development through intelligent productivity tracking and optimization.
Built with โค๏ธ for developers who want to understand and improve their coding productivity.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file context_cleaner-0.1.0-py3-none-any.whl.
File metadata
- Download URL: context_cleaner-0.1.0-py3-none-any.whl
- Upload date:
- Size: 199.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de98f5a01efc5a519bf55d43f593b71cab7d0326b77d53d5d2f45b388ff88174
|
|
| MD5 |
f99f1273b1ffec1a3a50f3a4659b3fab
|
|
| BLAKE2b-256 |
be70646ed4fdd2c7e7ce9ccc51e5592b8cf46eb3897e9fd4850e0f2d7e0f924e
|