Home›Claude / Claude Code›Claude Code の使用率(5時間枠・週)を VS Code のステータスバーに常に表示する
Claude Code の使用率(5時間枠・週)を VS Code のステータスバーに常に表示する

Claude Code の使用率(5時間枠・週)を VS Code のステータスバーに常に表示するAlways Show Claude Code Usage (5-Hour and Weekly Limits) in the VS Code Status Bar

元記事を読むRead original articleqiita.com(新しいタブで開きます)(opens in a new tab)
AI 要約AI summary

Claude Code のサブスクリプション利用枠である5時間ごとの上限と週間上限の消費率を、VS Code 下部のステータスバーへ常時表示する自作拡張機能を紹介する。GitHub で MIT ライセンス公開され、試行錯誤した失敗例も理由付きで載るため、残量を頻繁に確認したい利用者に役立つ。

A small custom VS Code extension keeps Claude Code's 5-hour and weekly subscription usage visible in the status bar. It is MIT-licensed on GitHub and documents failed approaches, helping users who check their remaining quota often.

AI 生成の要約と解説(解説は要約と収集メタデータに基づく)で、元記事全文の転載・翻訳ではありません。日本語版と英語版は言語ごとに独立して生成しています。正確性は元記事 (qiita.com) でご確認ください。AI-generated summary and explainer (the latter based on the summaries and collected metadata), not a copy or translation of the full source article. Generated independently for each language. Verify accuracy at the original source (qiita.com).

Claude Code をサブスクリプションで使う人向けに、5時間ごとの枠と週の枠の使用率を、VS Code のステータスバーへ常時表示する小さな自作拡張機能が紹介されている。残量を頻繁に確かめたい人にとって、確認の手間を減らす試みだ。

既存の確認方法と手間

VS Code 拡張機能で Claude Code を使っている場合、サイドバーの「Account & usage」をクリックすると、使用率がバーで表示される。CLI なら /usage コマンドで確認できる。公式ドキュメントにも、/usage で Account & usage ダイアログが開き、サインイン中のアカウントと使用状況が見られると書かれている。CLI でも VS Code 拡張機能の Claude でも、同じ /usage で確認できるという。

筆者は主に VS Code 拡張機能で Claude Code を使っている。作業の合間に「あとどのくらい使えるか」をこまめに確かめたいが、そのたびにパネルを開いてバーを見るのは思った以上に手間だったという。

ステータスバーに常時表示

そこで筆者は、数字だけでよいのでもっとコンパクトに、常に目に入る場所へ出すことを目指した。表示先は、ウィンドウ下端の細い帯であるステータスバーだ。時計のように画面の端に小さく出ていればよい、というのが発想である。

公開形態と動作環境

コードは GitHub で MIT ライセンスのもと公開されており、すぐに使いたい人は README の手順でインストールできる。動作を確認した環境は、CLI と VS Code 拡張機能の両方で Claude Code 2.1.332。Node.js 24.11.0 は、拡張機能をパッケージするときだけ使うと説明されている。

statusLine は CLI のみ

完成までに試して「うまくいかなかった方法」も、理由とともに紹介されている。最初の試みは、Claude Code に用意されている statusLine という設定を使う方法だった。結果は、CLI でしか動かなかったというものである。

この記事は、完成した拡張機能の使い方だけでなく、うまくいかなかった試行の記録も併せて読める構成になっている。

Usage in the Status Bar

Anyone using Claude Code on a subscription such as Pro or Max has two limits to watch: a 5-hour window and a weekly window. This article describes a small VS Code extension that keeps both usage figures visible in the status bar, the thin strip at the bottom edge of the window, so users do not have to open a panel to check them.

Why the Existing Check Falls Short

According to the author, when Claude Code runs as a VS Code extension, clicking "Account & usage" in the sidebar shows usage as bars. In the CLI, the /usage command does the same job. The official documentation quoted in the article says: "Run /usage to open the Account & usage dialog, which shows your signed-in account and your usage." The author says this works in both the CLI and the VS Code extension.

The author's complaint is the effort involved. They mainly use Claude Code through the VS Code extension and want to check their remaining allowance between tasks. Opening a panel and reading a bar each time turned out to be more tedious than expected. They say numbers alone would be enough, shown small at the edge of the screen like a clock.

What the Extension Does

The article builds a small extension that shows the usage rates in the status bar at all times. The code is published on GitHub under the MIT license. Readers who want to use it right away can follow the installation steps in the README.

The author tested with Claude Code 2.1.332, in both the CLI and the VS Code extension. Node.js 24.11.0 was used only when packaging the extension.

Approaches That Did Not Work

The article also covers methods the author tried before reaching the finished version, along with the reasons they failed. The first is Claude Code's statusLine setting. According to the author, it worked only in the CLI and not in the VS Code extension, which is the environment they mainly use. The source text provided here does not go into the other failed attempts, but the article states that each is explained with its reasons.

For users who check their remaining quota often, the piece offers both a ready-made extension and a record of what the author learned along the way.

ポコとTECHガイドPoko & TECH Guide

ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.

  1. ポコPoko5時間の枠と週の枠って、ふつうはどこで見られるの? それをわざわざ別に出すんだね。Where do you normally see the 5-hour and weekly usage? And why show it somewhere else?
  2. TECHガイドTECH GuideVS Code ならサイドバーの「Account & usage」でバー表示、CLI なら /usage です。ただ、そのたびに開くのが手間だったそうです。In VS Code you click "Account & usage" in the sidebar for a bar, or run /usage in the CLI. The author found opening it every time a hassle.
  3. ポコPokoじゃあ、画面の下にある細い帯に数字が出ていれば、開かなくていいってこと?So a number in that thin strip at the bottom means I don't have to open anything?
  4. TECHガイドTECH Guideそうです。ステータスバーに常に表示する小さな拡張機能で、残りをこまめに確かめたい人向けです。GitHub で MIT ライセンス公開されています。Right. This small extension keeps usage in the status bar, for people who check often. It's on GitHub under the MIT license.
  5. ポコPokoなるほど、時計みたいに端に出ておくのがいいんだね。失敗した方法も載ってるのはなんだか親切。I see, like a clock in the corner. Nice that it also shares the methods that failed.
  6. TECHガイドTECH Guideはい、理由つきで紹介されています。たとえば statusLine は CLI でしか動かなかったそうです。バージョンはこの記事の環境が前提です。Yes, with reasons. For example, statusLine only worked in the CLI. Also, the versions mentioned are the ones the author used.
記事情報・収集記録Article details & collection record
出典Source
Qiita VSCodeコミュニティCommunity
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
ブログBlog
原文言語Source language
日本語Japanese
重要度の位置づけImportance in this lane
MediumMedium priority(Claude / Claude Code 167件中、同等以上 142件)(142 of 167 Claude / Claude Code entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
1.9 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
中期 (チュートリアル)Medium-term (tutorial)

🧡Claude / Claude Code の他の記事More from Claude / Claude Codeもっと見る →View more →

ページ上部へScroll to top