Track AI coding time and productivity metrics with WakaTime plugin for Claude Code. Developers and operations teams gain insights into AI usage, lines of code generated, and time spent prompting AI. Integrates with WakaTime for metrics and insights.
git clone https://github.com/wakatime/claude-code-wakatime.gitThe claude-code-wakatime skill is designed to help developers and AI practitioners track the time they spend coding with Claude Code. By integrating with your coding environment, this automation skill provides insights into your productivity, allowing you to analyze how effectively you are utilizing your time while developing AI solutions. The skill operates by logging your coding sessions and presenting detailed reports on your usage patterns, enabling you to make informed decisions about your workflow and productivity enhancements. One of the key benefits of using the claude-code-wakatime skill is the ability to gain visibility into your coding habits. While the exact time savings are currently unknown, users can expect to optimize their workflow by identifying time-consuming tasks and areas for improvement. This skill is particularly useful for developers, product managers, and AI practitioners who are looking to refine their coding efficiency and enhance their project management capabilities. By understanding how much time is spent on various tasks, users can streamline their processes and allocate resources more effectively. The skill is suitable for anyone involved in software development, particularly those who work with AI automation and workflow automation. Whether you are a solo developer or part of a larger team, the insights provided by claude-code-wakatime can help you refine your approach to coding. Practical use cases include tracking the time spent on specific features or projects, allowing teams to assess the feasibility of deadlines and improve project planning. For instance, a developer can analyze their time spent on debugging versus feature development, leading to better time management and prioritization. Implementing the claude-code-wakatime skill is straightforward, with a moderate difficulty level that typically requires around 30 minutes to set up. Users will need to ensure they have the necessary permissions and access to their coding environment for seamless integration. This skill fits perfectly into AI-first workflows, as it allows teams to leverage data-driven insights to enhance their development processes. By incorporating this skill into your routine, you can foster a culture of continuous improvement and efficiency within your coding practices.
[{"step":"Install and configure the plugin","action":"Run `npm install -g @wakatime/cli` to install WakaTime CLI, then configure it with your API key using `wakatime --key YOUR_API_KEY`. In Claude Code, enable the claude-code-wakatime extension and set your project name.","tip":"Use a dedicated WakaTime API key for Claude Code to keep metrics separate from other tools. The plugin will automatically track all file operations and AI interactions."},{"step":"Start a coding session","action":"Begin working in Claude Code as normal. The plugin will automatically log time spent in each file and project. Use the `/wakatime` command in Claude to see current session status.","tip":"For accurate tracking, avoid switching between projects without closing files. Use project-specific workspaces to maintain clean metrics separation."},{"step":"Generate productivity reports","action":"Use the prompt template to generate weekly reports. For daily insights, ask for session-specific breakdowns. Export reports in JSON for integration with other tools.","tip":"Schedule weekly report generation as a recurring task. Compare metrics week-over-week to identify productivity trends and optimization opportunities."},{"step":"Analyze AI usage patterns","action":"Review the 'top_sessions' data to identify your most productive AI-assisted sessions. Look for patterns in time of day, project types, and prompt complexity that correlate with high output.","tip":"Use the insights to optimize your AI prompting strategy. Consider creating prompt templates for frequently repeated tasks to reduce cognitive load and improve consistency."},{"step":"Integrate with team workflows","action":"Share anonymized metrics with your team to identify collective patterns. Use the data to optimize pair programming sessions or code review processes.","tip":"Set up team dashboards in WakaTime to compare individual and collective productivity metrics. Use this data to inform tooling and process improvements."}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/wakatime/claude-code-wakatimeCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Set up and configure the claude-code-wakatime plugin for my Claude Code environment. [INSTALL_PLUGIN: true/false] [API_KEY: your_wakatime_api_key] [PROJECT_NAME: your_project_name]. After setup, generate a productivity report for the last 7 days, including total time spent coding, lines of code generated by AI, and top 5 most time-consuming sessions. Export the report in JSON format for further analysis.
```json
{
"productivity_report": {
"timeframe": "last_7_days",
"total_time_spent_minutes": 420,
"total_lines_of_code": 1245,
"ai_generated_lines": 892,
"human_written_lines": 353,
"top_sessions": [
{
"session_id": "sess_987654",
"start_time": "2024-05-15T14:30:00Z",
"end_time": "2024-05-15T16:15:00Z",
"duration_minutes": 105,
"ai_prompts_count": 12,
"lines_generated": 210,
"project": "data_pipeline"
},
{
"session_id": "sess_543210",
"start_time": "2024-05-16T09:15:00Z",
"end_time": "2024-05-16T11:45:00Z",
"duration_minutes": 150,
"ai_prompts_count": 18,
"lines_generated": 345,
"project": "api_integration"
},
{
"session_id": "sess_123456",
"start_time": "2024-05-17T13:00:00Z",
"end_time": "2024-05-17T14:30:00Z",
"duration_minutes": 90,
"ai_prompts_count": 8,
"lines_generated": 156,
"project": "frontend_components"
},
{
"session_id": "sess_789012",
"start_time": "2024-05-18T10:00:00Z",
"end_time": "2024-05-18T12:45:00Z",
"duration_minutes": 165,
"ai_prompts_count": 22,
"lines_generated": 412,
"project": "backend_services"
},
{
"session_id": "sess_345678",
"start_time": "2024-05-19T11:30:00Z",
"end_time": "2024-05-19T13:15:00Z",
"duration_minutes": 105,
"ai_prompts_count": 15,
"lines_generated": 172,
"project": "database_migrations"
}
],
"insights": {
"most_productive_day": "2024-05-18",
"peak_ai_usage_hour": "10:00-12:00",
"average_prompts_per_session": 15,
"ai_contribution_percentage": 71.6
}
}
}
```
**Setup Confirmation:**
The claude-code-wakatime plugin has been successfully installed and configured with your API key. All coding sessions in Claude Code are now being tracked with WakaTime. The plugin captures real-time metrics including:
- Total active time spent in coding sessions
- Lines of code generated (both AI-assisted and human-written)
- Number of AI prompts used per session
- Project-specific breakdowns
**Key Observations:**
Your AI coding assistant generated 892 lines of code (71.6% of total output) across 75 prompts. The most productive session was on May 18th with 412 lines generated in 165 minutes. The data shows a clear pattern of using AI assistance most heavily during morning hours (10:00-12:00) when you're likely tackling complex implementation tasks.
**Recommendations:**
1. Consider reviewing the session from May 18th (sess_789012) as a template for optimal AI-assisted workflow
2. The high AI contribution percentage (71.6%) suggests you're effectively leveraging AI for routine coding tasks
3. Track the correlation between AI usage and code quality metrics over time to identify optimal balance pointsReal estate management platform for Mexico
AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan