caveman-stats fail in Gemini CLI due to hardcoded Claude Code paths and log format
Author: bankierubybankCreated May 17, 2026Updated Sep 17, 2026
Labelsbug
Bug: caveman-stats incompatible with Gemini CLI environment
Description
The /caveman-stats command fails to report token usage when running inside the Gemini CLI. The extension appears to be tightly coupled with the Claude Code file structure and log format.
Root Causes
- Hardcoded Config Directory:
src/hooks/caveman-stats.jsdefaults to~/.claude. Gemini CLI uses~/.gemini. - Session Log Mismatch: The script searches for
projects/*.jsonlfiles using Claude Code's schema. Gemini CLI stores history in Git repositories (~/.gemini/history/) or local JSON logs (~/.gemini/tmp/.../logs.json), which have different structures. - Missing Transcript Path: The hook in
caveman-mode-tracker.jsexpects atranscript_pathproperty in the hook payload. If Gemini CLI does not provide this, or if the path format differs, the script cannot find the active session.
Steps to Reproduce
- Install
cavemanextension in Gemini CLI. - Run any prompt to generate token usage.
- Type
/caveman-stats. - Command may auto-prefix to
/caveman:caveman-stats. - Result: "caveman-stats: no Claude Code session found" or "No sessions logged yet".
Expected Behavior
The extension should detect if it is running in Gemini CLI and adapt its log-parsing logic to read from ~/.gemini/history or the active temporary session log.
Environment
- OS: Darwin (macOS)
- CLI: Gemini CLI
- Extension Version: 1.0.1
Source: JuliusBrussee/caveman