A Claude Code plugin that teaches Claude to write correct scientific code.
Scientific code serves truth, not users. This plugin encodes the principles that follow from that distinction: fail loudly instead of silently, require explicit parameters instead of dangerous defaults, prioritize correctness over convenience.
In Claude Code, run:
/plugin marketplace add cemde/Scientific-Coding-Skill
/plugin install scientific-coding@cemde-Scientific-Coding-Skill
The first command adds this repo as a plugin marketplace. The second installs the skill from it. The skill will be available in all your projects.
Clone the repo and copy the skill directory:
# Into a single project
cp -r Scientific-Coding-Skill/skills/scientific-coding your-project/.claude/skills/
# Into all your projects (personal skills)
cp -r Scientific-Coding-Skill/skills/scientific-coding ~/.claude/skills/claude --plugin-dir /path/to/Scientific-Coding-SkillThe skill activates automatically when Claude writes code for scientific computing, data analysis, simulations, numerical methods, or statistical analysis. 12 principles:
- Understand the experiment before deciding what to parameterize
- You are a co-researcher -- ask questions, verify, read papers
- Fail loudly -- a crash beats a silently wrong result
- No defaults in code -- defaults belong in config files
- Be explicit about units, shapes, assumptions, conversions
- Correctness over performance -- numerical stability first
- Raw data is immutable -- never modify, always trace
- Reproducibility is non-negotiable -- explicit seeds, pinned versions
- Validate against reality -- known solutions, conservation laws, convergence
- Statistical honesty -- no p-hacking, report effect sizes
- Do not reinvent -- use established tools, skip custom infrastructure
- Do not refactor validated code -- working science code is sacred
See skills/scientific-coding/SKILL.md for the full set of principles.
Scientific-Coding-Skill/
├── .claude-plugin/
│ ├── plugin.json # Plugin manifest
│ └── marketplace.json # Marketplace catalog
├── skills/
│ └── scientific-coding/
│ ├── SKILL.md # Core principles
│ └── examples/
│ ├── common-mistakes.md
│ └── full-analysis.md
└── README.md
Contributions are welcome. In particular:
- Validation experiments. Have you tested whether this skill actually changes Claude's coding behavior? We would love to see before/after comparisons, failure cases, or systematic evaluations.
- New principles or examples. If you have encountered a scientific coding mistake that LLMs make repeatedly, open an issue or PR.
- Corrections. If a principle is wrong, misleading, or missing nuance, say so.
Open an issue or submit a pull request at github.com/cemde/Scientific-Coding-Skill.
This skill was developed through iterative refinement between a researcher and Claude, attempting to bridge the gap between how LLMs are trained to write code (for production) and how scientific code must be written (for truth). Contributions, criticism, and validation experiments from the community are appreciated.
If you use this skill in your research or reference it in a publication, see CITATION.cff.
@software{emde2025scientificcoding,
author = {Emde, Cornelius},
title = {Scientific Coding Skill},
year = {2025},
url = {https://github.com/cemde/Scientific-Coding-Skill},
version = {0.1.0}
}