ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 MichaelP17

service-radar

Claude Code 外掛:追蹤 Claude 透過 Bash 啟動、在指令結束後仍持續執行的常駐服務(docker compose、colima、brew services、launchctl),並可從 `/services` 面板停止或保留這些服務。

MichaelP17@MichaelP17

MichaelP17/claude-mods/tree/main/service-radar

已翻譯

關於這個 mod

service-radar

追蹤 Claude 在背景啟動、且指令返回後仍持續執行的服務——Docker Compose 堆疊、容器、Colima 虛擬機或 Homebrew 服務——並讓你停止它們。

Claude Code 已經會列出自己的背景 shell 與 subagent,但不會顯示脫離指令後繼續執行的服務:docker compose up -d 立即返回,堆疊卻在你沒注意時持續運作。這個外掛補上這個缺口,其他時候不會打擾你。

| 何時 | 你會看到什麼 | | --- | --- | | Claude 啟動的服務都沒有執行 | 無 | | 有服務正在執行 | 狀態列出現一筆 services 2 | | 你想查看詳細資訊 | /services 開啟面板:名稱、資料夾、啟動時間、每個服務的 Stop 按鈕、Stop all、Refresh | | 有服務執行時輸入 /clear | 列出服務的對話框:Stop all 或 Keep running | | 新工作階段啟動時,早先工作階段的服務仍在執行 | 顯示指向 /services 的 toast |

不需要設定。

追蹤的服務

| 使用什麼啟動 | 使用什麼停止 | 執行檢查 | | --- | --- | --- | | docker compose up -d(也包括 docker-compose) | 同一資料夾中使用相同 -f、-p 與 --profile 旗標的 docker compose down | docker compose ps | | docker compose start | docker compose stop,會保留容器 | docker compose ps | | docker run -d | docker stop <name or id> | docker ps | | docker start <name> | docker stop <name> | docker ps | | colima start [profile] | colima stop [profile] | colima status | | brew services start / run / restart | brew services stop | brew services info --json | | launchctl load | launchctl unload | 無——顯示 ? 與 Forget 按鈕 | | launchctl bootstrap <domain> <plist> | launchctl bootout <domain> <plist> | 無——顯示 ? 與 Forget 按鈕 |

服務也會比對串接指令,包括前面的 cd:在 cd app && docker compose up -d 中,堆疊會以 app 為所在資料夾追蹤。服務若以其他方式停止——你在終端機停止,或 Claude 執行停止指令——下次檢查時就會從清單消失。

詳細資訊與限制

  • 清單會跨工作階段保留,因為服務的生命週期可能超過工作階段。退出 Claude Code 時無法顯示對話框,所以會由下一個工作階段提醒你。
  • 只會看到 Claude 透過 Bash 工具執行的指令。你自己啟動的服務不會列出。
  • 追蹤的啟動指令即使位於 sudo、nohup、env 等類似前綴後方,或以 & 放到背景,也能辨識。其他放到背景的程式,例如 npm run dev &,不會追蹤;Claude Code 自己的背景 shell 會列出並停止它們。
  • 按下停止後會在背景執行,因此緩慢的停止操作(Colima 約需 十秒)不會被提早截斷。
  • 檢查有 20 秒逾時,不會延遲工作階段啟動。

移除

從 CLAUDE_CODE_PLUGIN_DIRS 移除這個外掛。它追蹤的服務仍會繼續執行;若要讓服務消失,請先用 /services 停止它們。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add MichaelP17/claude-mods
claude plugin install service-radar
原文 / README

service-radar

Keeps track of services Claude starts in the background and that keep running after the command returned — a Docker Compose stack, a container, the Colima VM, a Homebrew service — and lets you stop them.

Claude Code already lists its own background shells and subagents. What it does not show is a service that detaches: docker compose up -d returns at once, and the stack keeps running unnoticed. This mod fills that gap and stays out of sight otherwise.

| When | What you see | | --- | --- | | Nothing Claude started is running | nothing | | Something is running | one status line entry, services 2 | | You want details | /services opens a pane: name, folder, start time, a Stop button per service, Stop all, Refresh | | /clear while something runs | a dialog listing the services: Stop all or Keep running | | A new session starts while services from an earlier one still run | a toast pointing to /services |

No setup needed.

What is tracked

| Started with | Stopped with | Running check | | --- | --- | --- | | docker compose up -d (also docker-compose) | docker compose down in the same folder, with the same -f, -p and --profile flags | docker compose ps | | docker compose start | docker compose stop, which keeps the containers | docker compose ps | | docker run -d | docker stop <name or id> | docker ps | | docker start <name> | docker stop <name> | docker ps | | colima start [profile] | colima stop [profile] | colima status | | brew services start / run / restart | brew services stop | brew services info --json | | launchctl load | launchctl unload | none — shown with ? and a Forget button | | launchctl bootstrap <domain> <plist> | launchctl bootout <domain> <plist> | none — shown with ? and a Forget button |

Services are matched in chained commands too, including a preceding cd: in cd app && docker compose up -d the stack is tracked in app. A service that was stopped some other way — by you in a terminal, or by Claude running the stop command — drops off the list the next time it is checked.

Details and limits

  • The list is kept across sessions, because services outlive them. Exiting Claude Code cannot show a dialog, so the next session reminds you instead.
  • Only commands Claude runs through its Bash tool are seen. Services you start yourself are not listed.
  • A tracked start is recognised behind sudo, nohup, env and similar prefixes and when sent to the background with &. Other programs sent to the background, such as npm run dev &, are not tracked; Claude Code's own background shells list and stop those.
  • Stopping runs in the background after a press, so a slow stop (Colima takes about ten seconds) is never cut short.
  • Checks run with a 20-second timeout and never delay the start of a session.

Uninstall

Remove the mod from CLAUDE_CODE_PLUGIN_DIRS. Services it tracked keep running; stop them first with /services if you want them gone.

更多類似作品