HUD スキル は何をしますか?
OMC HUD(ヘッドアップディスプレイ)をステータスラインに設定します。
注意: このガイド内の ~/.claude/... パスは、環境変数 CLAUDE_CONFIG_DIR が設定されている場合、その値が尊重されます。
クイックコマンド
| コマンド | 説明 |
|---|---|
/oh-my-claudecode:hud | 現在の HUD ステータスを表示(必要に応じて自動セットアップ) |
/oh-my-claudecode:hud setup | HUD ステータスラインをインストール/修復 |
/oh-my-claudecode:hud minimal | 最小表示に切り替え |
/oh-my-claudecode:hud focused | フォーカス表示に切り替え(デフォルト) |
/oh-my-claudecode:hud full | フル表示に切り替え |
/oh-my-claudecode:hud status | 詳細な HUD ステータスを表示 |
自動セットアップ
/oh-my-claudecode:hud または /oh-my-claudecode:hud setup を実行すると、システムは自動的に以下を行います:
~/.claude/hud/omc-hud.mjsが存在するか確認~/.claude/settings.jsonにstatusLineが設定されているか確認- 不足している場合、HUD ラッパースクリプトを作成し設定を構成
- ステータスを報告し、変更があった場合は Claude Code の再起動を促す
重要: 引数が setup の場合、または ~/.claude/hud/omc-hud.mjs に HUD スクリプトが存在しない場合は、以下の手順に従って HUD ファイルを直接作成する必要があります。
セットアップ手順(以下のコマンドを実行)
ステップ1: セットアップが必要か確認:
node -e "const p=require('path'),f=require('fs'),d=process.env.CLAUDE_CONFIG_DIR||p.join(require('os').homedir(),'.claude');console.log(f.existsSync(p.join(d,'hud','omc-hud.mjs'))?'EXISTS':'MISSING')"
ステップ2: プラグインがインストールされているか確認:
node -e "const p=require('path'),f=require('fs'),d=process.env.CLAUDE_CONFIG_DIR||p.join(require('os').homedir(),'.claude'),b=p.join(d,'plugins','cache','omc','oh-my-claudecode');try{const v=f.readdirSync(b).filter(x=>/^\d/.test(x)).sort((a,c)=>a.localeCompare(c,void 0,{numeric:true}));if(v.length===0){console.log('Plugin not installed - run: /plugin install oh-my-claudecode');process.exit()}const l=v[v.length-1],h=p.join(b,l,'dist','hud','index.js');console.log('Version:',l);console.log(f.existsSync(h)?'READY':'NOT_FOUND - try reinstalling: /plugin install oh-my-claudecode')}catch{console.log('Plugin not installed - run: /plugin install oh-my-claudecode')}"
ステップ3: omc-hud.mjs が MISSING の場合、または引数が setup の場合、正規テンプレートから HUD ラッパーとその依存関係をインストール:
HUD_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hud"
mkdir -p "$HUD_DIR/lib"
cp "${CLAUDE_PLUGIN_ROOT}/scripts/lib/hud-wrapper-template.txt" "$HUD_DIR/omc-hud.mjs"
cp "${CLAUDE_PLUGIN_ROOT}/scripts/lib/config-dir.mjs" "$HUD_DIR/lib/config-dir.mjs"
重要: 必ず scripts/lib/hud-wrapper-template.txt の正規テンプレートからコピーしてください。ラッパーの内容をインラインで記述しないでください。テンプレートは唯一の信頼できる情報源であり、ドリフトテスト(src/__tests__/hud-wrapper-template-sync.test.ts、src/__tests__/paths-consistency.test.ts)によって保護されています。
ステップ4: 実行可能にする(Unix のみ、Windows ではスキップ):
node -e "if(process.platform==='win32'){console.log('Skipped (Windows)')}else{require('fs').chmodSync(require('path').join(process.env.CLAUDE_CONFIG_DIR||require('path').join(require('os').homedir(),'.claude'),'hud','omc-hud.mjs'),0o755);console.log('Done')}"
ステップ5: HUD を使用するように settings.json を更新:
${CLAUDE_CONFIG_DIR:-~/.claude}/settings.json を読み取り、statusLine フィールドを更新/追加します。
重要: コマンド内で ~ を使用しないでください。Unix では $HOME を使用して、マシン間でパスを移植可能に保ちます。Windows では、Windows がシェルコマンドで ~ を展開しないため、絶対パスを使用してください。
Windows の場合は、まず正しいパスを確認:
node -e "const p=require('path').join(require('os').homedir(),'.claude','hud','omc-hud.mjs').split(require('path').sep).join('/');console.log(JSON.stringify(p))"
重要: コマンドパスはすべてのプラットフォームでフォワードスラッシュを使用する必要があります。Claude Code は bash を介して statusLine コマンドを実行するため、バックスラッシュはエスケープ文字として解釈されパスが壊れます。
次に statusLine フィールドを設定します。Unix では移植可能なままで、次のようになります:
{
"statusLine": {
"type": "command",
"command": "node ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hud/omc-hud.mjs"
}
}
Windows ではパスにバックスラッシュではなくフォワードスラッシュを使用:
{
"statusLine": {
"type": "command",
"command": "node C:/Users/username/.claude/hud/omc-hud.mjs"
}
}
Edit ツールを使用して、他の設定を保持しながらこのフィールドを追加/更新します。
ステップ6: 古い HUD スクリプトがあれば削除:
node -e "const p=require('path'),f=require('fs'),d=process.env.CLAUDE_CONFIG_DIR||p.join(require('os').homedir(),'.claude'),t=p.join(d,'hud','omc-hud.js');try{if(f.existsSync(t)){f.unlinkSync(t);console.log('Removed legacy omc-hud.js')}else{console.log('No legacy script found')}}catch{}"
ステップ7: 変更を反映するために Claude Code を再起動するようにユーザーに伝えます。
表示プリセット
Minimal(最小)
必須項目のみを表示:
[OMC] ralph | todos:2/5
Focused(フォーカス、デフォルト)
関連するすべての要素を表示:
[OMC] branch:main | ralph:3/10 | US-002 | skill:planner | ctx:67% | agents:2 | bg:3/5 | todos:2/5
Full(フル)
エージェントの詳細を複数行で表示:
[OMC] repo:oh-my-claudecode branch:main | ralph:3/10 | US-002 (2/5) | ctx:[████░░]67% | agents:3 | bg:3/5 | todos:2/5
├─ O architect 2m analyzing architecture patterns...
├─ e explore 45s searching for test files
└─ s executor 1m implementing validation logic
マルチラインエージェント表示
エージェント実行中、HUD は各行に詳細情報を表示:
- ツリー文字(
├─、└─)は視覚的な階層を示す - エージェントコード(O、e、s)はモデルティアカラーでエージェントタイプを示す
- 実行時間は各エージェントの稼働時間を示す
- 説明は各エージェントの実行内容を示す(最大45文字)
表示要素
| 要素 | 説明 |
|---|---|
[OMC] | モード識別子 |
repo:name | Git リポジトリ名(シアン) |
branch:name | Git ブランチ名(シアン) |
ralph:3/10 | Ralph ループ反復/最大 |
US-002 | 現在の PRD ストーリー ID |
skill:name | 最後にアクティブ化されたスキル(シアン) |
ctx:67% | コンテキストウィンドウ使用率 |
agents:2 | 実行中のサブエージェント数 |
bg:3/5 | バックグラウンドタスクスロット |
todos:2/5 | Todo 完了率 |
カラーコード
- 緑: 正常/健全
- 黄: 警告(コンテキスト >70%、ralph >7)
- 赤: 重大(コンテキスト >85%、ralph が最大)
設定場所
HUD 設定は ~/.claude/settings.json の omcHud キー(または CLAUDE_CONFIG_DIR が設定されている場合はカスタム設定ディレクトリ)に保存されます。
旧設定場所(非推奨): ~/.claude/.omc/hud-config.json
手動設定
設定ファイルを手動で編集できます。各オプションは個別に設定でき、設定されていない値はデフォルト値が使用されます。
{
"preset": "focused",
"elements": {
"omcLabel": true,
"updateNotification": true,
"ralph": true,
"autopilot": true,
"prdStory": true,
"activeSkills": true,
"lastSkill": true,
"contextBar": true,
"agents": true,
"agentsFormat": "multiline",
"backgroundTasks": true,
"todos": true,
"thinking": true,
"thinkingFormat": "text",
"permissionStatus": false,
"apiKeySource": false,
"profile": true,
"promptTime": true,
"sessionHealth": true,
"useBars": true,
"showCallCounts": true,
"callCountsFormat": "auto",
"safeMode": true,
"maxOutputLines": 4
},
"thresholds": {
"contextWarning": 70,
"contextCompactSuggestion": 80,
"contextCritical": 85,
"ralphWarning": 7
},
"staleTaskThresholdMinutes": 30,
"contextLimitWarning": {
"threshold": 80,
"autoCompact": false
}
}
callCountsFormat
コールカウントバッジアイコンのスタイルを制御:
"auto"(デフォルト): macOS/Linux では絵文字、Windows/WSL では ASCII"emoji": 強制的に🔧 🤖 ⚡"ascii": 強制的にT: A: S:
safeMode
safeMode が true(デフォルト)の場合、HUD は ANSI コードを除去し、ASCII のみの出力を使用して、同時更新時の端末レンダリングの破損を防ぎます。これは特に Windows やターミナルマルチプレクサを使用する場合に重要です。
agentsFormat オプション
count: agents:2codes: agents:Oes(モデルティアのケーシングでタイプコード化)codes-duration: agents:O(2m)es(実行時間付きコード)detailed: agents:[architect(2m),explore,exec]descriptions: O:analyzing code | e:searching(コード + 実行内容)tasks: [analyzing code, searching...](説明のみ)multiline: 各行に完全なエージェント詳細を複数行表示
トラブルシューティング
HUD が表示されない場合:
/oh-my-claudecode:hud setupを実行して自動インストールと設定- セットアップ完了後、Claude Code を再起動
- それでも動作しない場合、
/oh-my-claudecode:omc-doctorを実行して完全な診断
旧文字列形式からの移行: 古い OMC バージョンでは statusLine をプレーンな文字列(例: "~/.claude/hud/omc-hud.mjs")として記述していました。最新の Claude Code(v2.1+)ではオブジェクト形式が必要です。インストーラまたは /oh-my-claudecode:hud setup を実行すると、旧形式の文字列が自動的に正しいオブジェクト形式に移行されます:
{
"statusLine": {
"type": "command",
"command": "node ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hud/omc-hud.mjs"
}
}
Node 24+ 互換性: HUD ラッパースクリプトは node:os(node:path ではなく)から homedir をインポートします。SyntaxError: The requested module 'path' does not provide an export named 'homedir' が発生した場合は、インストーラを再実行して omc-hud.mjs を再生成してください。
手動確認:
- HUD スクリプト:
~/.claude/hud/omc-hud.mjs - 設定:
~/.claude/settings.jsonにtypeとcommandフィールドを持つオブジェクトとしてstatusLineが設定されていること
HUD はアクティブセッション中、約300msごとに自動更新されます。