torchtalk: Instructions file for Codex

AGENTS.md

torchtalk AGENTS.md is an instructions file for Codex, OpenCode from TorchedHat/torchtalk. It costs 2,114 tokens per session, scanned A, original, MIT.

A repository instruction document for coding agents working on TorchTalk, an MCP server that answers structural questions about PyTorch code using file and line evidence. It records setup, test, lint, indexing, and serving commands.

In plain words
What is it for?
Use it as a reference when installing TorchTalk, running its tests and formatting checks, building a PyTorch source index, or starting its MCP server.
Why use it?
It gives an unfamiliar coding agent the project context and the commands needed to verify changes consistently.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions AGENTS.md; mentions Codex.

This is TorchedHat/torchtalk's own configuration. It tells Codex and OpenCode how to work on torchtalk 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 torchtalk configures →

Reuse

Borrowing it

Nothing to install: this file belongs to TorchedHat/torchtalk. 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/TorchedHat/torchtalk/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/TorchedHat/torchtalk

Made for: Codex, 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 torchtalk AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/torchedhat/torchtalk/agents-md/github.svg)](https://agentmods.dev/instructions/torchedhat/torchtalk/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/torchedhat/torchtalk/agents-md"><img src="https://agentmods.dev/badge/instructions/torchedhat/torchtalk/agents-md/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 torchtalk AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/torchedhat/torchtalk/agents-md"><img src="https://agentmods.dev/badge/instructions/torchedhat/torchtalk/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,114 This file is loaded in full into every session.
When invoked 2,114 The same file — it is already loaded in full.
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.02114 $0.02114
Opus 5.5 $0.00846 $0.00846
Sonnet 5.5 $0.00423 $0.00423
Haiku 4.5 $0.00211 $0.00211

Measured 1mo ago against content hash b3d663c67070, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

torchtalk AGENTS.md 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 1mo 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.

AGENTS.md · 166 lines

How it starts

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

AGENTS.md

Instructions for any coding agent working in this repository. Claude Code, Codex, Cursor, Gemini CLI and Copilot all read this file (see docs/agent-setup.md for how each tool picks it up and registers the MCP server).

What this project is

TorchTalk is an MCP server that answers structural questions about PyTorch and PyTorch-based codebases with file and line evidence. It indexes a source checkout once, caches the result, and exposes seven tools (get_status, trace, search, graph, modules, tests, affected) over MCP. Framework conventions live in TOML manifests ("harnesses"), not in code.

Commands

# Install
pip install -e ".[dev]"

# Test (what CI runs)
python -m pytest tests/ -v --cov=torchtalk --cov-report=term-missing
PYTORCH_SOURCE=/path/to/pytorch pytest tests/test_binding_detector_pytorch.py

# Lint and format (what CI runs)
ruff check src/torchtalk tests
ruff format --check src/torchtalk tests

# Harness smoke test against a real checkout
python scripts/harness_smoke.py --harness pytorch --source /path/to/pytorch

# Build the index, then serve
torchtalk index build --source /path/to/pytorch
torchtalk mcp-serve --source /path/to/pytorch

--harness <name> selects a manifest anywhere a source is indexed or served. A repo can ship its own .torchtalk.toml to activate a harness automatically.

Project structure

src/torchtalk/
├── server.py                # FastMCP app: the 7 tool definitions and run_server
├── cli.py                   # CLI: init, status, index, mcp-serve, snapshot, cursor-add
├── indexer.py               # Index build, cache load/save, incremental update, _state
├── harness.py               # ConventionManifest: TOML loading, extends, registry
├── manifests/               # Built-in harnesses: pytorch, torch-extension, vllm, torchvision
├── config.py                # Source resolution (flag, env, config file, .torchtalk.toml)
├── snapshots.py             # Named index snapshots: save/load/diff/export/import
├── symbols.py               # Package-qualified symbol ids for cross-repo merging
├── integration_manifest.py  # Strict loader for tests/integration/*.yml anchors
├── formatting.py            # CompactText / Markdown response formatters
├── tools/                   # Mode handlers behind each MCP tool
│   ├── ops.py               # trace, search
│   ├── graph.py             # graph (callers / calls / impact)
│   ├── modules.py           # modules
│   ├── tests.py             # tests
│   ├── affected.py          # affected
│   └── common.py
└── analysis/
    ├── binding_detector.py  # pybind11 / TORCH_LIBRARY detection (tree-sitter)
    ├── cpp_call_graph.py    # C++ call graph extraction (libclang, parallel)
    ├── libclang_env.py      # libclang discovery and version check
    ├── python_analyzer.py   # Python module/class analysis (AST)
    ├── extractors.py        # Manifest-driven registration extractors (Python AST)
    ├── external_refs.py     # ExternalRef edges: imports into depends_on harnesses
    ├── affected.py          # Changed C++ funcs -> impacted Python tests
    ├── alias_map.py         # Python call -> C++ symbol aliases (native_functions.yaml)
    ├── backward_bridge.py   # Backward ATen functions -> forward ops
    ├── decomp_aliases.py    # @register_decomposition pairs
    ├── dispatch_stub_map.py # Kernel impl symbols -> ATen op
    ├── patterns.py          # Shared constants and exclusion patterns
    └── helpers.py
tests/                       # pytest suite; tests/integration/*.yml are harness anchors
scripts/harness_smoke.py     # Indexes a checkout and checks expected_minimums
docs/                        # adding-a-framework.md, bridge-design.md, agent-setup.md

Read the full file on GitHub · 166 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. 1mo ago First seen · 166 lines · 2,114 tokens per session scan A b3d663c67070

Subscribe to this mod's changes

torchtalk AGENTS.md is an instructions file published in the GitHub repository TorchedHat/torchtalk (12 stars, last pushed 28d ago), licensed MIT. It adds 2,114 tokens to every session, about $0.0085 per session on Opus 5.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-10-08.

Related

torchtalk AGENTS.md compared with instructions from other repositories

torchtalk AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
torchtalk AGENTS.mdTorchedHat/torchtalkInstructions file1228d agoMITA2,114Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode