pi-wakatime
WakaTime plugin for Pi Coding Agent
Package details
Install pi-wakatime from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-wakatime- Package
pi-wakatime- Version
1.1.0- Published
- Apr 22, 2026
- Downloads
- 174/mo · 155/wk
- Author
- ttttmr
- License
- MIT
- Types
- extension
- Size
- 37.5 KB
- Dependencies
- 1 dependency · 0 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
WakaTime for Pi
Track your Pi usage, lines of code generated, time spent prompting the agent, and file activity with WakaTime.
WakaTime is an open source plugin ecosystem for metrics, insights, and automatic time tracking generated from your programming activity.
This project is intentionally modeled after wakatime/claude-code-wakatime, adapted for Pi's extension event model.
Installation
pi install npm:pi-wakatime
Then add your WakaTime API key to ~/.wakatime.cfg:
[settings]
api_key = your_wakatime_api_key
How It Works
Because Pi uses extension lifecycle events instead of Claude hook scripts, this plugin maps Pi events onto the same heartbeat concepts where possible:
turn_start→ prompt / AI activity heartbeattool_call→ pre-tool activity heartbeattool_result→ post-tool activity heartbeatsession_before_compact→ pre-compact activity heartbeatsession_shutdown→ session end heartbeatread/write/edittool results → file heartbeats
The plugin also:
- finds a global
wakatime-cliwhen available - installs a local
wakatime-cliinto~/.wakatime/when needed - checks for updates to the local CLI periodically
- respects WakaTime
proxyandno_ssl_verifysettings - stores throttle state in
~/.wakatime/pi-wakatime-state.json - writes extension logs to
~/.wakatime/pi-wakatime.log
Usage
Open Pi as usual and work normally. Once your API key is configured, heartbeats are sent in the background.
You should see activity on your WakaTime dashboard for:
- your current project folder
.pi-sessionsynthetic session activity- individual files read or modified by Pi
- AI-assisted line changes for
writeandedit
Development
Run the test suite:
npm test
Troubleshooting
Check that Pi can load the extension:
pi -e ./src/index.ts
Enable debug logging in ~/.wakatime.cfg:
[settings]
debug = true
Then inspect logs:
tail -f ~/.wakatime/pi-wakatime.log
If no activity appears in WakaTime:
- verify
~/.wakatime.cfgcontains a validapi_key - inspect
~/.wakatime/pi-wakatime.log - check whether
~/.wakatime/wakatime-cliexists - confirm Pi is actually loading the extension
If wakatime-cli download fails:
- verify network access to GitHub releases
- verify proxy settings in
~/.wakatime.cfg - install
wakatime-cliglobally as a fallback
Credits
- Inspired by wakatime/claude-code-wakatime
- Built for Pi Coding Agent