Skip to content

[Claude Code Usage (ccusage)] Broken after ccusage v19.0.0 — JSON schema mismatch #28037

Closed

Description

@Tosd0

Extension

https://raycast.com/nyatinte/ccusage

Raycast Version

1.104.17

OS Version

26.3.1 (25D2128)

Description

After ccusage released v19.0.0 (published May 17, 2026), the extension fails to parse the JSON output from ccusage session --json.

The extension's Zod schema expects a "sessions" (plural) key, but ccusage v19 outputs "session" (singular):

{
  "session": [
    {
      "period": "00d27b82-...",
      "agent": "claude",
      ...
    }
  ]
}

This causes a validation error on all commands that depend on session data (Today, Sessions, Costs).

The Usage Limits tabs still work, as it doesn't rely on this field.

Pinning to npx [email protected] resolves the issue, confirming it's a v18 → v19 breaking change.

Steps To Reproduce

  1. Have ccusage v19.0.0+ installed (or use npx ccusage@latest, which now resolves to v19.0.3)
  2. Open any ccusage command in Raycast (e.g. Today, Sessions, Costs)
  3. Extension throws Invalid session usage data error

Current Behaviour

Extension crashes with:

Error: Invalid session usage data: [
  {
    "code": "invalid_type",
    "expected": "array",
    "received": "undefined",
    "path": ["sessions"],
    "message": "Required"
  }
]
    at Object.parseOutput [as current] (/Users/.../.config/raycast/extensions/.../ccusage.js:11:75267)

Expected Behaviour

Extension should correctly parse ccusage v19's JSON output and display usage data as before. The Zod schema should be updated to match the new output format (e.g. "session" instead of "sessions").

Activity

  1. added
    bug
    extension
    on May 17, 2026
  2. added theissue type on May 17, 2026
  3. added
    extension: ccusage
    on May 17, 2026
  4. raycastbot commented on May 17, 2026

    @raycastbot
    Collaborator

    Thank you for opening this issue!

    🔔 @nyatinte @zhuravel @nyatinte @GarrickZ2 @pernielsentikaer @raulgg @ridemountainpig you might want to have a look.

    💡 Author and Contributors commands

    The author and contributors of nyatinte/ccusage can trigger bot actions by commenting:

    • @raycastbot close this issue Closes the issue.
    • @raycastbot close as not planned Closes the issue as not planned.
    • @raycastbot close as duplicate Closes the issue as duplicate.
    • @raycastbot rename this issue to "Awesome new title" Renames the issue.
    • @raycastbot reopen this issue Reopens the issue.
    • @raycastbot assign me Assigns yourself to the issue.
    • @raycastbot good first issue Adds the "Good first issue" label to the issue.
    • @raycastbot keep this issue open Make sure the issue won't go stale and will be kept open by the bot.
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

    bugextensionextension: ccusage

    Type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions