By zhaozhiwen
Design, run, and analyze Geant4 simulations for user-defined detectors. Geant4 and ROOT are accessed through a pinned apptainer image; analysis runs on the host with uproot.
Read a run's ROOT output with uproot/numpy and produce plots. Schema-aware — recipes target the example's `Hits` TTree (per-event edep, hit map, per-volume sums); adapt branch names for custom schemas. Load when writing or running anything in analysis/ or interpreting runs/<id>/*.root.
Use when the user wants to inspect a Geant4 run's output schema and plot/summarize it — reads runs/<id>/, dumps the ROOT tree branches, and produces a histogram + summary (canned fast-path for the example schema, generated script otherwise). Runs uproot/numpy/matplotlib. Requires geant4-init to have run.
Use when the user wants to compile/build their Geant4 source tree (a src/ dir with CMakeLists.txt) into a runnable executable. Builds via CMake inside the pinned apptainer image into ./build/. Requires geant4-init to have run.
Use when the user wants to turn a natural-language detector description (shapes, materials, sizes, sensitive volumes, optical radiators) into a validated standalone GDML file under geometries/. Validates in-container before declaring success. Requires geant4-init to have run.
Use when the user wants to drop a working end-to-end sample (GDML-loading main + sample geometry/macro/analysis) into the current task — the default binary for the natural-language detector flow. Copies from the plugin's example template and validates the GDML. Run from inside a task dir created by geant4-task (after geant4-init).
External network access
Connects to servers outside your machine
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
A plugin that lets you build, run, and analyze your own Geant4
simulation by describing what you want in plain language — no slash
commands, no menu. You say "set up a Geant4 project" or "simulate a
1 GeV e⁻ on a lead block" and the matching skill auto-triggers.
Works on both Claude Code and OpenAI Codex CLI with the same skills,
the same engine, and the same analysis stack. Geant4 and ROOT live in a
pinned apptainer image; analysis runs on the host with
uproot.
Status: v0.1.0. Everything is a skill now — the plugin ships no slash commands. Thirteen skills cover the flow: geant4 (the orchestrator / front door), geant4-init (scaffold a project), geant4-task (create a simulation-task subdir), geant4-detector, geant4-example, geant4-preview, geant4-build, geant4-run, geant4-analyze, geant4-validate, plus the reference skills geant4-geometry, geant4-physics-list, and geant4-analysis. The procedural skills are content-neutral — they accept any user-supplied
main.ccand any output schema. The geant4-detector skill writes standalone GDML (including an optical/RINDEX path) for use with whatevermain.ccyou bring. The geant4-example skill is a self-contained smoke test that drops a working demo into a task so you can confirm the toolchain works on your machine before writing any of your own code.
Same skills, same engine (bin/g4run via apptainer), same host-side
uproot analysis. You drive the plugin by describing tasks in natural
language; the relevant skill triggers on its own.
Claude Code:
/plugin marketplace add zhaozhiwen/geant4_claude
/plugin install geant4-claude@geant4-claude
Codex CLI:
codex plugin marketplace add zhaozhiwen/geant4_claude
codex plugin add geant4-claude@geant4-claude
Codex one-command install is a work in progress. Codex's marketplace only packages a plugin from a
plugins/<name>/subdirectory of real files, and this plugin currently lives at the repo root — so theplugin addabove won't snapshot it as-is. Until a Codex packaging step lands, install by copying the plugin into a subdir the marketplace points at (plugins/geant4-claude/). Once installed, the plugin runs fully on Codex — skill discovery, the.g4c/engine pointer, and theensure_venv.shvenv bootstrap are all verified oncodexv0.135.0.
How skills find the engine, CLI-neutrally: the geant4-init skill
scaffolds your project and records the shared engine pointer at .g4c/
(a small shim that resolves the current bin/g4run live, plus an env
file); every other skill — including those run from a task subdir —
locates the runtime by walking up to .g4c/, the same way on either CLI,
and a plugin update never strands the project. On both CLIs, geant4-init also
bootstraps the Python venv on first scaffold — the plugin ships no
session-start hook, so the install is skill-driven and lazy.
uproot numpy matplotlib
(only needed for the geant4-analyze skill).The plugin will pull
docker://ghcr.io/gemc/g4install:11.4.0-almalinux-9.4 on first use; the
tag is pinned in bin/g4run and nowhere else (read it back
with bin/g4run image-tag).
See Works on Claude Code and Codex CLI
above for the install lines. On Claude Code, the marketplace-add command
registers this repo as a marketplace (it ships
.claude-plugin/marketplace.json alongside the plugin manifest) and the
install command pulls the plugin from it; /plugin update handles
upgrades.
Manual git clone (either CLI):
git clone https://github.com/zhaozhiwen/geant4_claude.git ~/.claude/plugins/geant4_claude
# then enable it in your CLI's plugin manager
If you cloned a fork, replace
zhaozhiwenaccordingly. The plugin manifest is at.claude-plugin/plugin.json.
Two things get set up automatically — neither needs your action beyond approving once. The first is registered when the CLI loads the plugin; the second is seeded lazily on first use:
.mcp.json. Claude Code prompts once to approve the external server (https://mcp.deepwiki.com/mcp, no auth, no key); approve it and Claude gains three tools (mcp__deepwiki__ask_question, read_wiki_structure, read_wiki_contents) for asking Geant4 questions in-loop. Used by the plugin as orientation only — answers are LLM-grounded and must be verified against actual Geant4 source before they land in any synthesis. See docs/DESIGN.md §"deepwiki MCP".npx claudepluginhub zhaozhiwen/geant4_claude --plugin geant4-claudeBuild, run, and analyze solid_gemc (SoLID experiment) simulations from natural language via an orchestrator skill that drives bin/solid-gemc-run (works on Claude Code and Codex CLI). JLabCE 2.5 container pulled via wget; tcsh runtime inside container; analysis on the host with uproot.
Smoke-test a local GEMC3 Apptainer runtime with installed GEMC examples.
Smoke-test a local GEMC3 Apptainer runtime with installed GEMC examples.
Memory compression system for Claude Code - persist context across sessions
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.
Streamline people operations — recruiting, onboarding, performance reviews, compensation analysis, and policy guidance. Maintain compliance and keep your team running smoothly.
Write feature specs, plan roadmaps, and synthesize user research faster. Keep stakeholders updated and stay ahead of the competitive landscape.
Create content, plan campaigns, and analyze performance across marketing channels. Maintain brand voice consistency, track competitors, and report on what's working.
Prospect, craft outreach, and build deal strategy faster. Prep for calls, manage your pipeline, and write personalized messaging that moves deals forward.