#403·caveman

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

  1. Hardcoded Config Directory: src/hooks/caveman-stats.js defaults to ~/.claude. Gemini CLI uses ~/.gemini.
  2. Session Log Mismatch: The script searches for projects/*.jsonl files 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.
  3. Missing Transcript Path: The hook in caveman-mode-tracker.js expects a transcript_path property 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

  1. Install caveman extension in Gemini CLI.
  2. Run any prompt to generate token usage.
  3. Type /caveman-stats.
  4. Command may auto-prefix to /caveman:caveman-stats.
  5. 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