explaingit

daniel-farina/grokscope

Analysis updated 2026-05-18

2JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A local monitoring toolkit that reads the Grok CLI's session files to show token usage, cost, and code changes in a live dashboard.

Mindmap

mindmap
  root((grokscope))
    What it does
      Reads Grok CLI telemetry
      Shows tokens and cost
      Shows lines of code changed
    Tech stack
      JavaScript
      Express
      Vite
      Server Sent Events
    Use cases
      Web dashboard
      Terminal dashboard
      API call proxy
    Audience
      Developers
      Grok CLI users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

See total tokens used and cost across all Grok CLI sessions in one live dashboard

USE CASE 2

Track lines of code added and removed by the Grok AI coding agent

USE CASE 3

Capture per-call API cost and token detail by proxying Grok CLI traffic

What is it built with?

JavaScriptExpressViteServer-Sent Events

How does it compare?

daniel-farina/grokscope901d3/ditherxyr.jsash310u/awesome-ai-stack
Stars222
LanguageJavaScriptJavaScriptJavaScript
Last pushed2026-06-20
MaintenanceActive
Setup difficultyeasymoderateeasy
Complexity2/52/52/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Reads local telemetry files the Grok CLI already writes, runs entirely on localhost.

In plain English

grokscope is a monitoring tool for the Grok CLI, an AI coding agent made by xAI. The Grok CLI shows only the current conversation turn in its interface, so there is no built-in way to see how many tokens you have used across all sessions today, what your total cost is, or how many lines of code the agent has written. grokscope fills that gap by reading the telemetry files that Grok already writes locally to ~/.grok/sessions/ and presenting the data in a live dashboard. It has three components you can use independently or together. The web dashboard is a browser-based interface built with Vite and Express that shows tokens per session, lines of code added and removed, a tool usage histogram (which operations like read_file, search_replace, and write the agent uses most), and recent file edits. It updates live via Server-Sent Events. The CLI dashboard (grokscope-cli) is a terminal-based alternative for people who want the same information without switching to a browser. The reverse proxy (grokscope-tap) sits between the Grok CLI and the xAI API and captures detailed per-call data, input tokens, output tokens, cached input tokens, and cost in USD per API call, information the session files alone do not contain. Everything runs locally and binds only to 127.0.0.1. No data is uploaded anywhere. The backend is written in vanilla JavaScript using Express, and the frontend uses vanilla JavaScript without a charting library, bar charts are rendered as CSS divs. You would reach for this if you run the Grok CLI regularly and want visibility into token usage and cost across sessions.

Copy-paste prompts

Prompt 1
Help me set up grokscope's web dashboard to monitor my Grok CLI token usage.
Prompt 2
Show me how to use grokscope-tap as a reverse proxy to capture per-call cost data.
Prompt 3
Explain how grokscope reads telemetry from ~/.grok/sessions/ to build its dashboard.
Prompt 4
Help me run the terminal-based grokscope-cli dashboard instead of the browser version.

Frequently asked questions

What is grokscope?

A local monitoring toolkit that reads the Grok CLI's session files to show token usage, cost, and code changes in a live dashboard.

What language is grokscope written in?

Mainly JavaScript. The stack also includes JavaScript, Express, Vite.

How hard is grokscope to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is grokscope for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.