xiaoqi-token-stats

Pass

Audited by Gen Agent Trust Hub on Aug 20, 2026

Risk Level: SAFECOMMAND_EXECUTIONEXTERNAL_DOWNLOADS
Full Analysis
  • [COMMAND_EXECUTION]: The scripts token_calendar.py and token_stats.py utilize subprocess.run to open the generated HTML reports in the system's default browser. This is implemented safely by passing arguments as a list and avoiding the shell=True parameter, which prevents command injection.
  • [DATA_EXPOSURE]: The skill accesses ~/.claude/projects/ to read JSONL session logs. This directory contains sensitive chat history; accessing it is necessary for the skill's primary purpose of calculating token usage statistics.
  • [EXTERNAL_DOWNLOADS]: The generated HTML reports reference resources from well-known services, including Google Fonts (fonts.googleapis.com) for typography and JSDelivr (cdn.jsdelivr.net) for the Chart.js library. These are standard practices for data visualization and do not constitute a security risk.
  • [INDIRECT_PROMPT_INJECTION]:
  • Ingestion points: Reads metadata and usage fields from .jsonl files located in ~/.claude/projects/ (in both token_stats.py and token_calendar.py).
  • Boundary markers: Not explicitly used, but the skill selectively extracts only numeric usage data and specific metadata (model names, timestamps), ignoring message content.
  • Capability inventory: The skill has the capability to write a local HTML file and trigger a system command to open it.
  • Sanitization: Employs json.dumps() to safely serialize and embed the collected data into the HTML template's JavaScript context, preventing potential cross-site scripting (XSS) or injection during rendering.
Audit Metadata
Risk Level
SAFE
Analyzed
Aug 20, 2026, 09:11 AM
Security Audit — agent-trust-hub — xiaoqi-token-stats