dstack: Instructions file for Codex

AGENTS.md

dstack AGENTS.md is an instructions file for Codex, OpenCode from dstackai/dstack. It costs 1,263 tokens per session, scanned A, original, MPL-2.0.

Repository-specific instructions for dstack, a software project for running workloads and services. They describe its folder layout, development commands, coding conventions, and testing practices.

In plain words
What is it for?
For installing dependencies, running the dstack command or server, formatting and checking Python code, finding tests, and working on the frontend or documentation.
Why use it?
They save developers from guessing how the repository is organized or which commands maintainers expect. This helps changes fit the project and be checked consistently.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

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

About the project

dstack is a control plane that provisions and coordinates GPU computing for machine-learning development, training, inference, and agent workloads across cloud providers, Kubernetes, and on-premises clusters. It is used by teams running workloads on NVIDIA, AMD, Google TPU, or Tenstorrent hardware. The catalogue add-ons operate dstack through its CLI, API, or server workflow.

dstackai/dstack · 2,293 stars · on GitHub · dstack.ai

Reuse

Borrowing it

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

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 dstack AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/dstackai/dstack/agents-md"><img src="https://agentmods.dev/badge/instructions/dstackai/dstack/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,263 This file is loaded in full into every session.
When invoked 1,263 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.01263 $0.01263
Opus 5.5 $0.00505 $0.00505
Sonnet 5.5 $0.00253 $0.00253
Haiku 4.5 $0.00126 $0.00126

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

Security

Grade A, and why

dstack 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 6d 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 · 53 lines

How it starts

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

Repository Guidelines

Before touching a subsystem, read the relevant notes in contributing/: ARCHITECTURE.md, PIPELINES.md, LOCKING.md, DATABASE.md, MIGRATIONS.md, RUNS-AND-JOBS.md, AUTOSCALING.md, BACKENDS.md, ORPHAN-CLEANUP.md, GPUHUNT.md, PROXY.md, RUNNER-AND-SHIM.md, FRONTEND.md, DOCS.md, DEVELOPMENT.md, RELEASE.md.

Project Structure & Module Organization

  • Core Python package lives in src/dstack; internal modules (including server) sit under _internal, API surfaces under api, and plugin integrations under plugins.
  • Tests reside in src/tests and mirror package paths; add new suites alongside the code they cover.
  • Frontend lives in frontend (React/webpack) and is built into src/dstack/_internal/server/statics.
  • Docs sources are in mkdocs/docs/ with extra contributor notes in contributing/*.md.

Build, Test, and Development Commands

  • Install deps (editable package with extras): uv sync --all-extras (uses .venv in repo).
  • Run CLI/server from source: uv run dstack ... (e.g., uv run dstack server --port 8000).
  • Lint/format: uv run ruff check . and uv run ruff format ..
  • Type check: uv run pyright -p ..
  • Test suite: uv run pytest.
  • Frontend: from frontend/ run npm install, npm run build, then copy frontend/build into src/dstack/_internal/server/statics/; for dev, npm run start with API on port 8000.

Coding Style & Naming Conventions

  • Python targets 3.10+ with 4-space indentation and max line length of 99 (see pyproject.toml; E501 is ignored but keep lines readable).
  • Imports are sorted via Ruff’s isort settings (dstack treated as first-party).
  • Keep primary/public functions before local helper functions in a module section.
  • Roughly keep function definitions in the order they are referenced within a file so call flow stays easy to follow.
  • Prefer early returns over nested if/else blocks when they make the control flow simpler.
  • Keep private classes, exceptions, and similar implementation-specific types close to the private functions that use them unless they are shared more broadly in the module.
  • Prefer pydantic-style models in core/models.
  • Document attributes when the note adds behavior, compatibility, or semantic context that is not obvious from the name and type. Use attribute docstrings without leading newline.
  • Tests use test_*.py modules and test_* functions; fixtures live near usage.
  • Never make network calls inside a DB session or transaction. Fetch what you need before opening the session, or commit and close it before the call. See contributing/DATABASE.md.
  • Don't use function-level (inner) imports to break circular imports. Inject the dependency or move the shared code to a lower-level module instead.
  • Never edit a migration that has already been applied or released; add a new migration instead.
  • Derive paths under SERVER_DIR_PATH on access (a get_* function), not as module-level constants, so that patching settings.SERVER_DIR_PATH redirects all of them. Tests rely on this to keep server state out of the real ~/.dstack.
  • Preserve client/server backward compatibility when updating Pydantic models. New fields must be excluded from client requests when unset, for compatibility with older servers (see core/compatibility/*.py). If the allowed domain/type of an existing field is extended, server responses may need to be patched for older clients (see server/compatibility/*.py). No need to exclude new fields from server responses, since clients rely on validate_extra_ignore.

Read the full file on GitHub · 53 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. 6d ago Changed · +9 tokens per session e426204d0831
  2. 1mo ago Changed · +12 tokens per session 27b779dab663
  3. 2mo ago First seen · 53 lines · 1,242 tokens per session scan A b7036458ef45

Subscribe to this mod's changes

dstack AGENTS.md is an instructions file published in the GitHub repository dstackai/dstack (2,293 stars, last pushed today), licensed MPL-2.0. It adds 1,263 tokens to every session, about $0.0051 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-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens