Hud

From sigridjineth/oh-my-codex · View interactive version

Hud is an AI agent skill from the GitHub repository sigridjineth/oh-my-codex. Configure HUD display options (layout, presets, display elements)

How to use this skill

Skill file

HUD Skill

Configure the OMC HUD (Heads-Up Display) for the statusline.

Note: All ~/.codex/... paths in this guide respect CODEX_CONFIG_DIR when that environment variable is set.

Quick Commands

| Command | Description |

|---------|-------------|

| /oh-my-codex:hud | Show current HUD status (auto-setup if needed) |

| /oh-my-codex:hud setup | Install/repair HUD statusline |

| /oh-my-codex:hud minimal | Switch to minimal display |

| /oh-my-codex:hud focused | Switch to focused display (default) |

| /oh-my-codex:hud full | Switch to full display |

| /oh-my-codex:hud status | Show detailed HUD status |

Auto-Setup

When you run /oh-my-codex:hud or /oh-my-codex:hud setup, the system will automatically:

  1. Check if ~/.codex/hud/omc-hud.mjs exists
  2. Check if statusLine is configured in ~/.codex/settings.json
  3. If missing, create the HUD wrapper script and configure settings
  4. Report status and prompt to restart Codex if changes were made

IMPORTANT: If the argument is setup OR if the HUD script doesn't exist at ~/.codex/hud/omc-hud.mjs, you MUST create the HUD files directly using the instructions below.

Setup Instructions (Run These Commands)

Step 1: Check if setup is needed:

ls ~/.codex/hud/omc-hud.mjs 2>/dev/null && echo "EXISTS" || echo "MISSING"

Step 2: Verify the plugin is installed:

PLUGIN_VERSION=$(ls ~/.codex/plugins/cache/omc/oh-my-codex/ 2>/dev/null | sort -V | tail -1)
if [ -n "$PLUGIN_VERSION" ]; then
  ls ~/.codex/plugins/cache/omc/oh-my-codex/$PLUGIN_VERSION/dist/hud/index.js 2>/dev/null && echo "READY" || echo "NOT_FOUND - try reinstalling: /plugin install oh-my-codex"
else
  echo "Plugin not installed - run: /plugin install oh-my-codex"
fi

Step 3: If omc-hud.mjs is MISSING or argument is setup, create the HUD directory and script:

First, create the directory:

mkdir -p ~/.codex/hud

Then, use the Write tool to create ~/.codex/hud/omc-hud.mjs with this exact content:

#!/usr/bin/env node
/**
 * OMC HUD - Statusline Script
 * Wrapper that imports from plugin cache or development paths
 */

import { existsSync, readdirSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { pathToFileURL } from "node:url";

// Semantic version comparison: returns negative if a < b, positive if a > b, 0 if equal
function semverCompare(a, b) {
  // Use parseInt to handle pre-release suffixes (e.g. "0-beta" -> 0)
  const pa = a.replace(/^v/, "").split(".").map(s => parseInt(s, 10) || 0);
  const pb = b.replace(/^v/, "").split(".").map(s => parseInt(s, 10) || 0);
  for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
    const na = pa[i] || 0;
    const nb = pb[i] || 0;
    if (na !== nb) return na - nb;
  }
  // If numeric parts equal, non-pre-release > pre-release
  const aHasPre = /-/.test(a);
  const bHasPre = /-/.test(b);
  if (aHasPre && !bHasPre) return -1;
  if (!aHasPre && bHasPre) return 1;
  return 0;
}

async function main() {
  const home = homedir();
  let pluginCacheDir = null;

  // 1. Try plugin cache first (marketplace: omc, plugin: oh-my-codex)
  const pluginCacheBase = join(home, ".codex/plugins/cache/omc/oh-my-codex");
  if (existsSync(pluginCacheBase)) {
    try {
      const versions = readdirSync(pluginCacheBase);
      if (versions.length > 0) {
        const latestVersion = versions.sort(semverCompare).reverse()[0];
        pluginCacheDir = join(pluginCacheBase, latestVersion);
        const pluginPath = join(pluginCacheDir, "dist/hud/index.js");
        if (existsSync(pluginPath)) {
          await import(pathToFileURL(pluginPath).href);
          return;
        }
      }
    } catch { /* continue */ }
  }

  // 2. Development paths
  const devPaths = [
    join(home, "Workspace/oh-my-codex/dist/hud/index.js"),
    join(home, "workspace/oh-my-codex/dist/hud/index.js"),
    join(home, "Workspace/oh-my-codex/dist/hud/index.js"),
    join(home, "workspace/oh-my-codex/dist/hud/index.js"),
  ];

  for (const devPath of devPaths) {
    if (existsSync(devPath)) {
      try {
        await import(pathToFileURL(devPath).href);
        return;
      } catch { /* continue */ }
    }
  }

  // 3. Fallback - HUD not found (provide actionable error message)
  if (pluginCacheDir) {
    console.log(`[OMC] HUD not built. Run: cd "${pluginCacheDir}" && npm install`);
  } else {
    console.log("[OMC] Plugin not found. Run: /oh-my-codex:omc-setup");
  }
}

main();

Step 3: Make it executable:

chmod +x ~/.codex/hud/omc-hud.mjs

Step 4: Update settings.json to use the HUD:

Read ~/.codex/settings.json, then update/add the statusLine field.

IMPORTANT: The command must use an absolute path, not ~, because Windows does not expand ~ in shell commands.

First, determine the correct path:

node -e "const p=require('path').join(require('os').homedir(),'.codex','hud','omc-hud.mjs');console.log(JSON.stringify(p))"

Then set the statusLine field using the resolved path. On Unix it will look like:

{
  "statusLine": {
    "type": "command",
    "command": "node /home/username/.codex/hud/omc-hud.mjs"
  }
}

On Windows it will look like:

{
  "statusLine": {
    "type": "command",
    "command": "node C:\\Users\\username\\.codex\\hud\\omc-hud.mjs"
  }
}

Use the Edit tool to add/update this field while preserving other settings.

Step 5: Clean up old HUD scripts (if any):

rm -f ~/.codex/hud/sisyphus-hud.mjs 2>/dev/null

Step 6: Tell the user to restart Codex for changes to take effect.

Display Presets

Minimal

Shows only the essentials:

[OMC] ralph | ultrawork | todos:2/5

Focused (Default)

Shows all relevant elements:

[OMC] ralph:3/10 | US-002 | ultrawork skill:planner | ctx:67% | agents:2 | bg:3/5 | todos:2/5

Full

Shows everything including multi-line agent details:

[OMC] ralph:3/10 | US-002 (2/5) | ultrawork | 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

Multi-Line Agent Display

When agents are running, the HUD shows detailed information on separate lines:

Display Elements

| Element | Description |

|---------|-------------|

| [OMC] | Mode identifier |

| ralph:3/10 | Ralph loop iteration/max |

| US-002 | Current PRD story ID |

| ultrawork | Active mode badge |

| skill:name | Last activated skill (cyan) |

| ctx:67% | Context window usage |

| agents:2 | Running subagent count |

| bg:3/5 | Background task slots |

| todos:2/5 | Todo completion |

Color Coding

Configuration Location

HUD config is stored at: ~/.codex/.omc/hud-config.json

Manual Configuration

You can manually edit the config file. Each option can be set individually - any unset values will use defaults.

{
  "preset": "focused",
  "elements": {
    "omcLabel": true,
    "ralph": true,
    "prdStory": true,
    "activeSkills": true,
    "lastSkill": true,
    "contextBar": true,
    "agents": true,
    "backgroundTasks": true,
    "todos": true,
    "showCache": true,
    "showCost": true,
    "maxOutputLines": 4
  },
  "thresholds": {
    "contextWarning": 70,
    "contextCritical": 85,
    "ralphWarning": 7
  }
}

Troubleshooting

If the HUD is not showing:

  1. Run /oh-my-codex:hud setup to auto-install and configure
  2. Restart Codex after setup completes
  3. If still not working, run /oh-my-codex:doctor for full diagnostics

Manual verification:


The HUD updates automatically every ~300ms during active sessions.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.