Skip to content

daulet/mot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mot

Count used tokens and estimate project cost.

sample

Usage

mot # scoped to current directory
mot --all # aggregation across all local sessions
mot --since 7d # only count tokens in last week
mot --session 019d8e7f # only count one local session by id, id prefix, file name, or path
mot --select-session # choose a scoped local session with an arrow-key picker
mot --no-activity-calendar # hide the activity calendar
mot --exclude-unknown-models # drop usage records whose model is missing or unpriced
mot --all --since 1m # all sessions, only count tokens in past month
mot --all --host vm-a --host vm-b # include remote VM sessions over SSH

Sample output:

Scanned: codex 1440 files, claude 339 files in 273 ms
Counted: codex 26 sessions, claude 250 assistant responses

Provider            Input         Output       Thinking     Cache Read    Cache Write      Est. Cost
Codex         143,995,252        785,532        467,276    135,731,584              0        $286.74
Claude             10,123            981              0     19,440,609        343,559         $10.01
Total         144,005,375        786,513        467,276    155,172,193        343,559        $296.75

By model:
Provider   Model                                 Input         Output       Thinking     Cache Read    Cache Write      Est. Cost
Codex      gpt-5.3-codex                   137,210,240        677,634        395,340    129,502,336              0        $272.27
Codex      gpt-5.2-codex                     6,785,012        107,898         71,936      6,229,248              0         $14.47
Claude     claude-opus-4-5-20251101              1,396            336              0     17,359,560        108,704          $9.37
Claude     claude-haiku-4-5-20251001             8,723            168              0      2,059,925        213,354        $0.4822
Claude     claude-opus-4-6                           4            477              0         21,124         21,501        $0.1569

When stdout is an interactive terminal, table output also renders a GitHub-style Ratatui activity calendar for the last 53 weeks. Squares are shaded by daily token activity. Activity days and peak hour are bucketed with the current local timezone offset of the mot process. Activity days come from the same timestamped usage records as the daily rollups:

  • Codex: token-count event deltas are assigned to each event timestamp, so a session that spans multiple days contributes to each active day.
  • Claude: assistant responses are deduplicated by request/message id, then assigned to their response timestamp.

The calendar footer shows favorite model, total tokens, sessions, largest session by token volume, current and longest streaks, active days since first activity in the displayed calendar range, longest session by duration, and peak hour.

The footer also includes a randomly selected book-scale comparison. Book word counts are converted to estimated tokens using the English rule of thumb that one token is roughly three quarters of a word.

Install

# Linux/macOS quick install
curl -fsSL https://github.com/daulet/mot/releases/latest/download/install.sh | sh

# Ubuntu/Debian package install
curl -fsSL https://github.com/daulet/mot/releases/latest/download/install.sh | sh -s -- --deb

# Homebrew on macOS
brew install daulet/tap/mot

# From source (latest main)
cargo install --git https://github.com/daulet/mot

Linux release artifacts include x86_64-unknown-linux-gnu builds produced on Ubuntu 22.04, matching Ubuntu 22.04 x86_64 VMs, plus aarch64-unknown-linux-gnu for ARM Linux hosts. The quick installer verifies checksums.txt before installing.

Remote VMs

mot can aggregate sessions from remote hosts over SSH:

mot --all --host user@vm-a --host user@vm-b

Notes:

  • Remote scanning reads the same default directories as local mode: ~/.codex/sessions and ~/.claude/projects.
  • To bootstrap a Linux remote, run curl -fsSL https://github.com/daulet/mot/releases/latest/download/install.sh | sh on that host.
  • It shells out to local ssh and runs mot --json on the remote host, so mot must be installed remotely and available in PATH.
  • Remote activity stats are requested with the caller's local timezone offset so calendar days, streaks, and peak hour use one shared boundary before reports are merged.
  • If a remote host has an older/incompatible mot (or missing mot), that host is skipped and surfaced in Warnings output.
  • For cross-host aggregation, --all is usually the right choice because scoped mode still filters by the recorded session cwd.
  • Compatibility aliases still work: --global, --window, and --ssh-host.

About

cloc for your tokens

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors