Skip to content

Instantly share code, notes, and snippets.

View sirirot's full-sized avatar

Sirirot Choedchu-amphai sirirot

View GitHub Profile
@sirirot
sirirot / codex-jobs-count.sh
Created May 2, 2026 07:09
Claude Code statusline scripts — bash + jq + awk; supports Windows via Git Bash or WSL
#!/usr/bin/env bash
# Codex job count helper for Claude Code statusline
# ============================================================================
# Returns count of currently-running Codex jobs (in_progress / running /
# pending). Echoes integer (0 = nothing running) or empty on error.
#
# Cache: 5-sec TTL via /tmp/.codex_jobs_count to avoid heavy spawn cost
# on every statusline refresh. Statusline calls this every prompt; without
# cache, codex-companion.mjs spawn (~50ms) compounds into noticeable lag.
#