pod-resources
Skill4 starsChanged 15 days agoBSD-3-ClauseView on GitHub
Read the CPUs and memory actually available to this container before running parallel or memory-heavy work. Use before sizing any multiprocessing pool, parallel sweep, make -j, or large in-memory job. Allocations change, so never rely on remembered core or RAM numbers; query the cgroup each time.
In this repository18 other files it gives its agents.
- boettiger-lab-stackSkill
- cng-datasetsSkill
- disclose-tool-useSkill
- duckdb-spatialSkill
- gdal-spatialSkill
- github-app-authSkill
- github-rulesetsSkill
- html-figuresSkill
- human-communication-consentSkill
- k8s-never-force-deleteSkill
- nrp-kubernetesSkill
- nrp-s3Skill
- oci-artifactsSkill
- python-envSkill
- reproducible-reportsSkill
- stacked-pr-squash-mergeSkill
- stac-navigationSkill
- writing-voiceSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 30
Keep OMP_NUM_THREADS=1 inside workers, so each process uses one thread.
- Very specific: line 33
Never pkill -f a pattern that also matches your own shell command line.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sizing parallel work to the container
The pod's CPU and memory allocations change over time. Never size a job from a remembered number. Query them at the moment you launch.
Check
python3 ~/.claude/skills/pod-resources/resources.py [MB_PER_WORKER] [HEADROOM_MB]This prints the usable CPUs, the cgroup memory limit, the memory in use (excluding reclaimable page cache) and the memory available, plus a suggested worker count.
In Python
import os, sys
sys.path.insert(0, os.path.expanduser("~/.claude/skills/pod-resources"))
from resources import safe_workers, cpus, memory_mb
workers = safe_workers(mb_per_worker=250, headroom_mb=3000)Pitfalls
nprochonoursOMP_NUM_THREADSand can report 1 on a many-core pod. Use the script (CPU affinity, capped by/sys/fs/cgroup/cpu.max).- Keep
OMP_NUM_THREADS=1inside workers, so each process uses one thread. - Estimate per-worker memory from one run (peak RSS), then add headroom: other processes share the limit.
- Exceeding
memory.maxgets the pod OOM-killed. Re-check before each large launch, because other work may have started. - Never
pkill -fa pattern that also matches your own shell command line; kill by PID.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

