alterlab-pufferlib

alterlab-pufferlib is a skill for Claude Code from AlterLab-IEU/AlterLab-Academic-Skills. It costs 127 tokens per session (3,793 once invoked), scanned A, original, MIT.

A Python library for training reinforcement-learning agents, which learn by trying actions in an environment and receiving feedback. It supports parallel environments and systems with multiple learning agents.

In plain words
What is it for?
Use it to train PPO agents, create custom environments, connect Gymnasium or PettingZoo environments, and run parallel or multi-agent reinforcement learning.
Why use it?
It helps training run faster when many environment steps are needed, especially for large experiments or multi-agent setups.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the alterlab-data-science plugin — 22 skills shipped together

Good fit Use it to train PPO agents, create custom environments, connect Gymnasium or PettingZoo environments, and run parallel or multi-agent reinforcement learning.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alterlab-ieu/alterlab-academic-skills/alterlab-pufferlib
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AlterLab-IEU/AlterLab-Academic-Skills --skill alterlab-pufferlib
Clone the repo
git clone --depth 1 https://github.com/AlterLab-IEU/AlterLab-Academic-Skills

Made for: Claude Code.

Or install alterlab-data-science, the plugin that ships this one along with the rest of its 22 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for alterlab-pufferlib

README.md
[![agentmods](https://agentmods.dev/badge/skills/alterlab-ieu/alterlab-academic-skills/alterlab-pufferlib/github.svg)](https://agentmods.dev/skills/alterlab-ieu/alterlab-academic-skills/alterlab-pufferlib)
Your own site
<a href="https://agentmods.dev/skills/alterlab-ieu/alterlab-academic-skills/alterlab-pufferlib"><img src="https://agentmods.dev/badge/skills/alterlab-ieu/alterlab-academic-skills/alterlab-pufferlib/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for alterlab-pufferlib

Your own site · 80×15
<a href="https://agentmods.dev/skills/alterlab-ieu/alterlab-academic-skills/alterlab-pufferlib"><img src="https://agentmods.dev/badge/skills/alterlab-ieu/alterlab-academic-skills/alterlab-pufferlib.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 127 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,793 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Memory Poisoning · line 98
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00127 $0.03793
Opus 5 $0.00063 $0.01896
Sonnet 5 $0.00025 $0.00759
Haiku 4.5 $0.00013 $0.00379

Measured 6d ago against content hash cb1b107adb8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

alterlab-pufferlib scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/env_template.py, scripts/train_template.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/data-science/alterlab-pufferlib/SKILL.md · 467 lines

How it starts

The opening of the file, as written. The whole thing — 467 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PufferLib - High-Performance Reinforcement Learning

Overview

PufferLib is a high-performance reinforcement learning library designed for fast parallel environment simulation and training. It achieves training at millions of steps per second through optimized vectorization, native multi-agent support, and efficient PPO implementation (PuffeRL). The library provides the Ocean suite of 20+ environments and seamless integration with Gymnasium, PettingZoo, and specialized RL frameworks.

When to Use This Skill

Use this skill when:

  • Training RL agents with PPO on any environment (single or multi-agent)
  • Creating custom environments using the PufferEnv API
  • Optimizing performance for parallel environment simulation (vectorization)
  • Integrating existing environments from Gymnasium, PettingZoo, Atari, Procgen, etc.
  • Developing policies with CNN, LSTM, or custom architectures
  • Scaling RL to millions of steps per second for faster experimentation
  • Multi-agent RL with native multi-agent environment support

Core Capabilities

1. High-Performance Training (PuffeRL)

PuffeRL is PufferLib's optimized PPO trainer (CleanRL-derived, with optional LSTM via models.LSTMWrapper) built for high-throughput training.

Recommended path — CLI / high-level helper. Drive training from a config (an .ini in pufferlib/config/) rather than hand-wiring the trainer:

# CLI: env name resolves to a registered config + Ocean env
puffer train puffer_breakout --train.device cuda --train.learning-rate 0.015
import pufferlib.pufferl as pufferl
# train(env_name, args=None, vecenv=None, policy=None, logger=None)
pufferl.train('puffer_breakout')

Manual loop. PuffeRL(config, vecenv, policy, logger=None) — note the first arg is a config dict (not flat kwargs), the env arg is vecenv, and the loop is driven by global_step. The three loop methods are real: evaluate(), train(), mean_and_log().

import pufferlib.vector
from pufferlib.pufferl import PuffeRL, load_config

# Native PufferEnv -> default backend=PufferEnv. For wrapped (Gymnasium/
# PettingZoo) envs you MUST pass backend=pufferlib.vector.Multiprocessing.
vecenv = pufferlib.vector.make(MyPufferEnv, num_envs=256)

# load_config returns a nested args dict (sections: 'train', 'vec', 'env', ...)
# with defaults from pufferlib/config/*.ini. PuffeRL takes the 'train' section.
args = load_config('puffer_breakout')
config = {**args['train'], 'env': 'puffer_breakout'}
config['device'] = 'cuda'

trainer = PuffeRL(config, vecenv, my_policy)
while trainer.global_step < config['total_timesteps']:
    trainer.evaluate()      # Collect rollouts
    trainer.train()         # Train on batch
    trainer.mean_and_log()  # Aggregate + log

Read the full file on GitHub · 467 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 467 lines · 127 tokens per session scan A cb1b107adb8a

Subscribe to this mod's changes

alterlab-pufferlib is a skill published in the GitHub repository AlterLab-IEU/AlterLab-Academic-Skills (66 stars, last pushed 5d ago), licensed MIT. It adds 127 tokens to every session and 3,793 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

r-spss-syntax-architect

A guide for turning research hypotheses into repeatable R or SPSS code for statistical analysis. It covers panel data, where the same companies or other units are observed over time, as well as interaction effects, curves, and mediation.

Nero1688/claude-academic-skills · 406 tokens

multi-source-data-integrator

A method for combining independent data sources into one traceable, reproducible research dataset.

Nero1688/claude-academic-skills · 685 tokens

guidance

Control LLM output with regex and grammars, guarantee valid JSON/XML/code generation, enforce structured formats, and build multi-step workflows with Guidance - Microsoft Research's constrained generation framework.

davila7/claude-code-templates · 38 tokens

outlines

Guarantee valid JSON/XML/code structure during generation, use Pydantic models for type-safe outputs, support local models (Transformers, vLLM), and maximize inference speed with Outlines - dottxt.ai's structured generation library.

davila7/claude-code-templates · 50 tokens

ml-expert

Expert-level machine learning, deep learning, model training, and MLOps. Use when the user mentions machine learning, deep learning, neural networks, MLOps, or data science, or when the task involves Machine Learning Fundamentals, Data Preparation, or Model Training.

personamanagmentlayer/pcl · 58 tokens

llm-engineering-expert

Build reliable applications on large language models: prompt design, structured output, evaluation, guardrails, and cost and latency control. Use when the user mentions LLMs, prompts, prompt engineering, few-shot examples, structured or JSON output, function calling, hallucination, model evaluation, token costs…

personamanagmentlayer/pcl · 92 tokens