Get Available Resources
Safely detects the CPU, memory, disk, scheduler and accelerator limits that actually apply to the current process, producing a redacted JSON snapshot plus conservative workload plans.
UtilitiesIntermediate★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
- Runs
scripts/detect_resources.pyto build a picture of what the current process can really use, not just what the host advertises: logical/physical cores, process affinity, cgroup v2 cpuset andcpu.maxquota,memory.maxvsmemory.high, disk free space, Slurm allocation variables, and NVIDIA/AMD/Apple accelerators as backend candidates. - Emits JSON only, with hostnames, absolute paths, cgroup paths, job IDs, device UUIDs and PCI addresses redacted.
- Performs no stress tests, benchmarks, large allocations, write probes or driver changes — fixed-argument, read-only probes with short timeouts and bounded output.
plan_workload.pyderives conservativesuggested_workersandthreads_per_worker;snapshot_tools.pyvalidates and diffs snapshots;accelerator_diagnostics.pyproduces a non-executing GPU diagnostic plan.- Missing observations stay
unknownand are never promoted to "unlimited".
Who it's for
- Researchers and engineers running compute on Slurm clusters or Docker/Kubernetes containers.
- Anyone who has hit OOM kills or CPU oversubscription from guessing worker counts.
- Teams that must share diagnostics without leaking hostnames, paths or job identifiers.
- Developers who want platform-correct reasoning (e.g. Apple silicon unified memory is not separate VRAM).
Examples
- Find real limits inside a container — Ask "how much CPU and memory do I actually have here?" and it runs
python scripts/detect_resources.py, reportingcpu.effective.capacity_coresand the cgroupmemory.maxseparately from host inventory. - Size a parallel job — For 100 tasks at 2GiB each:
plan_workload.py resource-snapshot.json --workload cpu --tasks 100 --memory-per-worker-mib 2048returns worker count and per-worker thread count so BLAS/OpenMP threads don't oversubscribe the allocation. - Track environment drift — Capture snapshots before and after job submission, then
snapshot_tools.py diff before.json after.jsonto see only resource changes, ignoring timestamps. - Pre-flight a GPU backend —
accelerator_diagnostics.py resource-snapshot.json --backend autoreturns read-only query plans with separate visibility, permission and runtime-compatibility gates, without installing or mutating drivers.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/get-available-resources folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/get-available-resources/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/get-available-resources ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Create the skills directory if needed:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r scientific-agent-skills/skills/get-available-resources ~/.claude/skills/ - Confirm you have Python 3.11 or newer:
python --version - (Optional) For better cross-platform coverage of physical cores, affinity, available memory and swap:
uv pip install "psutil==7.2.2"(orpip install). The standard-library path works without it. - Restart Claude Code, then ask something like "detect the CPU and memory actually available to this process".
- To keep a file, pass an explicit
.jsonname in the current directory:python scripts/detect_resources.py --output resource-snapshot.json(add--forceto overwrite).
View source on GitHub ↗License: MIT