setup-wakatime
Skill64 starsChanged 14 days agoMITView on GitHub
Set up WakaTime time-tracking for Claude Code and VS Code.
- Installs packages
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- iwesys/IWEedited, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- iwesys/IWE★ 039% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-faultSkill
- apply-capturesSkill
- archgateSkill
- artifactorSkill
- audit-docsSkill
- audit-installationSkill
- author-modeSkill
- bottleneck-pickSkill
- check-secretSkill
- consentSkill
- day-closeSkill
- day-openSkill
- decomposeSkill
- diagnoseSkill
- discovery-sessionSkill
- extendSkill
- find-methodSkill
- fpfSkill
- integration-gateSkill
- iwe-bug-reportSkill
- iwe-platform-redteamSkill
- iwe-restoreSkill
- iwe-rules-reviewSkill
- iwe-updateSkill
- keSkill
- kimi-peer-writerSkill
- local-llmSkill
- mentor-participant-briefSkill
- month-closeSkill
- onboardingSkill
- org-devSkill
- pack-creatorSkill
- pack-newSkill
- peer-conversationSkill
- personal-guide-renderSkill
- personal-guide-startSkill
- platform-bottleneckSkill
- repo-newSkill
- restore-exocortexSkill
- run-protocolSkill
- skill-creatorSkill
- strategy-sessionSkill
- skill-id # kebab-case, уникален в skills-catalog.yamlSkill
- thinkSkill
- transcribeSkill
- vdvSkill
- verify-hypothesesSkill
- verifySkill
- week-close-pilotSkill
- week-closeSkill
- wp-newSkill
- w-reflectionSkill
The file
Files
Setup WakaTime Time Tracking
Автоматическая настройка WakaTime для отслеживания рабочего времени.
Что устанавливается
- wakatime-cli — CLI для отправки heartbeat'ов
- Хук Claude Code — автоматический трекинг при работе с Claude (категория "AI Coding")
- WakaTime Desktop App (опционально) — трекинг фокуса окна (чтение, браузер)
Инструкция для Claude
Выполни шаги последовательно. На каждом шаге проверяй, не сделано ли уже.
Шаг 1: wakatime-cli
# Проверить наличие (маска, не точное имя — issue #1151: расширение VS Code
# на Windows скачивает бинарь как wakatime-cli-windows-amd64.exe)
ls ~/.wakatime/wakatime-cli* 2>/dev/null || wakatime-cli --version 2>/dev/nullЕсли не установлен — путь зависит от ОС:
macOS:
brew install wakatime-cli
mkdir -p ~/.wakatime
ln -sf $(which wakatime-cli) ~/.wakatime/wakatime-cliWindows (issue #1151): нет пакетного менеджера для прямой установки CLI.
Поставь расширение WakaTime для VS Code (Extensions → WakaTime) — оно само
скачивает бинарь в ~/.wakatime/wakatime-cli-windows-amd64.exe при первом
запуске. Дальше шаги 2-4 работают как есть: скрипты шаблона ищут файл по
маске wakatime-cli*, не по точному имени. Альтернатива без WakaTime вообще:
ActivityWatch через extensions/day-close.before.*.md (см. README расширения).
Linux: см. https://wakatime.com/plugins — пакет под дистрибутив или
скачать бинарь вручную в ~/.wakatime/wakatime-cli.
Шаг 2: API Key
cat ~/.wakatime.cfg 2>/dev/nullЕсли файл не существует или нет api_key:
- Скажи пользователю: «Нужен WakaTime API-ключ. Получи его на https://wakatime.com/settings/api-key (нужна регистрация). Не присылай ключ мне в чат — платформа всё равно блокирует печать секретов в сессии (
secret-leak-block.sh), а ключ лишний раз попадёт в историю разговора. Вместо этого выполни сам в терминале (замени<ключ>на свой):»
mkdir -p ~/.wakatime 2>/dev/null; cat > ~/.wakatime.cfg <<'EOF'
[settings]
api_key = <ключ>
EOF- Дождись, когда пользователь скажет, что выполнил
- Проверь наличие ключа без вывода самого значения:
test -s ~/.wakatime.cfg && grep -q '^api_key' ~/.wakatime.cfg && echo "ключ на месте" - Время за прошлые дни (закрытие дня после полуночи,
week-draft-append.sh): WakaTime может отвечать 403 на сводки по ключу плагина (issue #1451). Тогдаscripts/wakatime-day-total.pyберёт только сегодняшний день, а для прошлых дней нужен личный OAuth-токен (https://wakatime.com/oauth) в переменной окруженияWAKATIME_OAUTH_TOKEN— пользователь задаёт её сам, токен в чат не присылать.
Шаг 3: Хук-скрипт
Этот хук не входит в поставку шаблона (снят с платформы в v0.34 — user-installed hook only, issue #215): создай файл напрямую с этим содержимым, не копируй из репозитория.
mkdir -p ~/.claude/hooks
cat > ~/.claude/hooks/wakatime-heartbeat.sh << 'EOF'
#!/bin/bash
# Claude Code → WakaTime heartbeat hook
# Sends heartbeats to track AI coding time per project.
# Events: UserPromptSubmit, PostToolUse, Stop
INPUT=$(cat)
CWD=$(echo "$INPUT" | jq -r '.cwd // empty')
EVENT=$(echo "$INPUT" | jq -r '.hook_event_name // empty')
TOOL=$(echo "$INPUT" | jq -r '.tool_name // empty')
# Detect project from git or folder name
if [ -n "$CWD" ] && [ -d "$CWD" ]; then
PROJECT=$(cd "$CWD" && git config --local remote.origin.url 2>/dev/null | sed 's#.*/\([^.]*\)#\1#;s#\.git$##')
PROJECT=${PROJECT:-$(basename "$CWD")}
else
PROJECT="Unknown"
fi
# Category based on event/tool
CATEGORY="ai coding"
if [ "$EVENT" = "PostToolUse" ]; then
case "$TOOL" in
WebSearch|WebFetch) CATEGORY="researching" ;;
Read|Grep|Glob) CATEGORY="code reviewing" ;;
Edit|Write) CATEGORY="coding" ;;
esac
fi
# Resolve the CLI binary by mask, not exact name — issue #1151: the VS Code
# WakaTime extension on Windows downloads it as wakatime-cli-windows-amd64.exe.
WAKATIME_CLI=$(ls -d "$HOME"/.wakatime/wakatime-cli* 2>/dev/null | head -1)
[ -z "$WAKATIME_CLI" ] && exit 0
# Send heartbeat in background (non-blocking, silent)
("$WAKATIME_CLI" \
--entity-type app \
--entity "Claude Code" \
--category "$CATEGORY" \
--project "$PROJECT" \
--plugin "claude-code-wakatime/0.1.0" \
--write \
>/dev/null 2>&1 &)
exit 0
EOF
chmod +x ~/.claude/hooks/wakatime-heartbeat.shШаг 4: Настройка хуков в settings.json
Прочитай ~/.claude/settings.json. Добавь в секцию hooks (не затирая существующие хуки):
- UserPromptSubmit — добавь hook group:
{"hooks": [{"type": "command", "command": "~/.claude/hooks/wakatime-heartbeat.sh"}]} - PostToolUse — добавь:
{"hooks": [{"type": "command", "command": "~/.claude/hooks/wakatime-heartbeat.sh", "async": true}]} - Stop — добавь:
{"hooks": [{"type": "command", "command": "~/.claude/hooks/wakatime-heartbeat.sh", "async": true}]}
Шаг 5: WakaTime Desktop App (только macOS — спроси пользователя)
На Windows/Linux нет brew-эквивалента в этом шаге — пропусти его молча
(ActivityWatch из шага 1 уже закрывает трекинг фокуса окна там, где нужен).
Спроси: «Установить WakaTime Desktop App? Он трекает время фокуса окна (когда читаешь ответы, работаешь в браузере). Требует Accessibility-разрешение в macOS.»
Если да:
brew install --cask wakatime
open -a WakaTimeСкажи: «Разреши Accessibility доступ в System Settings → Privacy & Security → Accessibility.»
Шаг 6: Тест
echo '{"cwd": "'$(pwd)'", "hook_event_name": "UserPromptSubmit", "prompt": "test"}' | ~/.claude/hooks/wakatime-heartbeat.sh
sleep 3
WAKA_CLI=$(ls -d ~/.wakatime/wakatime-cli* 2>/dev/null | head -1)
"$WAKA_CLI" --todayПокажи результат пользователю. Скажи: «Хуки подхватятся при следующем запуске Claude Code (хуки загружаются при старте сессии).»
Шаг 7: Итог
Покажи таблицу:
| Компонент | Статус |
| wakatime-cli | ✅/❌ |
| API key | ✅/❌ |
| Хук-скрипт | ✅/❌ |
| Хуки в settings.json | ✅/❌ |
| Desktop App | ✅/❌/пропущен |
| Тест heartbeat | ✅/❌ |
Скажи: «Дашборд: https://wakatime.com/dashboard. Данные появятся через 5-15 минут.»
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

