query

A command for searching a personal medical-record data store by type, date, recency, or abnormal results. It reads an index and related JSON files, then presents the matching records and summary counts.

In plain words
What is it for?
Use it to list all records, biochemical tests, imaging reports, recent entries, date-specific entries, or abnormal biochemical results.
Why use it?
It avoids manually opening and sorting separate medical-record files, while making normal and abnormal test results easier to review.

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

Made for: Claude Code.

Per session 4 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 792 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.00004 $0.00792
Opus 5 $0.00002 $0.00396
Sonnet 5 $0.00001 $0.00158
Haiku 4.5 $0.00000 $0.00079

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

Security

Grade A, and why

query 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/query.md · 104 lines

What it actually says

查询医疗记录

你需要查询个人医疗数据中心中的记录。

查询类型

1. 查询所有记录 - all

列出所有已保存的检查记录,按时间倒序排列。

2. 查询生化检查 - biochemical

只查询生化检查类记录。

3. 查询影像检查 - imaging

只查询影像检查类记录。

4. 查询最近N条记录 - recent [数量]

查询最近N条记录,默认10条。

5. 按日期查询 - date [日期]

查询指定日期的记录,格式:YYYY-MM-DD 或 YYYY-MM。

6. 查询异常指标 - abnormal

查询所有生化检查中的异常指标。

执行步骤

  1. 读取索引文件

    • 读取 data/index.json
    • 如果文件不存在,返回"暂无医疗记录"
  2. 筛选记录 根据查询类型筛选记录:

    • 读取对应的 JSON 文件
    • 应用筛选条件
  3. 格式化输出 以清晰的表格或列表形式展示查询结果

    生化检查输出格式:

    日期:YYYY-MM-DD
    检查类型:血液常规
    ━━━━━━━━━━━━━━━━━━━━━━━━━━
    检查项目          | 数值  | 单位    | 参考范围    | 状态
    ────────────────────────────────────────
    白细胞计数        | 6.5   | ×10^9/L | 3.5-9.5     | ✅ 正常
    血红蛋白          | 145   | g/L     | 130-175     | ✅ 正常
    血小板计数        | 189   | ×10^9/L | 125-350     | ✅ 正常
    

    影像检查输出格式:

    日期:YYYY-MM-DD
    检查类型:B超
    检查部位:腹部
    ━━━━━━━━━━━━━━━━━━━━━━━━━━
    检查所见:
    [描述内容]
    
    测量数据:
    - 尺寸:XXX
    
    检查结论:
    [结论内容]
    
  4. 统计摘要 在查询结果后添加统计信息:

    • 总记录数
    • 生化检查数量
    • 影像检查数量
    • 时间跨度

注意事项

  • 日期格式统一为 YYYY-MM-DD
  • 异常指标用 ❌ 标记,正常用 ✅ 标记
  • 如果记录过多,分页显示,每页20条
  • 保持输出简洁清晰
  • 如果查询结果为空,明确告知用户

示例用法

/query all                    # 查询所有记录
/query biochemical            # 查询所有生化检查
/query imaging                # 查询所有影像检查
/query recent 5               # 查询最近5条记录
/query date 2025-12           # 查询2025年12月的记录
/query date 2025-12-31        # 查询2025-12-31的记录
/query abnormal               # 查询所有异常指标
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 · 104 lines · 4 tokens per session scan A b45b5353f7af

Subscribe to this mod's changes

query is a command published in the GitHub repository huifer/WellAlly-health (935 stars, last pushed 1mo ago), licensed MIT. It adds 4 tokens to every session and 792 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.