interaction

A medication-interaction checker and rule manager. It checks whether medicines may conflict with each other, with a medical condition, with a dose, or with food.

In plain words
What is it for?
It is for checking selected or all current medicines, viewing interaction rules, adding or changing custom rules, deleting rules, and reviewing check history.
Why use it?
It helps identify possible conflicts in a current medication list and keeps a record of previous checks. Results use five severity levels, from A to X.

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/huifer/wellally-health/interaction
Clone the repo
git clone --depth 1 https://github.com/huifer/WellAlly-health

Made for: Claude Code.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,124 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.00008 $0.07124
Opus 5 $0.00004 $0.03562
Sonnet 5 $0.00002 $0.01425
Haiku 4.5 $0.00001 $0.00712

Measured yesterday against content hash f8f3b288a580, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

interaction 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 yesterday.

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/interaction.md · 916 lines

How it starts

The opening of the file, as written. The whole thing — 916 lines — stays where its author put it; the contents beside it link to each section on GitHub.

药物相互作用检查

检测和管理药物相互作用,包括药物-药物、药物-疾病、药物剂量、药物-食物四种类型的相互作用,提供五级严重程度分级(A/B/C/D/X)的专业建议。

操作类型

1. 检查相互作用 - check

检查当前用药方案中存在的相互作用。

参数说明:

  • drugs (可选): 指定要检查的药物,格式:药物1 药物2,不指定则检查所有当前用药

示例:

/interaction check
/interaction check 华法林 阿司匹林
/interaction check 辛伐他汀 氨氯地平

检查内容:

  • 🔄 药物-药物相互作用
  • 🏥 药物-疾病冲突
  • 💊 药物剂量冲突
  • 🍽️ 药物-食物相互作用

2. 列出相互作用规则 - list

查看相互作用规则库。

参数说明:

  • 无参数:列出所有规则统计
  • 级别筛选:A/B/C/D/X(列出特定级别的规则)
  • 药物名称:列出特定药物相关的规则

示例:

/interaction list
/interaction list X
/interaction list 华法林

3. 添加相互作用规则 - add

添加自定义相互作用规则。

参数说明:

  • 规则信息(必填),格式:药物1 药物2 级别(A/B/C/D/X) 风险描述

示例:

/interaction add 阿司匹林 华法林 X 显著增加出血风险
/interaction add 二甲双胍 酒精 C 增加乳酸酸中毒风险

4. 更新相互作用规则 - update

更新已有的相互作用规则。

参数说明:

  • 规则信息(必填),格式:药物1 药物2 [字段] [值]

示例:

/interaction update 阿司匹林 华法林 severity B
/interaction update 华法林 维生素K recommendations 保持摄入量稳定

5. 删除相互作用规则 - delete

删除自定义的相互作用规则。

参数说明:

  • 药物名称(必填),格式:药物1 药物2

示例:

/interaction delete 阿司匹林 华法林

6. 查看检查历史 - history

查看过去的相互作用检查记录。

示例:

/interaction history
/interaction history 2025-12

执行步骤

检查相互作用 (check)

1. 加载当前用药列表

data/medications/medications.json 读取所有活跃药物(active: true)。

如果没有用药记录,输出提示:

💡 提示
暂无用药记录,请先使用 /medication add 添加药物
2. 执行四种检测逻辑
2.1 药物-药物相互作用检测

检测算法:

// 遍历所有药物组合
for (let i = 0; i < medications.length; i++) {
  for (let j = i + 1; j < medications.length; j++) {
    const drug1 = medications[i];
    const drug2 = medications[j];

    // 检查直接匹配(药物名称)
    const directMatch = findInteraction(drug1.name, drug2.name);
    if (directMatch) {
      interactions.push({
        type: 'drug_drug',
        drugs: [drug1, drug2],
        rule: directMatch
      });
    }

    // 检查类别匹配
    const categoryMatch = findCategoryInteraction(drug1, drug2);
    if (categoryMatch) {
      interactions.push({
        type: 'category',
        drugs: [drug1, drug2],
        rule: categoryMatch
      });
    }
  }
}

Read the full file on GitHub · 916 lines

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. yesterday First seen · 916 lines · 8 tokens per session scan A f8f3b288a580

Subscribe to this mod's changes

interaction is a command published in the GitHub repository huifer/WellAlly-health (935 stars, last pushed 1mo ago), licensed MIT. It adds 8 tokens to every session and 7,124 once invoked, about $0.0000 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.