dask-optimization

dask-optimization is a skill for Claude Code from tondevrel/scientific-agent-skills. It costs 42 tokens per session (1,868 once invoked), scanned A, original, MIT.

A guide to improving Dask programs that split Python work across multiple CPU cores or machines. It covers data transfer, memory use, task scheduling, and cluster settings.

In plain words
What is it for?
Use it to tune Dask clusters, reduce data movement, handle data larger than available memory, manage uneven workloads, and debug performance with the Dask Dashboard.
Why use it?
It helps explain slow jobs, worker crashes, out-of-memory errors, and wasted time caused by moving data or scheduling tasks.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the scientific-agent-skills plugin — 55 skills, 2 commands, 1 MCP server shipped together

Good fit Use it to tune Dask clusters, reduce data movement, handle data larger than available memory, manage uneven workloads, and debug performance with the Dask Dashboard.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tondevrel/scientific-agent-skills/dask-optimization
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.

Any agent
npx skills add tondevrel/scientific-agent-skills --skill dask-optimization
Clone the repo
git clone --depth 1 https://github.com/tondevrel/scientific-agent-skills

Made for: Claude Code.

Or install scientific-agent-skills, the plugin that ships this one along with the rest of its 55 skills, 2 commands, 1 MCP server.

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-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/tondevrel/scientific-agent-skills/dask-optimization.svg)](https://agentmods.dev/skills/tondevrel/scientific-agent-skills/dask-optimization)
Your own site
<a href="https://agentmods.dev/skills/tondevrel/scientific-agent-skills/dask-optimization"><img src="https://agentmods.dev/badge/skills/tondevrel/scientific-agent-skills/dask-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,868 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.00042 $0.01868
Opus 5 $0.00021 $0.00934
Sonnet 5 $0.00008 $0.00374
Haiku 4.5 $0.00004 $0.00187

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

Security

Grade A, and why

dask-optimization 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 8d 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.

skills/dask-optimization/SKILL.md · 218 lines

How it starts

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

Dask - Advanced Optimization & Cluster Tuning

Parallel computing is not "free". In a distributed environment, the cost of moving data (network I/O) and scheduling tasks can often exceed the computation time. This guide focuses on minimizing overhead and maximizing throughput.

When to Use

  • Your Dask jobs are failing with "KilledWorker" or "OutOfMemory" errors.
  • The Dask Dashboard shows a lot of "red" (communication) or "gray" (idle) time.
  • You need to process datasets that are 10x-100x larger than the total RAM of your cluster.
  • You are building custom distributed algorithms using dask.delayed or Futures.
  • You need to optimize resource allocation (CPU vs. Threads) for specific workloads.

Reference Documentation

Core Principles

1. Communication is the Killer

The fastest distributed task is the one that doesn't need data from another machine. Aim for data locality.

2. The Goldilocks Chunk Size

  • Too small: Scheduler is overwhelmed by millions of tiny tasks (Task Overhead).
  • Too large: Tasks don't fit in memory, causing disk spilling or worker crashes.
  • Target: 100MB - 300MB per chunk for most numeric data.

3. Computation vs. Serialization

Every object sent to a worker must be serialized (pickled). Large Python objects (like complex dicts) passed as arguments can slow down the cluster significantly.

Quick Reference: Performance Profiling

from dask.distributed import Client, performance_report

client = Client("tcp://scheduler-address:8786")

# Generate a detailed HTML report of the computation
with performance_report(filename="dask-report.html"):
    result = big_computation.compute()

# Tip: Check the "Task Stream" for gaps. Gaps mean workers are idle 
# waiting for the scheduler or network.

Read the full file on GitHub · 218 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. 8d ago First seen · 218 lines · 42 tokens per session scan A c055b1188ded

Subscribe to this mod's changes

dask-optimization is a skill published in the GitHub repository tondevrel/scientific-agent-skills (20 stars, last pushed 7mo ago), licensed MIT. It adds 42 tokens to every session and 1,868 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

spark-optimization

Optimize Apache Spark jobs with partitioning, caching, shuffle optimization, and memory tuning. Use when improving Spark performance, debugging slow jobs, or scaling data processing pipelines.

wshobson/agents · 37 tokens

notebooklm

Install, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API.…

teng-lin/notebooklm-py · 79 tokens

debug-inference

Debug why inference.local, direct external inference, or supervisor-only system inference is failing. Use when the user cannot reach a local model server, has provider base URL issues, sees inference verification failures, hits protocol mismatches, or needs to diagnose inference on local vs remote gateways. Trigger…

NVIDIA/OpenShell · 114 tokens

oh-my-posh

Install, configure, or troubleshoot Oh My Posh/ohmyposh: shell init, themes, segments, Nerd Font icons, and prompt setup on PowerShell, zsh, bash, or fish.

JanDeDobbeleer/oh-my-posh · 47 tokens

eagle3-triage

Triage a failed EAGLE3 pipeline run. Identifies which step failed (data synthesis, hidden state dump, training, or benchmark), diagnoses root cause from logs, and suggests fixes. Use when user reports an EAGLE3 pipeline failure or asks why a specific step failed. Also helps debug new model support issues.

NVIDIA/Model-Optimizer · 73 tokens

trulens-instrumentation

Instrument LLM apps with TruLens OTEL-based tracing - from setup to debugging and optimization.

truera/trulens · 25 tokens