ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 dukechain2333

starfleet-panel

Claude Code 用の LCARS ステータスパネルです。

dukechain2333@dukechain2333

dukechain2333/starfleet-panel/tree/main/plugin

元の投稿の画像1
翻訳済み

この mod について

starfleet-panel

Claude Code 用の LCARS ステータスパネルです。 通常はプロンプトの下にある読み取り値(モデル、推論の強さ、コンテキストウィンドウ、レート制限、ディレクトリ、git ブランチ)を《The Next Generation》のオペレーションコンソールとして描画します。両端に肘型の部品があり、ヘッダーバーは読み取り値ごとに色付きセグメントへ分かれ、下にラベルと値を並べます。red-alert と並べて使うために作られており、red-alert が警報音を鳴らすと一緒に RED ALERT になります。

Claude Code のプロンプト下にある starfleet-panel:ブリッジレイアウト、red-alert と連動した赤色警報、コンパクトレイアウト

  • LCARS スタイルで一目で確認。 モデルと推論の強さ、コンテキストウィンドウと 5 時間制限のセグメントメーター、7 日制限、リセットまでのカウントダウン、git ブランチ、作業ディレクトリ、宇宙暦を表示します。
  • red-alert 向け。 red-alert の状態(green、muted、offline)を表示し、警報中はフレーム全体を赤く塗り替えて警報音のアニメーション中ずっと点滅します。二つの mod は互いの画面領域、キー、コマンド、状態に触れません。
  • 幅に対応。 列は幅を分け合い、狭くなるとメーター、重要度の低い列の順に縮退します。64 列未満では一行の帯になり、広いターミナルには ENV、ENERGY、CREW が追加されます。
  • ローカルで無料。 モデル呼び出しもネットワークリクエストも行わず、数値はステータスラインと同じプロセス内データから取得します。

読み取り値

各読み取り値には Starfleet 名と通常名があり、/lcars plain または /lcars starfleet で選べます。通常名では日付、CONTEXT 42% used、5H LIMIT 72% left、ALERTS ONLINE のように表示します。

| Starfleet 名 | 通常名 | 表示内容 | | --- | --- | --- | | STANDBY / ENGAGED | IDLE / WORKING | サイドバー上部:Claude が作業中かどうか | | stardate | date(OCT 02) | サイドバー下部。TNG の放送上の時刻で、1987 年の番組開始時は 41000、毎年千単位で増加 | | HELM | MODEL | モデル OPUS 5.5 と推論の強さ:IMPULSE、WARP 5、WARP 7、WARP 9、WARP 9.6 | | CORE | CONTEXT | 使用済みコンテキストウィンドウ 42% とセグメントメーター | | DILITHIUM | 5H LIMIT | 5 時間制限、72% left、メーター、T-2H14M のリセット時刻 | | ANTIMATTER | 7D LIMIT | 7 日制限とリセット時刻 | | COURSE / SECTOR | GIT / DIR | git ブランチ、作業ディレクトリ、ホームの ~、リポジトリ外の SECTOR | | ENV | ENV | base 以外の conda 環境または virtualenv | | ENERGY | COST | セッションのコスト(広いターミナルで表示) | | CREW | USER | user@host(広いターミナルで表示) | | CONDITION | ALERTS | red-alert の GREEN、MUTED、OFFLINE、警報、または red-alert がない場合の SHIP TIME |

使用量 60% で黄色、80% で赤になります。5 時間と 7 日制限は Claude Code が値を取得した後、Pro または Max の最初のレスポンス後に表示されます。

red-alert と使う

red-alert の帯をプロンプト上、本パネルをその下に同じ LCARS パレットで表示します。online、muted、offline はそれぞれ CONDITION / GREEN、CONDITION / MUTED、CONDITION / OFFLINE になります。警報中はフレームが赤くなり RED ALERT を表示し、赤または黄色のアニメーション中は状態ブロックが点滅します。0 で消音でき、未インストールなら SHIP TIME のままです。

red-alert は /alert と alert ツール、starfleet-panel は /lcars と下側のヒント行を所有します。後者は red-alert の link と active を観察するだけで、書き込みません。followRedAlert を false にすると無視できます。

インストール

git clone https://github.com/dukechain2333/starfleet-panel.git
cd starfleet-panel
./install.sh

mod は ~/.claude/skills/starfleet-panel にコピーされ、starfleet-panel@skills-dir として読み込まれます。./install.sh --link はチェックアウトをリンクし、./uninstall.sh は削除します。リポジトリは次の marketplace としても使えます。

claude plugin marketplace add dukechain2333/starfleet-panel
claude plugin install starfleet-panel@starfleet-panel

~/.claude/settings.json の statusLine は削除してください。残すと同じ数値が二重に描画されます。要件は mod 対応の Claude Code(function-hook プラグイン、2.1.288 で構築・テスト済み)と、真のカラー、ブロック要素を扱える等幅ターミナルです。

使い方

コンテキストと制限を 2 秒ごとに更新し、各ターン後と 30 秒ごとにディレクトリ、ブランチ、環境、設定を再読み込みします。bridge は三行、compact は一行、off は Claude Code 自身のヒント行だけです。64 列未満とデスクトップアプリでは bridge が compact にフォールバックします。/lcars は完全なレポートを表示します。

LCARS STATUS REPORT 繚 STARDATE 80753.1 繚 22:32

HELM        (model, effort)      OPUS 5.5 繚 xhigh effort (warp 9)
CORE        (context window)     4% used 繚 43K of 1M tokens
DILITHIUM   (5-hour limit)       95% left 繚 resets in 4h18m
ANTIMATTER  (7-day limit)        63% left 繚 resets in 4h28m
ENERGY      (session cost)       $0.35
SECTOR      (working directory)  ~/starfleet_panel
COURSE      (git branch)         main
ENV         (python env)         none
CONDITION   (red-alert)          condition green

/lcars plain | starfleet は表示名を、/lcars bridge | compact | off はレイアウトを切り替え、/lcars reset は設定に戻します。

設定

/config または claude plugin configure starfleet-panel で layout、labels、showCost、showUserHost、followRedAlert、refreshSeconds を設定します。デフォルトは bridge、starfleet、false、true、true、2 です。

仕組み

mod は Claude Code の PromptHint、つまりプロンプト下のヒント行を描画し、エンジンの行と一緒に返します。数値は $.session.usage() と $.session.model() から取得し、推論の強さは観察専用の turn.step フックが記録します。

開発

claude plugin validate plugin     # manifest and hooks, as the engine reads them
claude plugin test plugin         # the tests: layouts, red-alert states, /lcars
claude --plugin-dir plugin        # try it; saving a file reloads it
npx -p typescript tsc -p plugin   # type-check, once a session has loaded the mod
                                  # (it lays the types in plugin/.claude-plugin/types)

レイアウトは plugin/hooks/register.tsx、plugin/hooks/panel.ts、plugin/hooks/lcars.ts、plugin/hooks/readouts.ts、plugin/types/index.d.ts、plugin/tests/ にあります。docs/preview.svg は実際のセッションから取得し、tmux capture-pane -e -p -t <session> > capture.ans と python3 docs/ansi2svg.py capture.ans docs/preview.svg --rows <first>-<last> で変換します。

クレジットとライセンス

Michael Okuda が設計した LCARS の外観を借りた非公式ファンプロジェクトです。Star Trek とその商標は各所有者に帰属します。

MIT

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add dukechain2333/starfleet-panel
claude plugin install starfleet-panel
原文 / README

starfleet-panel

An LCARS status panel for Claude Code. The readouts that usually sit under the prompt (model, effort, context window, rate limits, directory, git branch) are drawn as an ops console from The Next Generation: elbows at both ends, a header bar cut into one colored segment per readout, the labels under their segments and the values under the labels. It's built to sit beside red-alert. When red-alert sounds the klaxon, the panel goes to RED ALERT with it.

starfleet-panel under the Claude Code prompt: the bridge layout, a red alert with red-alert, and the compact layout

  • Everything at a glance, LCARS style. Model and effort (as a warp factor), segmented meters for the context window and the 5-hour limit, the 7-day limit, countdowns to each reset, the git branch and working directory, and the stardate.
  • Made for red-alert. It shows red-alert's condition (green, muted, offline). While an alert is up, it repaints the whole frame in the alert's reds and blinks with red-alert's klaxon for as long as it animates. The two mods never touch each other's screen space, keys, commands or state.
  • Fits any width. The columns share the width out. As the terminal narrows, the meters shrink first, then the least important columns go, and below 64 columns the frame becomes a one-row strip. Wide terminals gain the ENV, ENERGY and CREW columns.
  • Local and free. It makes no model calls and no network requests. The figures come from the same in-process data the status line uses.

The readouts

Every readout has a Starfleet name and a plain one, and you pick which the panel uses: /lcars plain or /lcars starfleet (saved, like the Terminology row in /config). The plain terms read as an ordinary status line: the date instead of the stardate, CONTEXT 42% used, 5H LIMIT 72% left, ALERTS ONLINE.

| Starfleet term | Plain term | What it shows | | --- | --- | --- | | STANDBY / ENGAGED | IDLE / WORKING | the sidebar's upper block: whether Claude is working | | stardate | date (OCT 02) | the sidebar's lower block; the stardate is TNG's broadcast reckoning: 41000 when the show began in 1987, a thousand units a year | | HELM | MODEL | the model (OPUS 5.5) and reasoning effort as a warp factor: low IMPULSE, medium WARP 5, high WARP 7, xhigh WARP 9, max WARP 9.6 | | CORE | CONTEXT | context window used (42%; plain 42% used), with a segmented meter | | DILITHIUM | 5H LIMIT | the 5-hour limit: how much is left (plain 72% left), a meter, and the time to the reset (T-2H14M; plain reset 2h14m) | | ANTIMATTER | 7D LIMIT | the 7-day limit: how much is left and the time to the reset | | COURSE / SECTOR | GIT / DIR | the git branch (or @<sha> when detached) over the working directory, ~ for home; SECTOR outside a repository | | ENV | ENV | the active conda env (not base) or virtualenv, on wide terminals | | ENERGY | COST | the session's cost, on wide terminals (off by default) | | CREW | USER | user@host, on wide terminals (can be turned off) | | CONDITION | ALERTS | the end block: red-alert's state, GREEN (plain ONLINE), MUTED, OFFLINE or the alert; without red-alert, SHIP TIME (plain TIME) over the clock |

Readings turn yellow at 60% used and red at 80%. These are the thresholds of the classic statusLine script the panel replaces. The 5-hour and 7-day limits appear once Claude Code has a reading for them: on a Pro or Max subscription, after the first response.

With red-alert

Install both and they share one console: red-alert's band above the prompt and this panel below it, in the same LCARS palette.

| red-alert's state | The panel | | --- | --- | | online | the end block reads CONDITION / GREEN | | muted | CONDITION / MUTED | | offline | CONDITION / OFFLINE | | an alert is up | the whole frame turns the alert's reds and the end block reads RED ALERT (or the level's title) | | a red or yellow alert animating | the state block and the end block blink with the klaxon, then hold steady until you silence or dismiss the alert (0, red-alert's key) | | not installed | the end block keeps SHIP TIME; everything else works the same |

The mods don't conflict because each one draws, binds and stores only what it owns:

| | red-alert | starfleet-panel | | --- | --- | --- | | Draws | the band above the prompt, the /alert console, its tool's row | the hint line under the prompt, nothing else | | Command | /alert | /lcars | | Tools and system prompt | the alert tool and a short alert policy | none | | Keys | 0 silences; band items via ctrl+x tab | none: no buttons, no hotkeys | | State | its own | its own; reads red-alert's link and active, never writes them |

The panel learns of a new alert the moment red-alert records it. It does this with an observe-only hook on red-alert's state, which passes every value through exactly as red-alert wrote it. Set followRedAlert to false to ignore red-alert altogether.

Install

git clone https://github.com/dukechain2333/starfleet-panel.git
cd starfleet-panel
./install.sh

This copies the mod to ~/.claude/skills/starfleet-panel. Start a new Claude Code session and it loads as starfleet-panel@skills-dir. Use ./install.sh --link to symlink the checkout instead while you work on it, and ./uninstall.sh to remove it.

The repository is also a plugin marketplace:

claude plugin marketplace add dukechain2333/starfleet-panel
claude plugin install starfleet-panel@starfleet-panel

Retire your statusLine command. If ~/.claude/settings.json has a statusLine entry, its line keeps drawing above the panel and you see the same figures twice. Remove the entry to let the panel take over. The panel tells you once, the installer reminds you, and /lcars mentions it while one is set.

Requirements: Claude Code with mod support (function-hook plugins; built and tested on 2.1.288), and a terminal with true color and a monospace font that has the block elements (▄ ▀ ▌ ▗). Any modern terminal font does.

Using it

The panel needs nothing from you. It refreshes the context window and limits every 2 seconds. It re-reads the directory, branch, env and settings after every turn and every 30 seconds.

  • Layouts: bridge, the three-row ops console (the default); compact, one row in the style of red-alert's idle strip; off, only Claude Code's own hint line. Bridge falls back to compact on terminals narrower than 64 columns and in the desktop app.

  • /lcars prints a full status report. It lists every reading beside what its Starfleet name stands for, which makes it a legend too:

    LCARS STATUS REPORT · STARDATE 80753.1 · 22:32
    
    HELM        (model, effort)      OPUS 5.5 · xhigh effort (warp 9)
    CORE        (context window)     4% used · 43K of 1M tokens
    DILITHIUM   (5-hour limit)       95% left · resets in 4h18m
    ANTIMATTER  (7-day limit)        63% left · resets in 4h28m
    ENERGY      (session cost)       $0.35
    SECTOR      (working directory)  ~/starfleet_panel
    COURSE      (git branch)         main
    ENV         (python env)         none
    CONDITION   (red-alert)          condition green
    
  • /lcars plain | starfleet switches the terms, and keeps the choice for new sessions.

  • /lcars bridge | compact | off switches the layout for this session. /lcars reset goes back to the setting.

Settings

Set these in /config (or claude plugin configure starfleet-panel):

| Setting | Default | | | --- | --- | --- | | layout | bridge | bridge, compact or off | | labels (Terminology) | starfleet | starfleet (HELM, CORE, DILITHIUM, stardate…) or plain (MODEL, CONTEXT, 5H LIMIT, date…); /lcars plain and /lcars starfleet set it too | | showCost | false | add the ENERGY column (the session's cost) on wide terminals | | showUserHost | true | add the CREW column (user@host) on wide terminals | | followRedAlert | true | show red-alert's condition and repaint with its alerts | | refreshSeconds | 2 | how often the context window and limits are re-read |

How it works

The mod draws Claude Code's PromptHint site, the hint line under the prompt. It returns its own rows together with the engine's line, so the mode pill (⏵⏵ auto mode on) and hints such as esc to interrupt stay live above the frame. Its figures come from $.session.usage() and $.session.model(), which are free in-process calls. The effort is the one each main-loop request was actually sent with, recorded by an observe-only turn.step hook that leaves the response stream untouched. Before the first request, the effort comes from your settings.

Development

claude plugin validate plugin     # manifest and hooks, as the engine reads them
claude plugin test plugin         # the tests: layouts, red-alert states, /lcars
claude --plugin-dir plugin        # try it; saving a file reloads it
npx -p typescript tsc -p plugin   # type-check, once a session has loaded the mod
                                  # (it lays the types in plugin/.claude-plugin/types)

Layout: plugin/hooks/register.tsx (hooks, sensors, drawing), plugin/hooks/panel.ts (the layouts and the report), plugin/hooks/lcars.ts (palette and row fitting), plugin/hooks/readouts.ts (stardate, warp factor, gauges, cell widths), plugin/types/index.d.ts (the state contract), plugin/tests/.

docs/preview.svg comes from a real session. Capture it with tmux capture-pane -e -p -t <session> > capture.ans, then convert it with python3 docs/ansi2svg.py capture.ans docs/preview.svg --rows <first>-<last>.

Credits

The panel borrows the look of LCARS, the computer interface designed by Michael Okuda for Star Trek: The Next Generation. This is an unofficial fan project. Star Trek and its marks belong to their respective owners.

License

MIT

関連作品