archive-mail-view

archive-mail-view is a command for Claude Code from PsychQuant/che-apple-mail-mcp. It costs 13 tokens per session (2,017 once invoked), scanned A, original, MIT.

A command that combines the saved emails for one conversation into a single readable thread file. It finds the conversation by matching part of its key in the thread index.

In plain words
What is it for?
Use it to review a complete email conversation, such as a manuscript discussion, as one narrative document. You can also specify a different archive folder.
Why use it?
It removes the need to open and piece together many separate email files. It also uses the archive's standard location and can move an older index into the newer location when needed.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is - [main.pdf](../attachments/2025-12-19_SE-manuscript-10xx-2025/main.pdf) (234 KB).

Part of the che-apple-mail-mcp plugin — 3 skills, 5 commands, 1 hook shipped together

Good fit Use it to review a complete email conversation, such as a manuscript discussion, as one narrative document. You can also specify a different archive folder.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/PsychQuant/che-apple-mail-mcp
agentmods
npx agentmods add commands/psychquant/che-apple-mail-mcp/archive-mail-view

Made for: Claude Code.

Or install che-apple-mail-mcp, the plugin that ships this one along with the rest of its 3 skills, 5 commands, 1 hook.

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 archive-mail-view

README.md
[![agentmods](https://agentmods.dev/badge/commands/psychquant/che-apple-mail-mcp/archive-mail-view/github.svg)](https://agentmods.dev/commands/psychquant/che-apple-mail-mcp/archive-mail-view)
Your own site
<a href="https://agentmods.dev/commands/psychquant/che-apple-mail-mcp/archive-mail-view"><img src="https://agentmods.dev/badge/commands/psychquant/che-apple-mail-mcp/archive-mail-view/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for archive-mail-view

Your own site · 80×15
<a href="https://agentmods.dev/commands/psychquant/che-apple-mail-mcp/archive-mail-view"><img src="https://agentmods.dev/badge/commands/psychquant/che-apple-mail-mcp/archive-mail-view.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,017 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00013 $0.02017
Opus 5 $0.00006 $0.01009
Sonnet 5 $0.00003 $0.00403
Haiku 4.5 $0.00001 $0.00202

Measured 10d ago against content hash 6d2f86e6a4e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

archive-mail-view 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 10d 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.

plugin/commands/archive-mail-view.md · 189 lines

How it starts

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

Archive Mail — Thread View

.threads.json + per-email md 檔,聚合成單一 thread 視圖檔。用來把散在多個 md 檔裡的對話串整理成敘事性的一篇。

使用方式

/archive-mail-view "SE manuscript 10xx-2025"
/archive-mail-view "SE manuscript" communications
/archive-mail-view "SE" communications/emails
  • 第一個參數:thread key(可以是 substring,會模糊匹配 .threads.json 裡的 key)
  • 第二個參數(可選):archive 目錄,預設 communication/emails

執行步驟

Step 1: 解析參數

$ARGUMENTS 取得:

  • thread_query: 要找的 thread key(必填)
  • archive_dir: archive 目錄,預設 communication/emails

若無參數,提示:

Usage: /archive-mail-view <thread-key> [archive-dir]

Try: /archive-mail-view "SE manuscript 10xx-2025"

Step 2: 載入索引(v2.8.0+ 從 .claude/.mail/state/archives/${SLUG}/

NAMESPACE_DIR=".claude/.mail"
SLUG=$(echo "${archive_dir}" | tr '/' '-' | sed 's/^[-.]*//;s/[-.]*$//')
THREADS_FILE="${NAMESPACE_DIR}/state/archives/${SLUG}/threads.json"

# Auto-migrate from legacy(silent)
if [ ! -f "${THREADS_FILE}" ] && [ -f "${archive_dir}/.threads.json" ]; then
  mkdir -p "$(dirname "${THREADS_FILE}")"
  mv "${archive_dir}/.threads.json" "${THREADS_FILE}"
  echo "🔄 Migrated ${archive_dir}/.threads.json → ${THREADS_FILE}"
fi

[ -f "${THREADS_FILE}" ] || {
  echo "ERROR: ${THREADS_FILE} not found (also no legacy ${archive_dir}/.threads.json)."
  echo "Run /archive-mail first to create the index, or /archive-mail-rebuild-threads to regenerate from existing md files."
  exit 1
}

Step 3: 匹配 thread key

.threads.jsonthreads 物件中用 case-insensitive substring match 找符合的 key:

  • 0 個匹配:列出前 20 個可用 thread key 給使用者參考,退出
  • 1 個匹配:使用該 key
  • 多個匹配:列出所有匹配的 thread key(含 message_count、last_message),讓使用者用更具體的 query 重跑

Step 4: 讀取 messages 並依時序排序

對選定的 thread entry:

  1. messages 陣列讀取所有 file 路徑
  2. date 欄位排序(asc,最早的在前)
  3. 對每個 md 檔:
    • Read 該檔
    • 解析 YAML frontmatter 取得 message_id / sender / direction / date / in_reply_to
    • 提取 ## 信件內容 到下一個 --- 之間的 body(不含 thread quote 尾巴;thread quote 的辨識 pattern 同 archive-mail Step 5.5:差出人: / 寄件者: / From: / On .* wrote:
    • 提取 ## 重點摘要(若有)
    • 提取 Attachments: 區塊(若有)

Read the full file on GitHub · 189 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. 10d ago First seen · 189 lines · 13 tokens per session scan A 6d2f86e6a4e8

Subscribe to this mod's changes

archive-mail-view is a command published in the GitHub repository PsychQuant/che-apple-mail-mcp (8 stars, last pushed yesterday), licensed MIT. It adds 13 tokens to every session and 2,017 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.