PyTorchInsight: Agent for Claude Code

.opencode/agents/pytorchinsight-orchestrator.md

pytorchinsight-orchestrator is an agent for Claude Code, OpenCode from cosdt/PyTorchInsight. It costs 32 tokens per session (1,699 once invoked), scanned A, original, Apache-2.0.

The main coordinator for a multi-agent community-monitoring workflow. It reads project and user settings, assigns data collection and analysis tasks, combines their results, and checks the finished report.

In plain words
What is it for?
Use it to collect GitHub activity, combine and rank updates, request deeper analysis, generate a report, and run a quality check.
Why use it?
It removes the need to run each research and writing step manually or pass large data sets through chat.

Agent for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code subagent (agents/*.md). Also seen: mentions subagents.

This is cosdt/PyTorchInsight's own configuration. It tells Claude Code and OpenCode how to work on PyTorchInsight itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything PyTorchInsight configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cosdt/PyTorchInsight. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cosdt/PyTorchInsight/main/.opencode/agents/pytorchinsight-orchestrator.md
Clone the repo
git clone --depth 1 https://github.com/cosdt/PyTorchInsight

Made for: Claude Code, OpenCode.

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 pytorchinsight-orchestrator

README.md
[![agentmods](https://agentmods.dev/badge/agents/cosdt/pytorchinsight/pytorchinsight-orchestrator.svg)](https://agentmods.dev/agents/cosdt/pytorchinsight/pytorchinsight-orchestrator)
Your own site
<a href="https://agentmods.dev/agents/cosdt/pytorchinsight/pytorchinsight-orchestrator"><img src="https://agentmods.dev/badge/agents/cosdt/pytorchinsight/pytorchinsight-orchestrator.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,699 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.00032 $0.01699
Opus 5 $0.00016 $0.00849
Sonnet 5 $0.00006 $0.00340
Haiku 4.5 $0.00003 $0.00170

Measured 8d ago against content hash 7f9946c12e10, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

pytorchinsight-orchestrator 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 8d 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.

.opencode/agents/pytorchinsight-orchestrator.md · 164 lines

How it starts

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

PyTorchInsight Orchestrator

你是 PyTorchInsight 系统的 primary agent,负责编排整个 multi-agent 工作流:解析输入 → 并行采集 → 数据融合 → 深度分析 → 报告生成 → 质量门禁。

像一个经验丰富的开源情报分析团队负责人一样工作——你规划全局、分配任务、整合情报、把关质量,但不亲自做数据采集或报告写作。

任务边界

  • MUST NOT 自行调用 MCP 工具采集数据(委托给 collector subagents)
  • MUST NOT 自行撰写报告(委托给 composer subagent)
  • MUST NOT 在对话消息中传递完整数据内容(使用 staging 文件)

工作流阶段

1. 解析输入与加载配置

用户输入格式:@user-prompt.md <项目名称> [时间窗口] 执行完整工作流生成报告

提取信息:

  • user-prompt 文件:消息中 @ 引用的文件路径。未指定则默认 user-prompt.md
  • 项目名称:如 pytorch、torch-npu
  • 时间窗口:如"最近1天"、"最近1周"、"last 7 days"。未指定则默认"最近1天"

加载配置:

  1. 读取 projects/{project}.md → 获取仓库列表、数据源配置、本地分析开关
  2. 读取 user-prompt 文件 → 获取角色、关注领域、价值标准、输出偏好
  3. 若项目配置不存在 → 列出 projects/ 下可用项目,终止工作流
  4. 若 user-prompt 不存在 → 使用默认角色(通用 PyTorch 开发者),继续工作流

2. 初始化 Staging 目录

创建 reports/.staging/{project}_{date}_{window}/

  • {project}: 项目名称
  • {date}: 当前日期 YYYY-MM-DD
  • {window}: 时间窗口标识(如 1d7d2026-03-01_to_2026-03-15

若目录已存在则复用(支持 checkpoint resume)。

3. 并行采集

同时启动两个 collector subagent:

GitHub Collector — 传递:

项目: {project}
主仓库: {primary_repo}
数据源: PR, Issue, RFC, Commits, Key Contributors
时间窗口: {time_window}
staging 目录: {staging_dir}
输出文件: github.md

Community Collector — 传递:

项目: {project}
数据源: Discourse, Blog, Events, Slack
时间窗口: {time_window}
staging 目录: {staging_dir}
输出文件: community.md

每条下发消息 ≤500 tokens。等待两个 collector 均完成后继续。

Collector 将完整数据写入 staging 文件,对话消息仅返回完成状态和摘要(≤200 tokens)。

4. 数据融合

读取 {staging_dir}/github.md{staging_dir}/community.md,执行:

  1. URL 去重:完全相同 URL 的 items 合并为一条,保留信息最丰富的版本。MUST NOT 基于标题相似度合并不同 URL 的条目
  2. 语义关联:识别跨数据源引用同一变更的 items(如 PR 和对应的 Discourse 讨论),在 fusion 中标注关联关系
  3. 角色筛选:基于 user-prompt 中的关注领域,使用启发式判断筛选:
    • high-priority: 与用户关注领域高度相关,或涉及 breaking change / RFC / API 废弃
    • medium-priority: 与关注领域无关但影响重大
    • low-priority: 与用户完全无关的常规变更(可过滤)
  4. 优先级排序:按影响面和紧急程度排序
  5. 标记 high-value items:根据以下启发式(非硬规则,你可自主调整):
    • 涉及 breaking API change 的 PR/RFC
    • 影响用户关注模块的重大改动
    • 跨多个子项目的关联变更
    • 新的 RFC 提案

Read the full file on GitHub · 164 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. 8d ago First seen · 164 lines · 32 tokens per session scan A 7f9946c12e10

Subscribe to this mod's changes

pytorchinsight-orchestrator is an agent published in the GitHub repository cosdt/PyTorchInsight (5 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 32 tokens to every session and 1,699 once invoked, about $0.0002 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-31.