Oref Red Alert Status Line for Claude Code

March 5, 2026 · View on GitHub

שורת מצב התראות פיקוד העורף עבור Claude Code

Real-time Pikud HaOref (Israeli Home Front Command) rocket alert notifications directly in your Claude Code status line.

הצגת התראות צבע אדום של פיקוד העורף בזמן אמת ישירות בשורת המצב של Claude Code.


🔴 TZEVA ADOM: תל אביב - מרכז העיר | רמת גן        ← active alert (flashing red)
[Claude Sonnet 4.5] ▓▓▓░░░░░░░ 31% | \$0.042

[Claude Sonnet 4.5] ▓░░░░░░░░░ 12% | \$0.031 🟢 ALL CLEAR   ← no alert

What it does / מה זה עושה

English: A background Python daemon polls the Pikud HaOref API every 5 seconds and writes alert state to a local cache file. Claude Code's status line reads the cache on every render, showing a flashing red alert with city names when rockets are incoming, or a quiet green ALL CLEAR otherwise. You can filter alerts to your own city/area so you only see what's relevant to you.

עברית: תוכנית Python רצה ברקע ומבצעת סקרים ל-API של פיקוד העורף כל 5 שניות וכותבת את מצב ההתראות לקובץ מקומי. שורת המצב של Claude Code קוראת את הקובץ בכל רענון ומציגה התראה אדומה מהבהבת עם שמות ערים כאשר יש ירי, או ALL CLEAR ירוק בשלווה אחרת. ניתן לסנן התראות לפי עיר/אזור כך שתראה רק את מה שרלוונטי אליך.


Requirements / דרישות

Claude CodeCLI for Claude (the host application)
Python 3Usually pre-installed on macOS/Linux
fzf (optional)Fuzzy city picker — brew install fzf or apt install fzf

Install / התקנה

One-liner:

curl -fsSL https://raw.githubusercontent.com/alonw0/cc-redalerts-statusline/main/install.sh | bash

Or clone and run locally:

git clone https://github.com/alonw0/cc-redalerts-statusline.git
cd cc-redalerts-statusline
bash install.sh

The installer will:

  1. Copy the scripts and city list to ~/.claude/
  2. Add statusLine.command to ~/.claude/settings.json
  3. Run the interactive city picker so you can filter to your area
  4. Ask whether to enable macOS notifications
  5. Ask whether to enable prompt blocking during active alerts

Restart Claude Code to activate the status line.


City filter / סינון עיר

During install you choose a city/area filter. You can re-run the picker at any time:

bash ~/.claude/setup-city.sh
  • With fzf installed: fuzzy-search the full list of ~1,450 Israeli areas in Hebrew & English
  • Without fzf: a numbered select menu is shown instead
  • Choose "ALL CITIES (no filter)" to show alerts for the entire country

The selected Hebrew city name is saved to ~/.claude/oref-city. The status line reads this file on every render — no restart needed.


Prompt blocking

When enabled, the UserPromptSubmit hook checks the alert cache before each prompt is sent to Claude. If there is an active TZEVA ADOM (confirmed missile/rocket fire) in your filtered city, the prompt is blocked and a message is shown:

🔴 TZEVA ADOM: [city] — Blocked during active alert. Start with '--oref' to proceed.

States that block: ACTIVE only (confirmed missile fire). PREALERT and SAFE do not block.

Override: Prefix any prompt with --oref to send it through immediately, bypassing the block for that one message.

Enable/disable after install:

  • Enable: re-run bash install.sh and answer y to the prompt blocking question
  • Disable: remove the oref-prompt-hook.sh entry from hooks.UserPromptSubmit in ~/.claude/settings.json

Manual controls

ActionHow
Disable the status linetouch ~/.claude/oref-disabled
Re-enable itrm ~/.claude/oref-disabled
Change city filterbash ~/.claude/setup-city.sh
Remove city filter (show all)rm ~/.claude/oref-city
Test the status line outputSee below

Test the status line:

echo '{"model":{"display_name":"Sonnet"},"context_window":{"used_percentage":12},"cost":{"total_cost_usd":0.03}}' \
  | bash ~/.claude/statusline-command.sh

Run the poller in the foreground (debug):

python3 ~/.claude/oref-poller.py --foreground

How it works

oref-poller.py          ← daemon; polls oref.org.il every 5s
    │ writes

/tmp/oref-alerts-cache.json
    │ read by

statusline-command.sh   ← called by Claude Code on every status-line render
    │ reads city filter

~/.claude/oref-city     ← Hebrew city name, written by setup-city.sh
  • The poller is a double-forked daemon — it detaches completely from the shell and runs silently in the background.
  • The status line script auto-starts the poller if it isn't running.
  • The cache file has a 30-second staleness check — if the poller stops for any reason, the status line shows ⚠ OREF: no data rather than silently showing stale state.
  • City filtering is done with a simple case-insensitive substring match on the Hebrew city list from the API response.

Uninstall / הסרה

curl -fsSL https://raw.githubusercontent.com/alonw0/cc-redalerts-statusline/main/uninstall.sh | bash

This removes the installed files from ~/.claude/, clears the statusLine key from settings.json, and stops the poller daemon. Your ~/.claude/oref-city preference file is kept so reinstalling restores your city choice.


Data source / מקור נתונים


License

MIT