/research:mathematicafrom Research
Runs Mathematica (wolframscript) for symbolic computation, arbitrary-precision numerics, closed-form integration/ODE solving, special functions, and programmatic .nb notebook generation. Activates when Python's sympy/mpmath would fall short.
Ships in Research. 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.
None: SKILL.md is the whole skill.
Needs a Wolfram kernel and wolframscript on PATH, supplied by Mathematica or the
Wolfram Engine with its own licence. Check with wolframscript -c '$Version'.
If the command is not on PATH but Mathematica is installed, find it inside the
application bundle. On a Mac, it is at Contents/MacOS/wolframscript within the
Wolfram, Mathematica or WolframScript app. Use the full path or link it onto PATH.
If it is not installed, tell the user before using sympy or mpmath, and explain
what those cannot do. The process commands below (pgrep, ps) are for macOS
and Linux.
Simplify[lhs - rhs] === 0 with assumptions.
An exact zero is a verdict, not a fit.The dividing line: if the result's value depends on being EXACT (a rational, a closed form, a proof of zero) or on digits beyond machine precision being TRUSTWORTHY, use Mathematica. If it depends on ecosystem, throughput, or plumbing, use Python.
wolframscript -c '1/3 + 1/7'
(the value of the last expression is printed; use Print for
intermediate output).wolframscript -file script.wls. Shebang
#!/usr/bin/env wolframscript works for executables.Put[expr, "file.m"] and reload
with Get["file.m"] - exact expressions round-trip losslessly,
including arbitrary-precision numbers and symbols.$ScriptCommandLine (element 1 is the script
path). Any script that reads arguments MUST include a usage example in its
header comment. Without it, the invocation cannot be reconstructed later.Exit[0] success, nonzero for failure; gate results and
exit accordingly so shell callers can branch.ps aux | grep WolframKernel (CPU time advancing), not
by the log.A Wolfram licence caps the number of top-level kernel processes and of subkernels, and the caps differ between licences. Read them from the kernel rather than guessing:
{$MaxLicenseProcesses, $MaxLicenseSubprocesses}
Typical limits are small, such as {2, 8}, and apply machine-wide to every Wolfram process, whatever started it. The Mathematica front end, a wolframscript call and an MCP server all use the same licence pool. Before launching anything:
pgrep -fl WolframKernel
A limit of two processes sounds roomy and is not. The front end holds one whenever Mathematica is open, leaving exactly one for everything else. If a kernel is running (another session, project or application may own it), wait or coordinate; once the limit is reached, the front end included, the next wolframscript fails rather than queues.
The subkernels are one pool, and the first master to ask takes it.
While one master holds the whole pool, a second master's LaunchKernels[]
gets 0. The holder is also refused if it asks for more than the cap.
Each refusal prints No valid password found.
A master with
no subkernels does not fail: ParallelTable, ParallelSubmit and WaitNext
print a nopar warning ("No parallel kernels available; proceeding with sequential evaluation")
and run every job serially on the master, with correct results and exit 0.
A campaign without the pool takes as many times longer as the pool had kernels,
using its time budget without reporting a failure. A parallel script should
check as follows:
n = Min[$MaxLicenseSubprocesses, $ProcessorCount];
If[$KernelCount == 0, LaunchKernels[n]];
If[$KernelCount < n, Print["only ", $KernelCount, " subkernels"]; Exit[1]];
Start the parallel master first. A second master can do serial work alongside
the parallel campaign and slows it only a little. For serial work, call no
Parallel function at all. Those functions launch kernels on first use and
would either take the pool or use sequential evaluation with nopar.
A refused kernel lies about why. It exits non-zero with No valid password found, or
wolframscript reports "not activated or experiencing a license-related problem". This message
means the licence pool is full, not that the licence is broken, and investigating the licence
file and configuration on that basis can take hours. Check pgrep -fl WolframKernel first,
every time.
If a refusal appears while slots seem free, account for every running kernel first. Then try once from a normal terminal before drawing a conclusion. Kill runs by PID and verify with pgrep afterwards. Pattern-kills leave the kernel running unobserved for hours. Follow any stricter local rules in a project's CLAUDE.md or AGENTS.md when working inside that repo.
Check returns its failure value on ANY
message, including harmless warnings (FindRoot::precw, a jsing at a fold that then
converges). Quiet[Check[expr, fail]] still returns fail, as the outer Quiet only
suppresses printing. Check[Quiet[expr], fail], or Off before Check, hides the message
from Check, so it does not return the failure value. If checking messages, name them with
Check[expr, fail, {NDSolve::ndsz, NDSolve::mxst}] or use Off for known-benign ones.
Best of all, test the returned VALUE (numeric, finite, of a sane size) instead of relying
on messages.TimeConstrained[expr, 600, "TIMEOUT"] and handle the sentinel, with
the guard placed close to the risky call.*)-forming text inside a
(* ... *) comment (a literal "A4*)" for instance) terminates the
comment and the script dies at parse with a misleading error. Balance
every bracket before a long run; a small checker that strips comments
and strings and balances brackets saves hours.Function[x, Evaluate[body]]
silently renames to x$ and derivatives evaluate to zero. Build with
Function @@ {var, body} instead.WorkingPrecision -> 25 or more
and SetPrecision all inputs. Certify stability by rerunning at two precisions and comparing.r = Get[...] in a quick diagnostic script silently breaks
code that builds equations in global symbols (r, x, s). Later
Series/D/NDSolve calls use the assigned value as their variable and fail
with ivar/dsvar messages. They may also fail quickly with output that looks
like a genuine result. Use fresh names (rr, res0) in quick scripts,
with the same care as in the main ones.Most Mathematica use is everyday computation - solving an equation for a course, an integral for a figure, an exploration. For that, verify cheaply and move on:
Integrate vs NIntegrate, a DSolve solution substituted back);Escalate to the proof patterns below only when the result is LOAD-BEARING: it will be published or taught as fact, other results build on it, it contradicts an expectation or an earlier result, it was hard to reach (many failure modes on the way), or two methods disagree. The cost of the machinery is real; spend it where being wrong is expensive.
#!/usr/bin/env wolframscript
(* what this computes, one comment; never let a close-paren-star
sequence appear inside it. usage: wolframscript -file this.wls *)
fails = 0;
gate[l_, ok_] := Which[ok === True, Print["PASS ", l],
ok === False, Print["FAIL ", l]; fails++,
True, Print["ABORT non-boolean: ", l]; Exit[2]];
expr = Sin[x]^2 + Cos[x]^2 - 1; (* the expression to prove zero *)
result = TimeConstrained[FullSimplify[expr], 600, "TIMEOUT"];
gate["the identity holds", result === 0];
If[!DirectoryQ["results"], Quiet[CreateDirectory["results"]]];
gate["result saved", Quiet[Put[result, "results/this-run.m"]] =!= $Failed];
If[fails > 0, Exit[1], Print["ALL GATES PASS"]];
A .nb file is plain text holding a Notebook[{Cell[...], ...}]
expression, so a headless kernel can generate one with Export - no
front end needed:
nb = Notebook[{
Cell["Closed form for the Basel sum", "Title"],
Cell["Each input cell re-derives one claim.", "Text"],
Cell["Simplify[Sum[1/n^2, {n, 1, Infinity}] - Pi^2/6]", "Input"],
Cell[BoxData[ToBoxes[0]], "Output"]}];
Export["derivation.nb", nb];
Cell["code", "Input"]) are the robust
form; the front end parses them on first evaluation. Reserve BoxData
for precomputed Output cells (via ToBoxes) so the reader sees results
without evaluating.Import["file.nb", "Notebook"] returns
the Notebook expression; the file is also greppable text.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shocklab/co-scientist-toolkit --plugin research5 skills in this plugin
/convergence-checkDiagnose whether an iterative research or writing loop is genuinely converging or spinning in place. Use this skill when you have iterated several times (on a paper, an experiment, an abstract, a proof, a model) and want an honest read on whether to keep going, stop, or change the question. Triggers include: 'am I going in circles', 'are we converging', 'this is the third time I've reframed this', 'critique keeps finding new problems', 'whack-a-mole', 'should I stop iterating', 'is the data the bottleneck', 'we keep rewriting the abstract', 'each review round finds different issues', or any sense of being stuck in a revise-and-resubmit loop with yourself. Pairs with the paper-review skill, if installed (analyses its outputs across rounds) and the pre-register skill (which prevents the loop in the first place)./decision-pagePut three or more decisions to the user on a private web page (a Claude Artifact) where each decision is a card with Claude's recommendation, the detail to answer from, a tick to accept, the alternatives and a comment box; the user's ticks and comments save to the page, and Claude reads them back instead of asking the user to restate them. Use whenever three or more choices are waiting on the user at once: the findings of a review, options in a plan, items in a status report, a list of changes to approve. Triggers include: 'put these on a decision page', 'make me a decision page', 'give me the choices to tick', 'I've been through the page', 'done' or 'ticked' after a decision page was shared. One or two decisions go in the conversation instead./fable-modeRun any model with Fable-class working discipline. Five gates: scope, evidence, attack, verify, report. Use when the user says 'fable mode', 'use fable mode', or 'think like Fable'; when a hard, high-stakes, or ambiguous problem deserves maximum rigour; or when a smaller model (Opus, Sonnet, Haiku) is doing work that would normally warrant a frontier model. Model-agnostic: the skill encodes the process, not the intelligence./pre-registerIdea triage and pre-registration gate for research. Use this skill BEFORE investing time or compute in a research idea, experiment, or project direction, to decide honestly whether it is worth doing and to commit to predictions before piloting. Triggers include: 'is this idea worth doing', 'should I pursue this', 'pre-register this', 'before I run this experiment', 'what would make this interesting', 'frame this research question', 'help me decide if this is interesting', 'pre-mortem this', 'I have a new research idea', 'is this worth the compute', 'commit my predictions', or any moment of deciding whether a hypothesis/experiment deserves real effort. Especially for computational experiments (RL, ML, numerical) where a cheap pilot is possible. Encodes the rule: ask 'is this interesting?' not just 'is this publishable?', and pre-register before piloting.Other plugins' skills for the same job