Skip to content
Back to search

claude-code-mods

MarketplaceWorks with Claude CodeGitHub

Claude Code mods and themes: lines above the prompt, guards, panes, games and Desktop themes.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 17 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/hamzafer/claude-code-mods with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/hamzafer/claude-code-mods'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/hamzafer--claude-code-mods/badge.svg)](/listings/hamzafer--claude-code-mods)

HTML

<a href="/listings/hamzafer--claude-code-mods"><img src="/api/listings/hamzafer--claude-code-mods/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npx claude-code-mods@latest

Tick the mods you want, press Enter, restart Claude Code. Needs Claude Code 2.1.287+. [Flags and other ways to install](docs/install.md).

<table> <tr> <td align="center" width="33%"><a href="docs/mods.md#-context-bar"><img src="images/context-bar.png" alt="context-bar: Claude Code context window usage as a stacked bar, a color per category" width="260"></a><br><b>context-bar</b><br>what fills your context</td> <td align="center" width="33%"><a href="docs/mods.md#-review-watch"><img src="images/review-watch.png" alt="review-watch: live lines for running Codex and subagent code reviews in Claude Code" width="260"></a><br><b>review-watch</b><br>running code reviews, live</td> <td align="center" width="33%"><a href="docs/mods.md#-md-preview"><img src="images/md-preview.png" alt="md-preview: Markdown that Claude Code edits, rendered like GitHub next to the diff" width="260"></a><br><b>md-preview</b><br>Markdown rendered like GitHub</td> </tr> <tr> <td align="center" width="33%"><a href="docs/mods.md#-blast-radius"><img src="images/gallery/blast-radius.png" alt="blast-radius: a Claude Code hook holds rm -rf and lists the files it would delete" width="260"></a><br><b>blast-radius</b><br>see what <code>rm -rf</code> would delete</td> <td align="center" width="33%"><a href="docs/mods.md#-switchboard"><img src="images/switchboard.png" alt="switchboard: subagents routed from opus to sonnet and haiku, with confidence and cost" width="260"></a><br><b>switchboard</b><br>cheaper models for subagents</td> <td align="center" width="33%"><a href="docs/mods.md#-now-playing"><img src="images/now-playing.png" alt="now-playing: Spotify track, progress bar and synced lyrics inside Claude Code" width="260"></a><br><b>now-playing</b><br>Spotify and its lyrics, live</td> </tr> </table>

<a id="-the-mods"></a>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 406 lines
  1. {
  2. "name": "claude-code-mods",
  3. "description": "Claude Code mods and themes: lines above the prompt, guards, panes, games and Desktop themes.",
  4. "owner": {
  5. "name": "hamzafer"
  6. },
  7. "plugins": [
  8. {
  9. "name": "agent-radar",
  10. "description": "One live line above the prompt per running subagent or background shell: its model, time, tool count and what it's doing. /radar shows every agent and its messages.",
  11. "version": "0.3.3",
  12. "source": "./mods/agent-radar",
  13. "category": "See what's happening",
  14. "tags": [
  15. "band",
  16. "pane",
  17. "toast",
  18. "command"
  19. ]
  20. },
  21. {
  22. "name": "blast-radius",
  23. "description": "Holds risky Bash commands and shows what they would change before they run.",
  24. "version": "0.2.6",
  25. "source": "./mods/blast-radius",
  26. "category": "Guard your repo",
  27. "tags": [
  28. "band",
  29. "pane",
  30. "guard",
  31. "command"
  32. ]
  33. },
  34. {
  35. "name": "secret-guard",
  36. "description": "Keeps API keys and tokens out of Claude's context, your files and your commits: hides them in tool output, and asks before a write, commit or push adds one.",
  37. "version": "0.1.3",
  38. "source": "./mods/secret-guard",
  39. "category": "Guard your repo",
  40. "tags": [
  41. "guard",
  42. "toast",
  43. "command"
  44. ]
  45. },
  46. {
  47. "name": "context-bar",
  48. "description": "Your context window as a stacked bar above the prompt, a color per category, with token counts and the compaction point. /context-bar shows or hides it.",
  49. "version": "0.1.6",
  50. "source": "./mods/context-bar",
  51. "category": "See what's happening",
  52. "tags": [
  53. "band",
  54. "command"
  55. ]
  56. },
  57. {
  58. "name": "browser-lanes",
  59. "description": "Shows if this session has a Playwright browser and who holds it. /browser clean closes leftover browsers. A subagent that wants the browser waits until the one using it is done.",
  60. "version": "0.1.4",
  61. "source": "./mods/browser-lanes",
  62. "category": "See what's happening",
  63. "tags": [
  64. "band",
  65. "toast",
  66. "guard",
  67. "command"
  68. ]
  69. },
  70. {
  71. "name": "md-preview",
  72. "description": "Shows the Markdown files Claude edits, rendered like GitHub, in a pane next to the chat. Before and after side by side. /md opens it.",
  73. "version": "0.1.11",
  74. "source": "./mods/md-preview",
  75. "category": "See what's happening",
  76. "tags": [
  77. "pane",
  78. "toast",
  79. "command"
  80. ],
  81. "needs": [
  82. "Chrome"
  83. ]
  84. },
  85. {
  86. "name": "glance",
  87. "description": "One line above the prompt with what needs you: next meeting, PRs, Linear issues and Slack DMs. /glance lists them all.",
  88. "version": "0.1.3",
  89. "source": "./mods/glance",
  90. "category": "My setup (fork and adapt)",
  91. "tags": [
  92. "band",
  93. "command"
  94. ],
  95. "needs": [
  96. "gh",
  97. "Google Calendar connector",
  98. "Linear connector",
  99. "Slack connector"
  100. ]
  101. },
  102. {
  103. "name": "heatmap",
  104. "description": "A GitHub-style grid of your Claude Code time in a /heatmap pane, with streaks, peaks and top projects.",
  105. "version": "0.1.3",
  106. "source": "./mods/heatmap",
  107. "category": "See what's happening",
  108. "tags": [
  109. "pane",
  110. "toast",
  111. "command"
  112. ]
  113. },
  114. {
  115. "name": "merge-gate",
  116. "description": "Holds `gh pr merge` until CI passes and one Codex review (OpenAI's luna model) has run. A PR line above the prompt, and /gate shows the PR's status.",
  117. "version": "0.1.6",
  118. "source": "./mods/merge-gate",
  119. "category": "My setup (fork and adapt)",
  120. "tags": [
  121. "band",
  122. "guard",
  123. "command"
  124. ],
  125. "needs": [
  126. "gh",
  127. "codex"
  128. ]
  129. },
  130. {
  131. "name": "mission-control",
  132. "description": "/mission opens a live map of the main agent, its subagents and every tool call, plus a code map of the files they touch.",
  133. "version": "0.1.10",
  134. "source": "./mods/mission-control",
  135. "category": "See what's happening",
  136. "tags": [
  137. "band",
  138. "pane",
  139. "command"
  140. ]
  141. },
  142. {
  143. "name": "next-steps",
  144. "description": "After each turn, 2 or 3 likely next prompts above the prompt. Press 1, 2 or 3 in an empty prompt to draft one, 0 to dismiss.",
  145. "version": "0.3.1",
  146. "source": "./mods/next-steps",
  147. "category": "See what's happening",
  148. "tags": [
  149. "band"
  150. ]
  151. },
  152. {
  153. "name": "now-playing",
  154. "description": "What Spotify is playing, one line above the prompt: track, progress and the lyric being sung, with ⏮ ⏸ ⏭ buttons. /music controls it too. macOS.",
  155. "version": "0.1.2",
  156. "source": "./mods/now-playing",
  157. "category": "For fun",
  158. "tags": [
  159. "band",
  160. "command"
  161. ],
  162. "needs": [
  163. "macOS",
  164. "Spotify"
  165. ]
  166. },
  167. {
  168. "name": "prayer-times",
  169. "description": "The current prayer and how long is left, the next prayer, and zawal, above the prompt. Computed on your computer from your location; nothing is sent anywhere.",
  170. "version": "0.1.6",
  171. "source": "./mods/prayer-times",
  172. "category": "See what's happening",
  173. "tags": [
  174. "band",
  175. "toast",
  176. "command"
  177. ]
  178. },
  179. {
  180. "name": "reels",
  181. "description": "YouTube Shorts in a terminal pane: plays while Claude works, pauses when Claude is done.",
  182. "version": "0.1.3",
  183. "source": "./mods/reels",
  184. "category": "For fun",
  185. "tags": [
  186. "pane",
  187. "command"
  188. ],
  189. "needs": [
  190. "Playwright"
  191. ]
  192. },
  193. {
  194. "name": "replay-theater",
  195. "description": "Step through the last turn's file edits, one diff at a time.",
  196. "version": "0.1.3",
  197. "source": "./mods/replay-theater",
  198. "category": "See what's happening",
  199. "tags": [
  200. "pane",
  201. "toast",
  202. "command"
  203. ]
  204. },
  205. {
  206. "name": "review-watch",
  207. "description": "A live line above the prompt for each running code review: Codex or a review subagent, its model, what it reviews, time, and Codex's latest output. A toast with the findings when it ends.",
  208. "version": "0.1.3",
  209. "source": "./mods/review-watch",
  210. "category": "See what's happening",
  211. "tags": [
  212. "band",
  213. "toast"
  214. ]
  215. },
  216. {
  217. "name": "rulebook-guard",
  218. "description": "Writing and git rules: replaces em dashes in prose, and asks before git commit --amend, an unformatted push, or personal info in notes and commits.",
  219. "version": "0.1.4",
  220. "source": "./mods/rulebook-guard",
  221. "category": "My setup (fork and adapt)",
  222. "tags": [
  223. "guard",
  224. "toast"
  225. ]
  226. },
  227. {
  228. "name": "session-saver",
  229. "description": "Names untitled sessions through unpause. /park saves where you left off, and a resumed session shows it.",
  230. "version": "0.1.4",
  231. "source": "./mods/session-saver",
  232. "category": "My setup (fork and adapt)",
  233. "tags": [
  234. "band",
  235. "toast",
  236. "command"
  237. ],
  238. "needs": [
  239. "unpause"
  240. ]
  241. },
  242. {
  243. "name": "snake",
  244. "description": "Snake in a pane while Claude works, paused when it's done. Opt-in, so nothing opens until /snake.",
  245. "version": "0.2.3",
  246. "source": "./mods/snake",
  247. "category": "For fun",
  248. "tags": [
  249. "pane",
  250. "command"
  251. ]
  252. },
  253. {
  254. "name": "token-weather",
  255. "description": "A live forecast of the context window, with a prompt-cache countdown, drawn above the prompt.",
  256. "version": "0.2.4",
  257. "source": "./mods/token-weather",
  258. "category": "See what's happening",
  259. "tags": [
  260. "band"
  261. ]
  262. },
  263. {
  264. "name": "cache-clock",
  265. "description": "A prompt-cache line under your status line, from Claude Code's own cache figures: time left while warm, hit rate and misses, and how many tokens the next message re-caches once cold. /cache-clock setup adds it.",
  266. "version": "0.1.1",
  267. "source": "./mods/cache-clock",
  268. "category": "See what's happening",
  269. "tags": [
  270. "statusline",
  271. "command"
  272. ],
  273. "needs": [
  274. "node"
  275. ]
  276. },
  277. {
  278. "name": "usage-meter",
  279. "description": "Your plan's 5-hour and 7-day usage as small bars above the prompt, with the reset countdown and the session's cost.",
  280. "version": "0.1.2",
  281. "source": "./mods/usage-meter",
  282. "category": "See what's happening",
  283. "tags": [
  284. "band",
  285. "toast"
  286. ]
  287. },
  288. {
  289. "name": "where-am-i",
  290. "description": "A live recap above the prompt: goal, doing now, waiting on you, next. /where for a longer one.",
  291. "version": "0.1.10",
  292. "source": "./mods/where-am-i",
  293. "category": "See what's happening",
  294. "tags": [
  295. "band",
  296. "command"
  297. ]
  298. },
  299. {
  300. "name": "switchboard",
  301. "description": "Picks the model for each subagent that names none, with OpenAI's Decisions API or Jev, from its short label only. One line per spawn above the prompt; /route shows each pick and what each subagent cost.",
  302. "version": "0.3.4",
  303. "source": "./mods/switchboard",
  304. "category": "Spend less",
  305. "tags": [
  306. "band",
  307. "pane",
  308. "guard",
  309. "command"
  310. ]
  311. },
  312. {
  313. "name": "openai-balance",
  314. "description": "Your OpenAI API credit above the prompt: an estimated balance with a gauge, today's spend, where the money mostly went, and the last call. /openai-balance shows the breakdown.",
  315. "version": "0.1.3",
  316. "source": "./mods/openai-balance",
  317. "category": "See what's happening",
  318. "tags": [
  319. "band",
  320. "command"
  321. ],
  322. "needs": [
  323. "OpenAI Admin key"
  324. ]
  325. },
  326. {
  327. "name": "openrouter-balance",
  328. "description": "Your OpenRouter credit above the prompt: the balance with a gauge, today's spend and where the money mostly went. /openrouter-balance shows the breakdown.",
  329. "version": "0.1.3",
  330. "source": "./mods/openrouter-balance",
  331. "category": "See what's happening",
  332. "tags": [
  333. "band",
  334. "command"
  335. ],
  336. "needs": [
  337. "OpenRouter key"
  338. ]
  339. },
  340. {
  341. "name": "gotham-night",
  342. "description": "A Gotham theme for the Claude Code Desktop app: searchlights sweep while Claude works, and when it needs you the signal lights with a burst of bats. Desktop app only.",
  343. "version": "0.2.3",
  344. "source": "./mods/gotham-night",
  345. "category": "For fun",
  346. "tags": [
  347. "theme"
  348. ],
  349. "needs": [
  350. "Claude Code Desktop app"
  351. ]
  352. },
  353. {
  354. "name": "matrix-mode",
  355. "description": "A Matrix theme for the Claude Code Desktop app: green code rains while Claude works, and when it needs you the rain slows and parts for a waiting cursor. Desktop app only.",
  356. "version": "0.1.0",
  357. "source": "./mods/matrix-mode",
  358. "category": "For fun",
  359. "tags": [
  360. "theme"
  361. ],
  362. "needs": [
  363. "Claude Code Desktop app"
  364. ]
  365. },
  366. {
  367. "name": "stark-lab",
  368. "description": "A JARVIS theme for the Claude Code Desktop app: a holographic workshop with a spinning arc reactor while Claude works, and when it needs you the reactor locks and flares gold. Desktop app only.",
  369. "version": "0.1.0",
  370. "source": "./mods/stark-lab",
  371. "category": "For fun",
  372. "tags": [
  373. "theme"
  374. ],
  375. "needs": [
  376. "Claude Code Desktop app"
  377. ]
  378. },
  379. {
  380. "name": "interstellar",
  381. "description": "An Interstellar theme for the Claude Code Desktop app: a black hole turns while Claude works, and when it needs you a ship holds station and hails you with its beacon. Desktop app only.",
  382. "version": "0.1.0",
  383. "source": "./mods/interstellar",
  384. "category": "For fun",
  385. "tags": [
  386. "theme"
  387. ],
  388. "needs": [
  389. "Claude Code Desktop app"
  390. ]
  391. },
  392. {
  393. "name": "akatsuki-night",
  394. "description": "An Akatsuki theme for the Claude Code Desktop app: red clouds drift past a blood moon whose eye slowly turns, crows resting on a shrine gate. Desktop app only.",
  395. "version": "0.1.0",
  396. "source": "./mods/akatsuki-night",
  397. "category": "For fun",
  398. "tags": [
  399. "theme"
  400. ],
  401. "needs": [
  402. "Claude Code Desktop app"
  403. ]
  404. }
  405. ]
  406. }
README.md · README · 107 lines
  1. <p align="center"><img src="images/claude-wave.gif" alt="" width="40"></p>
  2. <h1 align="center">Claude Code mods and themes</h1>
  3. <p align="center"><b>Make Claude Code show what it's doing, and look the way you want.</b><br>Plugins for Claude Code, built on function hooks: live lines above the prompt, guards, panes, games and Desktop themes. Install only the ones you want.</p>
  4. <p align="center">
  5. <a href="https://www.npmjs.com/package/claude-code-mods"><img src="https://img.shields.io/npm/v/claude-code-mods.svg" alt="npm"></a>
  6. <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT"></a>
  7. <a href="https://github.com/hamzafer/claude-code-mods/actions/workflows/ci.yml"><img src="https://github.com/hamzafer/claude-code-mods/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
  8. </p>
  9. <a id="mission-control"></a>
  10. ![mission-control at 4x: two subagents and a logout feature landing across four files](images/mission-control.gif)
  11. <p align="center"><sub><b>mission-control</b>: every subagent, tool call and file they touch, live. Shown at 4x. <a href="docs/mods.md#%EF%B8%8F-mission-control">Details</a></sub></p>
  12. <a id="-install"></a>
  13. ## Install
  14. ```sh
  15. npx claude-code-mods@latest
  16. ```
  17. Tick the mods you want, press Enter, restart Claude Code. Needs Claude Code 2.1.287+. [Flags and other ways to install](docs/install.md).
  18. <table>
  19. <tr>
  20. <td align="center" width="33%"><a href="docs/mods.md#-context-bar"><img src="images/context-bar.png" alt="context-bar: Claude Code context window usage as a stacked bar, a color per category" width="260"></a><br><b>context-bar</b><br>what fills your context</td>
  21. <td align="center" width="33%"><a href="docs/mods.md#-review-watch"><img src="images/review-watch.png" alt="review-watch: live lines for running Codex and subagent code reviews in Claude Code" width="260"></a><br><b>review-watch</b><br>running code reviews, live</td>
  22. <td align="center" width="33%"><a href="docs/mods.md#-md-preview"><img src="images/md-preview.png" alt="md-preview: Markdown that Claude Code edits, rendered like GitHub next to the diff" width="260"></a><br><b>md-preview</b><br>Markdown rendered like GitHub</td>
  23. </tr>
  24. <tr>
  25. <td align="center" width="33%"><a href="docs/mods.md#-blast-radius"><img src="images/gallery/blast-radius.png" alt="blast-radius: a Claude Code hook holds rm -rf and lists the files it would delete" width="260"></a><br><b>blast-radius</b><br>see what <code>rm -rf</code> would delete</td>
  26. <td align="center" width="33%"><a href="docs/mods.md#-switchboard"><img src="images/switchboard.png" alt="switchboard: subagents routed from opus to sonnet and haiku, with confidence and cost" width="260"></a><br><b>switchboard</b><br>cheaper models for subagents</td>
  27. <td align="center" width="33%"><a href="docs/mods.md#-now-playing"><img src="images/now-playing.png" alt="now-playing: Spotify track, progress bar and synced lyrics inside Claude Code" width="260"></a><br><b>now-playing</b><br>Spotify and its lyrics, live</td>
  28. </tr>
  29. </table>
  30. <a id="-the-mods"></a>
  31. ## The mods
  32. Full descriptions, commands and setup notes are in [docs/mods.md](docs/mods.md). More screenshots are in [docs/demo.md](docs/demo.md).
  33. ### See what's happening
  34. - 🛰️ [**mission-control**](docs/mods.md#%EF%B8%8F-mission-control): agents, tool calls and the code they touch
  35. - 📊 [**context-bar**](docs/mods.md#-context-bar): what fills your context window
  36. - 🌦️ [**token-weather**](docs/mods.md#%EF%B8%8F-token-weather): context fill and a prompt-cache countdown
  37. - ⏱️ [**cache-clock**](docs/mods.md#%EF%B8%8F-cache-clock): cache time left, hit rate and misses
  38. - 📍 [**where-am-i**](docs/mods.md#-where-am-i): goal, doing now, waiting on you
  39. - ➡️ [**next-steps**](docs/mods.md#%EF%B8%8F-next-steps): likely next prompts, one key to draft
  40. - 💰 [**usage-meter**](docs/mods.md#-usage-meter): plan usage, resets and session cost
  41. - 🔥 [**heatmap**](docs/mods.md#-heatmap): a GitHub-style grid of your Claude time
  42. - 💳 [**openai-balance**](docs/mods.md#-openai-balance): your OpenAI API credit (needs an Admin key)
  43. - 🪙 [**openrouter-balance**](docs/mods.md#-openrouter-balance): your OpenRouter credit and spend
  44. - 📡 [**agent-radar**](docs/mods.md#-agent-radar): one live line per subagent or shell
  45. - 🔍 [**review-watch**](docs/mods.md#-review-watch): running code reviews, live
  46. - 🌐 [**browser-lanes**](docs/mods.md#-browser-lanes): whether this session has the browser
  47. - 🕌 [**prayer-times**](docs/mods.md#-prayer-times): the current prayer and the next
  48. - 🎬 [**replay-theater**](docs/mods.md#-replay-theater): the last turn's edits, one diff at a time
  49. - 📝 [**md-preview**](docs/mods.md#-md-preview): Markdown edits rendered like GitHub (needs Chrome)
  50. ### Guard your repo
  51. - 💥 [**blast-radius**](docs/mods.md#-blast-radius): see what `rm -r` would delete before it runs
  52. - 🔑 [**secret-guard**](docs/mods.md#-secret-guard): keeps API keys out of Claude's context and your commits
  53. ### Spend less
  54. - 🔀 [**switchboard**](docs/mods.md#-switchboard): cheaper models for subagents, with their costs
  55. ### My setup (fork and adapt)
  56. - 👀 [**glance**](docs/mods.md#-glance): meetings, PRs, issues and DMs (needs `gh` and connectors)
  57. - 🚦 [**merge-gate**](docs/mods.md#-merge-gate): holds merges until CI and Codex pass (needs `gh`, Codex)
  58. - 📏 [**rulebook-guard**](docs/mods.md#-rulebook-guard): enforces my writing and git rules
  59. - 💾 [**session-saver**](docs/mods.md#-session-saver): where you left off (needs [unpause](https://github.com/hamzafer/unpause))
  60. ### For fun (opt-in)
  61. - 📱 [**reels**](docs/mods.md#-reels-and-snake): Shorts while Claude works
  62. - 🐍 [**snake**](docs/mods.md#-reels-and-snake): Snake while Claude works
  63. - 🎵 [**now-playing**](docs/mods.md#-now-playing): Spotify and its lyrics (needs macOS)
  64. ### Themes (Desktop app)
  65. Most themes have two scenes, one while Claude works and one when it needs you; [**akatsuki-night**](docs/mods.md#-akatsuki-night) has one.
  66. <p align="center"><a href="docs/mods.md#-gotham-night"><img src="images/gotham-night.gif" width="560" alt="gotham-night: Why do we fall, Bruce? Searchlights sweep a rainy city, then the signal lights and bats scatter"></a><br><a href="docs/mods.md#-gotham-night"><b>gotham-night</b></a><br>searchlights, then the bat signal</p><!-- [**gotham-night**] -->
  67. <table>
  68. <tr>
  69. <td align="center" width="50%"><a href="docs/mods.md#-matrix-mode"><img src="images/matrix-mode.png" alt="matrix-mode: green code rain slowed to a crawl, parting in the upper right for a prompt that reads your move with a block cursor" width="400"></a><br><a href="docs/mods.md#-matrix-mode"><b>matrix-mode</b></a><br>code rain, waiting cursor</td><!-- [**matrix-mode**] -->
  70. <td align="center" width="50%"><a href="docs/mods.md#-stark-lab"><img src="images/stark-lab.png" alt="stark-lab: a dark holographic workshop, the arc reactor at the right locked and glowing gold inside targeting brackets, ping rings spreading from it" width="400"></a><br><a href="docs/mods.md#-stark-lab"><b>stark-lab</b></a><br>arc reactor, gold flare</td><!-- [**stark-lab**] -->
  71. </tr>
  72. <tr>
  73. <td align="center" width="50%"><a href="docs/mods.md#-interstellar"><img src="images/interstellar.png" alt="interstellar: deep space, a black hole with a glowing disc at the upper right, a small ring ship below it sending signal rings, an ice planet in the lower left" width="400"></a><br><a href="docs/mods.md#-interstellar"><b>interstellar</b></a><br>black hole, ship hailing</td><!-- [**interstellar**] -->
  74. <td align="center" width="50%"><a href="docs/mods.md#-akatsuki-night"><img src="images/akatsuki-night.png" alt="akatsuki-night: a blood-red moon with three comma marks in its eye over a shrine gate, red clouds with pale outlines and crows resting on the gate" width="400"></a><br><a href="docs/mods.md#-akatsuki-night"><b>akatsuki-night</b></a><br>blood moon, red clouds</td>
  75. </tr>
  76. </table>
  77. <a id="-community-mods"></a>
  78. ## Community mods
  79. Built by other people and maintained in their own repos, so read the code before you install. They show up last in the checklist. [See them all](docs/community.md), or open a PR to add yours.
  80. **Community pick: [image-view](https://github.com/jarrodwatts/claude-image-view)** by [@jarrodwatts](https://github.com/jarrodwatts) shows the images you paste as thumbnails above the prompt.
  81. <p align="center"><img src="images/community/image-view.png" width="600" alt="image-view: a thumbnail of the pasted image, labeled #1, above the prompt that holds [Image #1]"></p>
  82. ## More
  83. - [Add your own mod](CONTRIBUTING.md)
  84. - My earlier project: [cursor-commands](https://github.com/hamzafer/cursor-commands), 670+ stars for Cursor slash commands
mods/agent-radar/hooks/watch.ts · Bundled script · 111 lines · 1 finding marked
  1. // Pure helpers for background Bash commands: labels, output paths and output tails.
  2. // Nothing here touches `$`, so the tests call it directly.
  3. // Where a command starts: after `;`, `&&`, `|`, `(`, then `timeout 900`, `nohup`, `FOO=1` and the like.
  4. const START = String.raw`(?:^|[;&|(])\s*(?:\w+=\S*\s+)*(?:(?:timeout|nohup|nice|env|time|command)(?:\s+[-\w.=:]+)*\s+)?(?:\S*\/)?`
  5. const AGENT = new RegExp(`${START}(?:(codex)\\s+exec|(opencode)\\s+run|(cursor-agent|agy|crush|copilot|qwen|cline|omp|hermes))(?=\\s|$)`)
  6. const MODEL = /(?:^|\s)(?:--model|-m)(?:\s+|=)["']?(\w[\w.:/-]*)/
  7. const CODEX_MODEL = /\s-c\s+["']?model\s*=\s*\\?["']?([\w.:/-]+)/
  8. const MAX_COMMAND = 4096 // the agent CLI and its --model come early; a huge command must not stall the regexes
  9. // The agent CLI a shell command runs and its `--model`, or undefined for any other command.
  10. export function agentOf(full: string): { agent: string; model?: string } | undefined {
  11. const command = full.slice(0, MAX_COMMAND)
  12. const m = AGENT.exec(command)
  13. if (!m) return undefined
  14. const agent = m[1] ?? m[2] ?? m[3]
  15. if (!agent) return undefined
  16. const part = command.slice(m.index).split(/\s*(?:&&|\|\||;|\|(?!&))\s*/)[0]!
  17. // A quoted prompt may mention --model: look past quoted strings, except as a flag's own value.
  18. const bare = part.replace(/(?<!(?:--model|-m)[\s=])(["'])(?:(?!\1).)*\1/g, ' _ ')
  19. const model = MODEL.exec(bare)?.[1] ?? CODEX_MODEL.exec(part)?.[1]
  20. return { agent, model }
  21. }
  22. // What the band calls a background shell: the agent and model it runs, else the Bash
  23. // description, else the program it runs. `detail` is the other one, for the pane: never the whole command line.
  24. export function shellLabel(command: string, description?: string): { label: string; detail: string } {
  25. const flat = clean(command.slice(0, MAX_COMMAND)).replace(/\s+/g, ' ').trim()
  26. const text = clean(description ?? '').trim().slice(0, 200) || program(flat)
  27. const a = agentOf(command)
  28. return a ? { label: a.model ? `${a.agent} ${a.model}` : a.agent, detail: text } : { label: text, detail: program(flat) }
  29. }
  30. // The tools whose second word is a subcommand worth naming: `git push`, `npm test`.
  31. const SUBCOMMANDS = new Set(['git', 'gh', 'npm', 'pnpm', 'yarn', 'bun', 'docker', 'cargo', 'go', 'kubectl', 'make'])
  32. // A command's program, never its arguments (a token often sits there): `curl -H "…" url` is `curl`,
  33. // `cd /x && npm test` is `npm test`. A start that is no plain name (`FOO=1`, a quote, a subshell) says so.
  34. export function program(command: string): string {
  35. const words = command.replace(/^\s*cd\s+\S+\s*(?:&&|;)\s*/, '').trim().split(/\s+/)
  36. const name = words[0]!.slice(words[0]!.lastIndexOf('/') + 1)
  37. if (!/^[\w.+-]{1,30}$/.test(name)) return 'a shell command'
  38. return SUBCOMMANDS.has(name) && /^[a-z][a-z-]{0,19}$/.test(words[1] ?? '') ? `${name} ${words[1]}` : name
  39. }
  40. // Where Claude Code keeps a background shell's output: `.../tasks/<id>.output` in 2.1.x
  41. // ("Output is being written to: ..."), "written to: ....output" in older text, or the result's own field.
  42. // Only an absolute path with no control characters or `..` is taken: lsof and tail run on it.
  43. export function outputPathOf(text: string | undefined, result?: unknown): string | undefined {
  44. const ok = (p: unknown): p is string => typeof p === 'string' && /^\/[^\x00-\x20\x7f-\x9f]+\.output$/.test(p) && !p.split('/').includes('..')
  45. const r = result && typeof result === 'object' ? (result as { backgroundOutputPath?: unknown }) : undefined
  46. if (ok(r?.backgroundOutputPath)) return r.backgroundOutputPath
  47. const t = (text ?? '').slice(0, 4096)
  48. const found = [/(?:written to|output (?:file )?(?:is|at)):?\s+(\/\S+\.output)/i.exec(t)?.[1], /(\/[^\s"'`]*\/tasks\/[\w-]+\.output)/.exec(t)?.[1]]
  49. return found.find(ok)
  50. }
  51. export function baseName(path: string) {
  52. return path.slice(path.lastIndexOf('/') + 1)
  53. }
  54. // Text from a command is shown on the terminal: drop every escape sequence (CSI, OSC such as the
  55. // clipboard write, DCS and the like, 7- and 8-bit) and every other control character, keeping tab and line breaks.
  56. const ESCAPES = /\x1b(?:\[[0-?]*[ -/]*[@-~]|[\]PX^_][\s\S]*?(?:\x07|\x1b\\|$)|[@-Z\\-_])|\x9b[0-?]*[ -/]*[@-~]|[\x90\x98\x9d\x9e\x9f][\s\S]*?(?:\x07|\x9c|$)|[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f‪-‮⁦-⁩]/g
    • Note: Usual in code (characters a sanitizer strips): Contains 4 bidirectional-override character(s), which make text display in a different order from how it's read
    • Line 65 on GitHub
  57. export function clean(text: string) {
  58. return text.replace(ESCAPES, '')
  59. }
  60. // The last n non-empty lines of an output tail (carriage-return progress included), each cut short.
  61. export function tailLines(text: string, n = 8): string[] {
  62. return clean(text)
  63. .split(/[\r\n]+/)
  64. .map(l => l.trimEnd())
  65. .filter(l => l.trim() !== '')
  66. .slice(-n)
  67. .map(l => l.slice(0, 200))
  68. }
  69. // The tail of each file named, each after a \001 line with its path: one process for all of them.
  70. export const TAILS_SH = `# radar:tails
  71. for f in "$@"; do printf '\\001%s\\n' "$f"; tail -c 16384 -- "$f" 2>/dev/null | LC_ALL=C tr -d '\\001'; done
  72. exit 0
  73. `
  74. // Every file some process we can see holds open, as `lsof -Fn` lines (`n<path>`), from Linux's /proc:
  75. // for a Linux machine without lsof. Exits 2 elsewhere (macOS, or Git Bash, whose /proc shows only its
  76. // own processes), so the caller knows it cannot say.
  77. export const OPEN_SH = `# radar:open
  78. [ "$(uname -s)" = Linux ] && [ -d /proc/self/fd ] || exit 2
  79. ls -l /proc/[0-9]*/fd/ 2>/dev/null | sed -n 's/.* -> /n/p'
  80. exit 0
  81. `
  82. // Splits "\001path\n<body>" blocks.
  83. export function blocks(stdout: string): { path: string; body: string }[] {
  84. return stdout
  85. .split('\x01')
  86. .filter(Boolean)
  87. .map(b => {
  88. const nl = b.indexOf('\n')
  89. return nl < 0 ? { path: b.trim(), body: '' } : { path: b.slice(0, nl).trim(), body: b.slice(nl + 1) }
  90. })
  91. }
  92. // File names `lsof -Fn` reports open, as base names (the task id is unique; /tmp and /private/tmp agree).
  93. export function parseOpen(stdout: string): Set<string> {
  94. const open = new Set<string>()
  95. for (const line of stdout.split('\n')) if (line.startsWith('n')) open.add(baseName(line.slice(1).trim()))
  96. return open
  97. }

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.