Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
if: runner.os == 'Linux'
run: npm run lint
- name: Prettier check
if: runner.os == 'Linux'
run: npm run format:check
- name: Run tests
run: npm test
- name: Bundle
run: npm run bundle
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,30 @@ jobs:
cache: npm
- name: Install dependencies
run: npm ci
- name: Verify tag matches package version
run: |
PKG_VERSION="v$(node -p "require('./package.json').version")"
if [ "$PKG_VERSION" != "$GITHUB_REF_NAME" ]; then
echo "Tag $GITHUB_REF_NAME does not match package.json version $PKG_VERSION" >&2
exit 1
fi
- name: Lint
run: npm run lint
- name: Run tests
run: npm test
- name: Package extension
run: npx vsce package --out extension.vsix
- name: Publish to VS Code Marketplace
run: npx vsce publish --packagePath extension.vsix --pat "$VSCE_PAT"
run: npx vsce publish --packagePath extension.vsix --pat "$VSCE_PAT" --skip-duplicate
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish to Open VSX
run: npx --yes ovsx publish extension.vsix -p "$OVSX_PAT"
run: npx --yes ovsx publish extension.vsix -p "$OVSX_PAT" --skip-duplicate
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- name: Create GitHub Release
run: |
gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1 || \
gh release create "$GITHUB_REF_NAME" extension.vsix \
--title "$GITHUB_REF_NAME" \
--notes "Install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=jjju.claude-codex-usage-monitor), [Open VSX](https://open-vsx.org/extension/jjju/claude-codex-usage-monitor), or [Windsurf Marketplace](https://marketplace.windsurf.com/extension/jjju/claude-codex-usage-monitor)."
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
out/
dist/
*.vsix
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"singleQuote": true
}
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "npm: bundle:dev"
}
]
}
11 changes: 11 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "bundle:dev",
"label": "npm: bundle:dev",
"problemMatcher": []
}
]
}
5 changes: 4 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ scripts/**
test/**
src/**
node_modules/**
out/**/*.map
out/**
dist/**/*.map
tsconfig.json
eslint.config.mjs
.prettierrc.json
.gitignore
**/*.vsix
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Change Log

## 0.3.0 — 2026-07-16

- Claude credentials fall back to the macOS Keychain when the credentials file is absent
- Codex session watching now works on Linux (VS Code file watcher instead of recursive fs.watch)
- Codex reset times are computed from the log timestamp; windows already past their reset show 0%
- Claude 429 backoff honors the Retry-After header; expired tokens skip the network call
- Claude stale-data cache resets when the credentials path setting changes
- Codex session scan reads only the newest log files (faster with large histories)
- Refresh pauses while the window is unfocused and resumes on focus
- Status bar shows a loading indicator until the first fetch completes
- Status bar items hide automatically when a tool is not installed
- Tooltip marks usage windows above the warning/error thresholds
- Warning severity now matches the rounded percent shown in the status bar
- Bundled with esbuild; ESLint, Prettier, CI workflow, and pre-release tests added
- CI runs on Linux, Windows, and macOS; release workflow guards tag/version mismatch and is safely re-runnable
- Marketplace metrics: previous-snapshot lookup now paginates issue comments

## 0.2.0

- Marketplace title, description, keywords, categories, and listing links improved for Claude Code and Codex usage searches
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Hover any item for a full breakdown:

## Data sources

| Tool | Source | How |
| ----------- | ---------------------------------------------- | ---------------------------------------------------------------------------------- |
| Claude Code | OAuth token from `~/.claude/.credentials.json` | Queries an Anthropic-hosted, undocumented usage endpoint (every 60s, configurable) |
| Codex CLI | Session logs in `~/.codex/sessions/**/*.jsonl` | Parses the latest `rate_limits` event (updates instantly via file watching) |
| Tool | Source | How |
| ----------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Claude Code | OAuth token from `~/.claude/.credentials.json` or the macOS Keychain | Queries an Anthropic-hosted, undocumented usage endpoint (every 60s while the window is focused, configurable) |
| Codex CLI | Session logs in `~/.codex/sessions/**/*.jsonl` | Parses the latest `rate_limits` event (updates instantly via file watching) |

Tokens and usage data stay on your machine. The extension has no telemetry or owned server; Claude usage requests go only to the Anthropic-hosted endpoint.

Expand Down Expand Up @@ -61,7 +61,9 @@ If the extension helps your workflow, an honest Marketplace review is welcome. R

- If the Claude token has expired, running Claude Code once renews it automatically.
- The Anthropic-hosted usage endpoint is undocumented and may change without notice.
- Codex usage comes from session logs, so new data appears only when Codex runs (changes are picked up immediately).
- Codex usage comes from session logs, so new data appears only when Codex runs (changes are picked up immediately). Windows whose reset time has already passed are shown as 0%.
- A status bar item is hidden automatically when its tool is not detected (no `~/.claude` directory, or no `~/.codex/sessions` directory). It appears once the tool is used.
- Refresh pauses while the window is unfocused and resumes (with an immediate refresh) on focus.

## Localization

Expand Down
7 changes: 7 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// ESLint 플랫 설정
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['out/**', 'dist/**', 'node_modules/**', 'test/**', 'scripts/**'] },
...tseslint.configs.recommended,
);
Loading
Loading