dask

dask is a cursor rule for Cursor from sanjeed5/awesome-cursor-rules-mdc. It costs 2,735 tokens per session, scanned A, original, CC0-1.0.

A set of coding guidelines for Dask, a Python library that splits data work across larger datasets or multiple computers. It explains its delayed execution model and the overhead of distributed processing.

In plain words
What is it for?
Use it when profiling slow data work, deciding whether to use Dask, writing Dask pipelines, and managing Dask clients explicitly.
Why use it?
It helps developers avoid adding Dask where ordinary Python, Pandas, or NumPy is sufficient and reduces performance problems caused by unnecessary distribution.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when profiling slow data work, deciding whether to use Dask, writing Dask pipelines, and managing Dask clients explicitly.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/sanjeed5/awesome-cursor-rules-mdc/dask
About the project

awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.

sanjeed5/awesome-cursor-rules-mdc · 3,576 stars · on GitHub

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.

Clone the repo
git clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdc

Made for: Cursor.

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 dask

README.md
[![agentmods](https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/dask/github.svg)](https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/dask)
Your own site
<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/dask"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/dask/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 dask

Your own site · 80×15
<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/dask"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/dask.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,735 This file is loaded in full into every session.
When invoked 2,735 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.02735 $0.02735
Opus 5.5 $0.01094 $0.01094
Sonnet 5.5 $0.00547 $0.00547
Haiku 4.5 $0.00274 $0.00274

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

Security

Grade A, and why

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

rules-mdc/dask.mdc · 299 lines

How it starts

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

Dask Best Practices

Dask is a powerful library for scaling Python, but it introduces new paradigms. Writing effective Dask code requires understanding its lazy execution model and distributed computing overhead. This guide outlines critical best practices to ensure your Dask pipelines are reliable, performant, and easy to maintain.

Critical Guidelines

1. Start Small and Profile First

Before reaching for Dask, ensure your problem genuinely requires distributed computing. Optimize your serial code first. Dask adds overhead; it's not a magic bullet for inefficient algorithms.

✅ GOOD: Profile your Pandas/NumPy code to identify bottlenecks. Only then consider Dask for the specific slow parts.

import pandas as pd
import numpy as np
import time

# Simulate a large dataset operation
data = np.random.rand(10_000_000, 10)
df_small = pd.DataFrame(data)

start_time = time.time()
result_small = df_small[df_small[0] > 0.5].groupby(1).mean()
print(f"Pandas execution time: {time.time() - start_time:.2f}s")

# If this is too slow, then consider Dask for the bottleneck.
# Don't start with Dask if Pandas is fast enough.

2. Explicit Client Management

Always create an explicit dask.distributed.Client at the top of your script or notebook. Use it as a context manager to ensure proper shutdown and pass it explicitly to any Dask-aware libraries. Avoid relying on implicit global state.

❌ BAD: Implicit client usage or manual client.close().

# Relying on implicit client or forgetting to close
from dask.distributed import Client
client = Client() # Client might not be closed on error
# ... Dask operations ...
# client.close() # Easily forgotten

✅ GOOD: Use Client as a context manager and pass it explicitly.

from dask.distributed import Client, LocalCluster

# For local development, use LocalCluster
with LocalCluster(n_workers=4, threads_per_worker=1, memory_limit='2GB') as cluster:
    with Client(cluster) as client:
        print(f"Dask Dashboard: {client.dashboard_link}")
        # Your Dask operations here, passing 'client' if needed
        import dask.dataframe as dd
        df = dd.read_csv("s3://bucket/data/*.csv", blocksize="64MB")
        # ...

Read the full file on GitHub · 299 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 · 299 lines · 0 tokens per session scan A c6877ee40c44

Subscribe to this mod's changes

dask is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,576 stars, last pushed 5mo ago), licensed CC0-1.0. It adds 2,735 tokens to every session, about $0.0109 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 cursor rules, from other repositories

pyspark-etl-best-practices-cursorrules-prompt-file

Cursor rules for PySpark ETL development with code style, joins, window functions, map operations, and Iceberg patterns.

PatrickJS/awesome-cursorrules · 3,275 tokens

python-llm-ml-workflow-cursorrules-prompt-file

Cursor rules for Python LLM & ML development with workflow integration.

PatrickJS/awesome-cursorrules · 1,530 tokens

automl-hyperparameter-optimization

AutoML and hyperparameter optimization rules for Python ML projects using Ray Tune, Optuna, PyCaret, and time-series AutoML libraries.

PatrickJS/awesome-cursorrules · 0 tokens

cursorrules

You are building an AI/ML project with Python. The project uses PyTorch for model training, handles data pipelines with proper validation, tracks experiments systematically, and follows production ML engineering practices. Code is type-hinted, tested, and reproducible.

survivorforge/cursor-rules · 2,136 tokens

pyspark-etl-best-practices-cursorrules-prompt-file

Cursor rule "pyspark-etl-best-practices-cursorrules-prompt-file" from XD3an/awesome-ai-coding-all-in-one, covering pyspark etl best practices, 1. project structure, etl class scaffold, config — use a factory function and pipeline composition with .transform().

XD3an/awesome-ai-coding-all-in-one · 3,275 tokens

python-llm-ml-workflow-cursorrules-prompt-file

Cursor rule "python-llm-ml-workflow-cursorrules-prompt-file" from XD3an/awesome-ai-coding-all-in-one, covering role definition, technology stack, coding guidelines, 1. pythonic practices and 2. modular design.

XD3an/awesome-ai-coding-all-in-one · 1,530 tokens