Repository navigation
API change + more usage - #1
Open
martinKupec wants to merge 6 commits into
Open
martinKupec wants to merge 6 commits into
martinKupec wants to merge 6 commits into
Conversation
Switches authentication from manual browser session cookie to the OAuth token written by Claude Code CLI, so no credentials need to be entered manually. Uses the Anthropic OAuth usage endpoint instead of the claude.ai web API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- pack.sh wraps gnome-extensions pack with the extra sources (credentials.js, claude-session-hook.py) to produce a distributable zip - install.sh now copies claude-session-hook.py to the extension directory so hooks in ~/.claude/settings.json can point to the installed path - README updated with installed hook path and packing instructions - .gitignore excludes the generated .shell-extension.zip Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dynamically inserts menu items for every non-null usage bucket returned by the API (Sonnet, Opus, Claude Cowork, Claude Design, etc.) between the weekly section and the last-updated line. Items are rebuilt on each refresh. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The /api/oauth/usage endpoint shares a tight per-token rate-limit bucket that the extension routinely trips. Claude Code's own /usage falls back to anthropic-ratelimit-unified-* response headers populated by regular /v1/messages traffic, which is why it keeps working when /api/oauth/usage is 429. This adds a 'usage-source' setting to choose between the OAuth endpoint and a 1-token /v1/messages probe that reads the same unified-ratelimit headers. The probe path costs ~1-2 tokens per fetch but rarely hits limits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Opening the state file with 'w' truncated it before fcntl took the lock, so the extension's file monitor read zero bytes mid-write — 79% of reads in a concurrent-write test — flooding the journal with JSON.parse "unexpected end of data". Write a temp file and os.replace instead. The monitor now also coalesces the event burst from one write into a single read and keeps the last good state on a short read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Owner
|
Hi @martinKupec, sorry I missed this. Have you had any further issues using this credential? I'd be worried about the rate limiting you mentioned + identifying the extension as being claude code. I could merge if that were made optional and rebased onto main. Otherwise I might cherry-pick your most recent bug fix commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have changed the API from web-based to OAuth based (Claude code message configurable).
What it gains:
There is a problem with rate-limit on OAuth endpoints, if you hit the limit, you can change preferences to use responces from /v1/message API. This is how Claude Code shows usage.
There is no auto fallback, as the message API actually uses tokens (should be 1+1 token per request).