Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

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.

UtilitiesIntermediate33,0303,248AI score 8/10Last updated: Aug 9, 2026

What it does

  • Runs scripts/detect_resources.py to 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 and cpu.max quota, memory.max vs memory.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.py derives conservative suggested_workers and threads_per_worker; snapshot_tools.py validates and diffs snapshots; accelerator_diagnostics.py produces a non-executing GPU diagnostic plan.
  • Missing observations stay unknown and 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

  1. 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, reporting cpu.effective.capacity_cores and the cgroup memory.max separately from host inventory.
  2. Size a parallel job — For 100 tasks at 2GiB each: plan_workload.py resource-snapshot.json --workload cpu --tasks 100 --memory-per-worker-mib 2048 returns worker count and per-worker thread count so BLAS/OpenMP threads don't oversubscribe the allocation.
  3. Track environment drift — Capture snapshots before and after job submission, then snapshot_tools.py diff before.json after.json to see only resource changes, ignoring timestamps.
  4. Pre-flight a GPU backendaccelerator_diagnostics.py resource-snapshot.json --backend auto returns 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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download 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.

  1. Open a terminal and clone the repository: git clone https://github.com/K-Dense-AI/scientific-agent-skills.git
  2. Create the skills directory if needed: mkdir -p ~/.claude/skills
  3. Copy just this skill: cp -r scientific-agent-skills/skills/get-available-resources ~/.claude/skills/
  4. Confirm you have Python 3.11 or newer: python --version
  5. (Optional) For better cross-platform coverage of physical cores, affinity, available memory and swap: uv pip install "psutil==7.2.2" (or pip install). The standard-library path works without it.
  6. Restart Claude Code, then ask something like "detect the CPU and memory actually available to this process".
  7. To keep a file, pass an explicit .json name in the current directory: python scripts/detect_resources.py --output resource-snapshot.json (add --force to overwrite).