← MCP server and skill grades

claude-code-wakatime

wakatime/claude-code-wakatime

C
Type
Plugin
Scanned
Nov 17, 2026
Version
95eba979962e
Files read
18

This Claude Code plugin tracks coding time and AI usage metrics by running the WakaTime CLI on session and tool hooks. Its biggest risks are that on Windows it will automatically run an untrusted wakatime-cli.exe if one exists in the opened project folder, and on all platforms it downloads and self-updates an unpinned wakatime-cli binary from GitHub without checksum verification.

What it can reach

Files
Reads ~/.wakatime.cfg, reads and writes ~/.wakatime/ (CLI binary, logs, internal config, lock and state files), reads Claude Code session transcript .jsonl files and writes .wakatime state files alongside them, and passes the current project folder to wakatime-cli.
Network
Connects to api.github.com and github.com to check for and download wakatime-cli releases, and connects to api.wakatime.com (or a configured server) to report unsupported platforms and sync AI coding activity via wakatime-cli.
Shell commands
Runs the wakatime-cli binary as a child process on Claude Code hook events, and falls back to running nix run nixpkgs#nodejs on Unix systems if node is absent and nix is installed.
Secrets
Reads proxy settings (including any embedded proxy credentials) from ~/.wakatime.cfg, and invokes wakatime-cli which reads the user's WakaTime API key from ~/.wakatime.cfg.

Findings

1 high2 medium2 low
  1. HighWindows hook resolves and runs wakatime-cli.exe from the current project folder

    src/dependencies.ts:259

    Before using its own binary in ~/.wakatime, the plugin calls which.sync('wakatime-cli.exe') to check for a global installation. On Windows, the which package always searches the current working directory before PATH. If a Windows user opens an untrusted repository containing a malicious wakatime-cli.exe in Claude Code, the plugin hook will automatically execute that file as soon as a prompt is submitted or a session ends, without the AI or user approving any tool call.

    Fix: Do not search process.cwd() when locating wakatime-cli on Windows; either check only explicit directories in PATH (excluding relative entries and the current working directory) or always use the managed binary inside ~/.wakatime.

  2. MediumEnabling no_ssl_verify disables TLS certificate checks for GitHub binary downloads

    src/dependencies.ts:120

    Users who connect to a self-hosted WakaTime server with a self-signed certificate often set no_ssl_verify = true in ~/.wakatime.cfg. The plugin reuses that same setting to disable TLS certificate verification when checking api.github.com and downloading the wakatime-cli executable zip from github.com. Because downloaded archives are not checksum- or signature-verified, anyone on the same network can intercept the download or 4-hour update check and run arbitrary code on the user's computer.

    Fix: Always enforce TLS certificate validation (rejectUnauthorized: true) when connecting to api.github.com and github.com to fetch executables, regardless of the no_ssl_verify setting used for WakaTime API traffic.

  3. MediumPlugin downloads and auto-updates an unpinned executable at runtime without checksum verification

    src/dependencies.ts:31

    When wakatime-cli is not already in PATH, the plugin downloads the latest release archive from GitHub into ~/.wakatime, extracts it, marks it executable, and runs it, then checks every 4 hours to replace it whenever a newer GitHub release appears. It pins no specific CLI version, verifies no SHA-256 checksum or signature, and follows HTTP redirects without blocking downgrades from HTTPS to HTTP.

    Fix: Pin a specific wakatime-cli release version per plugin version, verify the downloaded archive against a known SHA-256 checksum before extracting and running it, and reject redirects to non-HTTPS URLs.

  4. LowWindows batch launcher searches the current directory for node and keeps NODE_OPTIONS

    scripts/run.cmd:27

    If hooks are invoked through cmd.exe on Windows via scripts/run.cmd, running bare node searches the current project directory for node.cmd, node.bat, or node.exe before searching PATH, and unlike the Unix scripts/run wrapper it does not unset project-supplied NODE_OPTIONS. On standard Windows Claude Code setups hooks run through Git Bash using scripts/run instead, limiting exposure.

    Fix: Clear NODE_OPTIONS, set NoDefaultCurrentDirectoryInExePath=1, and resolve node.exe explicitly from PATH using where "$PATH:node.exe" before executing it.

  5. LowDebug mode writes raw prompts, tool outputs, and proxy credentials to claude-code.log

    src/index.ts:49

    When debug = true is set in ~/.wakatime.cfg, the plugin serializes the entire JSON object read from stdin into ~/.wakatime/claude-code.log (and dependencies.ts also logs the full proxy URL including any username and password). Because JSON.parse keeps all fields sent by Claude Code hooks, this writes full user prompts, tool inputs, and tool outputs into a log file created with default OS permissions rather than owner-only (0600) permissions.

    Fix: Log only non-sensitive metadata fields (such as hook_event_name and session_id), redact credentials from proxy URLs before logging, and create ~/.wakatime/claude-code.log with mode 0600.