BayramAnnakov/activitywatch-analysis-skill
Claude Code skill for weekly productivity analysis using ActivityWatch data. Calculates focus scores, detects death loops, generates actionable insights.
Deep Analysis
ActivityWatch数据的每周生产力分析技能,计算专注分数,检测死循环模式,生成可执行洞察
Core Features
Technical Implementation
- 双重评分 - 生产力+专注分开评估
- 死循环检测 - 识别注意力碎片化模式
- AI工具识别 - Claude Code等视为生产活动
- 灵活输入 - API直接获取或CSV导入
- 可执行建议 - 具体屏蔽指南
- 每周生产力回顾
- 识别分心模式
- 优化工作流程
- 追踪专注时间
- 评估AI工具使用
- 依赖ActivityWatch安装
- 需要Python 3.8+
- 分类配置需调优
- 仅分析不干预
- 英文输出
ActivityWatch Analysis Skill
A Claude Code skill for weekly productivity analysis using ActivityWatch data. Calculates focus scores, detects "death loops" (repetitive app switching), and generates actionable insights.
Features
- Smart Auto-Categorization: Classifies activities into productive/neutral/distracting
- AI Agent Detection: Recognizes Claude Code, Codex, Aider, GitHub Copilot as productive workflows
- Dual Scoring: Productivity score (what you worked on) + Focus score (attention quality)
- Deep Browser Analysis: Site-level breakdown (Netflix, GitHub, ChatGPT) with productivity ratios
- Death Loop Detection: Identifies repetitive app switching patterns with fix suggestions
- Actionable Insights: Specific recommendations with blocking guides
- Customizable Categories: JSON config to tune for your workflow
- Timezone Support: Correctly handles ActivityWatch UTC timestamps
Requirements
- Python 3.8+
- ActivityWatch installed and running
- Optional:
aw-clientfor direct API access (pip install aw-client)
Quick Start
Option 1: Direct API Fetch (Recommended)
If you have aw-client installed (pip install aw-client), you can fetch data directly from ActivityWatch:
# Analyze today's productivity
python scripts/analyze_aw.py --fetch --from today --report --timezone America/Los_Angeles
# Analyze yesterday
python scripts/analyze_aw.py --fetch --from yesterday --report
# Analyze the past week
python scripts/analyze_aw.py --fetch --from week --report
# Analyze specific date range
python scripts/analyze_aw.py --fetch --from 2025-12-20 --to 2025-12-26 --report
# Analyze last 7 days
python scripts/analyze_aw.py --fetch --from 7d --report
Supported date formats:
- Keywords:
today,yesterday,week - Relative:
7d(7 days ago),2w(2 weeks ago) - Absolute:
YYYY-MM-DD(e.g.,2025-12-26)
Option 2: CSV Export (Fallback)
If you don't have aw-client or prefer manual export:
- Open ActivityWatch (
http://localhost:5600) → Raw Data → Export → CSV - Run analysis:
# Human-readable report (uses system timezone)
python scripts/analyze_aw.py export.csv --report
# With explicit timezone
python scripts/analyze_aw.py export.csv --timezone America/Los_Angeles --report
# With custom categories
python scripts/analyze_aw.py export.csv --config scripts/category_config.json --report
# JSON output for automation
python scripts/analyze_aw.py export.csv > summary.json
Recommended Workflow
Before trusting a weekly report, spot-check with a single day's data:
- Spot-check first: Verify timezone, idle time, and categories match your experience
- Fix issues: Adjust timezone or config if needed
- Run full analysis: Once validated, trust the weekly report
Understanding Your Scores
Combined Score (0-100)
| Range | Interpretation |
|---|---|
| 80-100 | Excellent - Deep work patterns, minimal distractions |
| 60-79 | Good - Solid productivity with room to improve |
| 40-59 | Moderate - Attention fragmented, review death loops |
| 0-39 | Needs work - High distraction, consider app blockers |
Productivity vs Focus
- Productivity Score: Measures what you spent time on (deep work vs. entertainment)
- Focus Score: Measures how you worked (sustained attention vs. constant switching)
You can have high productivity but low focus (doing good work but constantly interrupted) or vice versa.
Death Loops
Death loops are repetitive A↔B app switches that fragment your attention.
| Verdict | Meaning | Action |
|---|---|---|
| 🤖 ai_assisted | AI coding agent active (Claude Code, Codex) | Productive workflow |
| 🟢 productive | Normal workflow (IDE ↔ Terminal) | Consider split screen |
| 🟡 mixed | Could go either way | Batch these activities |
| 🔴 distracting | Attention leak | Block during focus hours |
See references/blocking_guides.md for step-by-step setup of macOS Focus Mode, Cold Turkey, and other blocking tools.
Customizing Categories
Edit scripts/category_config.json to match your workflow:
{
"my_product": {
"weight": 0.8,
"description": "My SaaS product work",
"apps": [],
"titles": ["MyApp", "myapp.com"]
}
}
Weight scale:
1.0= Deep work (Terminal, IDE)0.7-0.9= Productive (AI tools, writing)0.5= Mixed (meetings)0.3= Shallow (email, chat)0.0= Neutral (system utilities)-0.2 to -0.5= Distracting (entertainment, social)
Weekly Review Ritual
Every Sunday (15 min):
- Export week's data from ActivityWatch (CSV)
- Run:
python scripts/analyze_aw.py export.csv --report - Review the "One Change" recommendation
- Implement one intervention
- Track score improvement next week
Integration with Claude Code
As a Claude Code skill, you can ask:
"Analyze my ActivityWatch export from this week"
"Show me my death loops and how to fix them"
"What are my peak productive hours?"
Files
activitywatch-analysis-skill/
├── SKILL.md # Skill definition (AgentSkills.io format)
├── README.md # This file
├── scripts/
│ ├── analyze_aw.py # Main analyzer (928 lines)
│ └── category_config.json # Customizable categories
└── references/
├── analysis_prompts.md # Prompts for deeper analysis with LLMs
└── blocking_guides.md # How to implement blocking recommendations
Privacy
All analysis runs locally. No data leaves your machine unless you choose to share it.
License
MIT
Author
Bayram Annakov (@BayramAnnakov)
Related Skills
BayramAnnakov/claude-reflect
BayramAnnakovA self-learning system for Claude Code that captures corrections, positive feedback, and preferences — then syncs them to CLAUDE.md and AGENTS.md.
BayramAnnakov/notebooklm-youtube-skill
BayramAnnakovA Claude skill that automates NotebookLM notebook creation from YouTube videos — research featured people, add sources, and generate Audio Overviews automatically
BayramAnnakov/2026-coach
BayramAnnakovExecutive coaching skill for planning your 2026 using research-backed process goals. Works with Claude Code and Claude.ai.
BayramAnnakov/telegram-assistant-skill
BayramAnnakovClaude Code skill for Telegram automation: digests, style extraction, channel posting
BayramAnnakov/founder-voice-ghostwriter
BayramAnnakovAgent skill for collaborative ghostwriting for founders and experts
BayramAnnakov/ux-waiting-audit
BayramAnnakovAudit UX waiting states for web apps with long-running operations. Claude Code skill with browser automation.

