DeepSpeed AGENTS.md

A second set of project instructions for coding agents working on DeepSpeed, an open-source deep-learning library. It covers contribution rules such as signed-off commits, formatting, pre-commit checks, license headers, import restrictions, and minimal diffs.

In plain words
What is it for?
Use it when editing DeepSpeed to check repository rules, format and validate changed files, add license headers to new files, and keep functional changes focused.
Why use it?
It helps agents follow the project's code-review and continuous-integration requirements while avoiding unnecessary changes.

Instructions file for CodexOpenCode

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 instructions/deepspeedai/deepspeed/agents-md
Clone the repo
git clone --depth 1 https://github.com/deepspeedai/DeepSpeed

Made for: Codex, OpenCode.

Per session 455 This file is loaded in full into every session.
When invoked 455 The same file — it is already loaded in full.
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.00455 $0.00455
Opus 5 $0.00228 $0.00228
Sonnet 5 $0.00091 $0.00091
Haiku 4.5 $0.00046 $0.00046

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

Security

Grade A, and why

DeepSpeed 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 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 33 lines

How it starts

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

AGENTS.md — Workspace-level instructions for AI coding agents

DeepSpeed Project Rules

Commit & CI requirements

  • All non-merge commits MUST have a Signed-off-by line (use --signoff). Get the name and email from git config user.name / git config user.email.
  • Formatting: yapf (column_limit=119, .style.yapf) + flake8 (.flake8).
  • Always verify changed files pass pre-commit checks before committing: pre-commit run --files <changed_files>. Only check modified files, not the entire codebase. Config: .pre-commit-config.yaml.
  • check-torchdist hook: NEVER directly import torch's distributed module. Use import deepspeed.comm as dist instead.
  • New files require license header:
    # SPDX-License-Identifier: Apache-2.0
    # DeepSpeed Team
    

Code change discipline

  • NEVER make cosmetic/formatting-only changes to existing code. Only add/modify lines that are functionally necessary. Minimizing diff noise is critical for code review.
  • Delete dead code decisively — if code is unused at runtime (only referenced in tests), remove it along with its tests.
  • Prefer consolidating tests over proliferating test files.
  • Blend in: when modifying code, read the surrounding context and match the style of neighboring code (naming, spacing, patterns, idioms).
  • Write beginner-friendly code: avoid deeply nested expressions or chained logic. Break complex expressions into clear, named intermediate steps.
  • Comments should explain why, not what. Describe the purpose and reasoning, not the mechanics that the code already shows.
  • New features must include corresponding tests and documentation updates.

Tool Caveats

Edit tool auto-formatter

The Edit tool has a hidden auto-formatter that silently changes quotes, whitespace, blank lines, and line wrapping. For format-sensitive modifications (e.g., when exact formatting matters for pre-commit), use bash with sed, python, or cat instead.

Read the full file on GitHub · 33 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 · 33 lines · 455 tokens per session scan A 78604afb71eb

Subscribe to this mod's changes

DeepSpeed AGENTS.md is an instructions file published in the GitHub repository deepspeedai/DeepSpeed (43,041 stars, last pushed yesterday), licensed Apache-2.0. It adds 455 tokens to every session, about $0.0023 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-09-01.