{
  "id": 22810200,
  "title": "Reading Three AI Agents' Usage Limits From Their Own Sign-Ins, Without Ever Writing Them",
  "url": "https://urgent.news/2026/11/30/reading-three-ai-agents-usage-limits-from-their-own-sign-ins-without",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-30T15:08:13.000Z",
  "source": {
    "name": "HackerNoon",
    "slug": "hackernoon",
    "url": "https://hackernoon.com/reading-three-ai-agents-usage-limits-from-their-own-sign-ins-without-ever-writing-them?source=rss"
  },
  "original_language": null,
  "account": "This article details how the open-source Swift app, gas, can read the usage limits of three AI agents - Claude Code, OpenAI's Codex, and Grok - without writing the applications themselves. All three tools have their own session window and weekly cap, but they do not offer a public \"how much of my plan have I used\" API. Each AI agent stores its credentials in different locations, requiring gas to bypass security measures.\n\nThe key challenge was reading Claude Code's OAuth token from macOS Keychain, as simply reading it with SecItemCopyMatching reset the item's access list each time. The fix was to read the token through the secure binary, /usr/bin/security, which always remains on the item's access list and avoids prompts. Similarly, Codex stores its sign-in in ~/.codex/auth.json, and gas only reads the access token and account ID, avoiding the need to refresh the token itself.\n\nFor Grok, gas attempted to start the CLI's agent and ask for billing information using the Agent Client Protocol. However, this approach was rejected due to complexity. The article concludes with a diagram showing the overall architecture, split into a SwiftPM package, UsageCore, containing around 440 tests, and a thin SwiftUI and AppKit shell.",
  "summary": "How I built a macOS menu bar app that reads Claude Code, Codex and Grok plan limits: Keychain tricks, undocumented endpoints, and bugs found after shipping.",
  "summary_source": "publisher",
  "key_points": [],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "outlets_capped": false,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}