dagster: Command for Claude Code

.claude/commands/analyze_diamond_feedback.md

analyze_diamond_feedback is a command for Claude Code from dagster-io/dagster. It costs 0 tokens per session (1,784 once invoked), scanned A, original, Apache-2.0.

A command that finds the pull request for the current Git branch and reviews comments from Diamond, a code-review tool. It summarizes the feedback and proposes how to address it.

In plain words
What is it for?
Use it to inspect Diamond's suggestions, understand the reported issues, and prepare a plan for fixing them.
Why use it?
It gathers review comments from different parts of a PR so feedback is easier to understand and act on. It avoids manually searching through GitHub reviews and comments.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is dagster-io/dagster's own configuration. It tells Claude Code how to work on dagster 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 dagster configures →

About the project

Dagster is a platform for developing, running, and observing data assets, such as datasets and the processes that produce them. It is used to organize and automate data workflows.

dagster-io/dagster · 16,128 stars · on GitHub · dagster.io

Reuse

Borrowing it

Nothing to install: this file belongs to dagster-io/dagster. 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/dagster-io/dagster/master/.claude/commands/analyze_diamond_feedback.md
Clone the repo
git clone --depth 1 https://github.com/dagster-io/dagster

Made for: Claude Code.

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 analyze_diamond_feedback

README.md
[![agentmods](https://agentmods.dev/badge/commands/dagster-io/dagster/analyze_diamond_feedback/github.svg)](https://agentmods.dev/commands/dagster-io/dagster/analyze_diamond_feedback)
Your own site
<a href="https://agentmods.dev/commands/dagster-io/dagster/analyze_diamond_feedback"><img src="https://agentmods.dev/badge/commands/dagster-io/dagster/analyze_diamond_feedback/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 analyze_diamond_feedback

Your own site · 80×15
<a href="https://agentmods.dev/commands/dagster-io/dagster/analyze_diamond_feedback"><img src="https://agentmods.dev/badge/commands/dagster-io/dagster/analyze_diamond_feedback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 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,784 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.00000 $0.01784
Opus 5 $0.00000 $0.00892
Sonnet 5 $0.00000 $0.00357
Haiku 4.5 $0.00000 $0.00178

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

Security

Grade A, and why

analyze_diamond_feedback 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 9d 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.

.claude/commands/analyze_diamond_feedback.md · 231 lines

How it starts

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

Analyze Diamond Feedback

Description

Fetches all comments for the PR associated with the current branch, identifies feedback from Diamond review tool, analyzes it, and presents a plan to address the issues.

Usage

/analyze_diamond_feedback

Implementation

Step 1: Detect Current Branch PR

  • Get the current branch name using git branch --show-current
  • Find the associated PR using gh pr list --head <branch-name>
  • If no PR found, check all states with --state all
  • If still no PR, inform user that no PR exists for current branch

Step 2: Fetch All PR Comments

  • Use gh pr view <pr-number> --json comments,reviews to get all comments and reviews
  • Parse the JSON output to extract comment details
  • Combine review comments and issue comments for complete coverage

Step 3: Identify Diamond Comments

  • Diamond operates as @graphite-app[bot] - look for this username specifically
  • Filter comments where the author login is "graphite-app" or contains "graphite-app[bot]"
  • Diamond provides:
    • Code review suggestions with inline comments on specific lines
    • Empty review bodies (actual feedback is in review comments)
    • Comments marked "Spotted by Diamond" at the end
  • Extract the Diamond feedback content from review comments, not just top-level reviews

Step 4: Analyze Diamond Feedback

Parse Diamond comments to identify:

  • Code quality issues
  • Security concerns
  • Performance problems
  • Best practice violations
  • Specific file locations and line numbers mentioned
  • Severity levels (if indicated)

Step 5: Create Action Plan

Generate a structured plan with:

  • Priority levels (Critical, High, Medium, Low)
  • Specific files and functions to modify
  • Recommended fixes for each issue
  • Estimated complexity (Simple, Moderate, Complex)
  • Dependencies between fixes

Step 6: Present Comments for Review

  • Display all Diamond comments found
  • Show comment details (author, timestamp, content, file/line if applicable)
  • Allow user to review each comment individually
  • Provide options for each comment:
    • Accept: Include in action plan
    • Reject: Mark as resolved (comment no longer applies)
    • Skip: Leave unresolved but don't include in plan

Read the full file on GitHub · 231 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. 9d ago First seen · 231 lines · 0 tokens per session scan A 5b38e52ad0c7

Subscribe to this mod's changes

analyze_diamond_feedback is a command published in the GitHub repository dagster-io/dagster (16,128 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,784 tokens. 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.