Skip to content

bug: RangeError "Maximum call stack size exceeded" when a source returns >100k messages #9

Description

@stephanschuler

What happened?

mu aborts with ❌ Error fetching usage data: Maximum call stack size exceeded and prints no table at all. Nothing is corrupt — it is purely volume: my ~/.claude/projects/ holds 120,654 assistant messages.

autoDetect merges the per-source results with a spread (src/usage.ts:76):

allMessages.push(...messages);

Every message becomes its own argument, and V8 throws once the argument count reaches roughly 100k. The same pattern sits in src/sources/claude.ts:64 and src/sources/pi.ts:64, still below the threshold because those accumulate per directory.

-t and -p are no workaround — filtering happens after the merge.

Expected: the usage table, same as with a smaller history.

Steps to reproduce

# Requires a Claude Code history with >100k assistant messages
# (mine: ~/.claude/projects/, 120654 messages)

$ mu -s claude
❌ Error fetching usage data: Maximum call stack size exceeded

$ mu
❌ Error fetching usage data: Maximum call stack size exceeded

# The source adapter itself is fine — only the merge fails:
$ node -e "require('./dist/sources/claude.js').readSessions().then(r => console.log(r.messages.length))"
120654

Which data sources are affected?

Claude Code

mu version

3.1.1

Environment

macOS 26.6.2, Node v22.23.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions