Speeds up slow local parfor, parfeval, or spmd by switching MATLAB to a thread-based parallel pool. Triggers on poor parallel scaling, per-worker data transfer, or serialisation overhead.
Ships in parallel-computing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Recommend starting a thread pool using parpool("Threads") instead of
using the default process-based pool to speed up local parfor /
parfeval / spmd code.
parfor, parfeval, or spmd on
a local machine.parsim or other Simulink parallel features -- those
require a process-based pool.distributed or codistributed arrays.backgroundPool -- that's for running work
asynchronously (e.g. keeping an app responsive while a computation
runs), not for parallel speed-up. All MATLAB users have 1 worker in
the background pool; users with a Parallel Computing Toolbox license
have multiple workers.For general MATLAB performance tuning (vectorisation, preallocation,
profiling), see matlab-optimize-performance (if available).
Try it on a thread pool. Don't scan the code first -- just run it. Only create a thread pool if the current pool isn't already a thread pool. Avoid unconditionally deleting whichever pool the user has open. The conditional snippet below is a development convenience -- not something to bake into shipped code:
% Development-time helper: ensure a thread pool is active
pool = gcp("nocreate");
if isempty(pool) || ~isa(pool, "parallel.ThreadPool")
delete(pool);
parpool("Threads");
end
The existing parfor / parfeval / spmd block does not need to
change. Thread pools are a drop-in replacement, not a refactor.
Read the diagnostic if it errors. Unsupported features fail
loudly -- MATLAB tells you what isn't allowed and to use a
process-based pool instead. Recommend parpool("Processes"). No
silent wrong answers, no guessing.
Offer the persistent option if the user wants to use a thread
pool "always" or "every time": suggest setting Threads as the
default profile via parallel.defaultProfile("Threads") (R2022b+).
Persists across sessions; no startup script needed.
Be precise. Broadcast variables are zero-copy on threads (the win).
Sliced inputs/outputs (X(:,:,i)) still allocate and copy --
threads only skip the serialize/IPC cost, not the slice itself.
Don't say "zero-copy" or "shared memory eliminates the cost
entirely" without qualifying it.
Always run it, never guess. This is the single most important rule in this skill.
LLM training data is incomplete and stale. Thread-based workers gained support for many functions across releases, and new support is added regularly. Do not assert a function is unsupported on threads from memory, by analogy to similar functions, or because it's not on the skill's short blocker list. Reasoning about thread support without running is the biggest failure mode for this skill -- it has pushed users to a process pool unnecessarily.
The default action is to run the code on a thread pool and read
the diagnostic if it errors. Don't pre-scan the code looking for
blockers. Most functions you'd reach for (load, FFT, imgaussfilt,
numeric and basic I/O primitives) work on threads.
Only if you genuinely cannot run the code (planning context, code review, user can't execute right now) should you fall back to documentation. Use an appropriate documentation skill (if available) to fetch the function's reference page and read its Extended Capabilities -> Thread-Based Environment section. Even then: an absent or older entry is not proof the function won't run -- some thread support is undocumented. When in doubt, try it.
Copyright 2026 The MathWorks, Inc.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/matlab-diagnose-parforDiagnose and fix parfor errors in MATLAB. Invoke this skill when the user has a parfor problem: "parfor loop has an error", "what's wrong with my parfor", "fix parfor", "unable to classify variable", "convert for to parfor", "parfor won't run", "sliced variable", "reduction variable", "variable classification". Also invoke when you read a .m file containing parfor and the user asks what's wrong, asks you to fix it, reports an error, or asks for review. Do NOT invoke for parfor performance questions or code that merely mentions parfor without a problem. ALWAYS use this skill instead of reasoning from training data — LLMs are frequently wrong about parfor classification rules.
/matlab-discover-clustersDiscover MATLAB Parallel Computing Toolbox clusters on the network and in the cloud, and manage their profiles — list, inspect, import, export, set default, validate, and delete. Use whenever the user asks what parallel computing resources, clusters, or cluster profiles they have or can use — e.g. "what parallel resources do I have", "show my cluster profiles", "list clusters", "what clusters can I run on", "where can I submit jobs" — and for any work with parcluster, parallel.listProfiles, parallel.defaultProfile, MJS / Generic / HPC Server / MJSComputeCloud clusters, .mlsettings files, or profile validation. Does NOT cover job submission, parpool, or parfor.
/matlab-setup-gpuDetect and validate GPU availability for MATLAB GPU computing. Use when the user can't use their GPU, or is setting up or selecting a GPU. Triggers on: gpuDevice, GPU setup, check GPU, GPU not found, GPU not working, can't use GPU, GPU not available, unable to find a supported GPU device, compatible GPU, canUseGPU, validateGPU.
/matlab-set-up-worker-stateSet up worker environment and per-worker state for parallel pools. Use when code needs paths, environment variables, database connections, loaded libraries, or expensive objects available on workers before parfor/parfeval runs. Teaches parallel.pool.Constant, parfevalOnAll, and parpool name-value pairs. Also use when refactoring existing code that uses spmd for side-effect setup (an anti-pattern). Triggers: worker setup, pool constant, per-worker state, non-serializable, loadlibrary on workers, database connection parfor, addpath workers, spmd before parfor, worker environment, reduce parfor overhead, parfor setup, resource creation in parallel loop, cannot serialize error, undefined function or variable on workers error, load data per worker, reduce data transfer, parallelize setup, improve parallel code.
/parallel-computing:matlab-use-thread-poolfrom parallel-computing
npx claudepluginhub matlab/matlab-agentic-toolkit --plugin parallel-computingOther plugins' skills for the same job