toggle-popup

toggle-popup is a command for Claude Code from AmaniDawn/DGame. It costs 20 tokens per session (493 once invoked), scanned A, original, MIT.

A command that turns the popup reminder hooks in .claude/settings.json on or off. A hook is an automatic action that runs when a specified event occurs.

In plain words
What is it for?
Enabling or disabling reminders when the agent stops or when it asks for permission, either separately or together.
Why use it?
It lets you control reminder popups without changing unrelated hooks or editing the settings by hand.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/amanidawn/dgame/toggle-popup
Clone the repo
git clone --depth 1 https://github.com/AmaniDawn/DGame

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for toggle-popup

README.md
[![agentmods](https://agentmods.dev/badge/commands/amanidawn/dgame/toggle-popup.svg)](https://agentmods.dev/commands/amanidawn/dgame/toggle-popup)
Your own site
<a href="https://agentmods.dev/commands/amanidawn/dgame/toggle-popup"><img src="https://agentmods.dev/badge/commands/amanidawn/dgame/toggle-popup.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 493 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00493
Opus 5 $0.00010 $0.00246
Sonnet 5 $0.00004 $0.00099
Haiku 4.5 $0.00002 $0.00049

Measured 4d ago against content hash 29e9010d39e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

toggle-popup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/toggle-popup.md · 47 lines

What it actually says

切换 .claude/settings.json 中弹窗提醒 hook 的启用状态。

参数 $ARGUMENTS 决定切换范围(大小写不敏感):

  • 留空 → 目标为两个 hook 全部:StopPermissionRequest
  • stop(或 s)→ 仅 Stop
  • permission(或 p / permissionrequest)→ 仅 PermissionRequest
  • 其他无法识别的参数 → 提示用户有效取值,不修改文件。

执行步骤:

  1. 解析 $ARGUMENTS,确定本次要切换的目标 hook 集合(按上面的规则)。
  2. 读取 .claude/settings.json
  3. 对目标集合判断当前状态并切换(多个目标时作为整体:只要其中任意一个存在就视为「已开启」,执行关闭;全部不存在才视为「已关闭」,执行开启):
    • 已开启 → 关闭:从 hooks 中删除目标集合里的对应键,告知用户已关闭了哪些 hook。
    • 已关闭 → 开启:在 hooks 下为目标集合中的每个 hook 添加下面对应的固定配置,告知用户已开启了哪些 hook。
  4. 写回时保持其余内容(不在目标集合内的 hook、缩进风格)不变。

各 hook 的固定配置:

"Stop": [
  {
    "matcher": "",
    "hooks": [
      { "type": "command", "command": "python \"$CLAUDE_PROJECT_DIR/.claude/hooks/claude_popup.py\"" }
    ]
  }
],
"PermissionRequest": [
  {
    "matcher": "",
    "hooks": [
      { "type": "command", "command": "python \"$CLAUDE_PROJECT_DIR/.claude/hooks/claude_popup.py\"" }
    ]
  }
]

注意:只切换目标集合内的 hook,不要影响 hooks 下的其他类型 hook。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 47 lines · 20 tokens per session scan A 29e9010d39e5

Subscribe to this mod's changes

toggle-popup is a command published in the GitHub repository AmaniDawn/DGame (152 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 493 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.