pufferlib

pufferlib is a skill for Claude Code, Codex from Zaoqu-Liu/ScienceClaw. It costs 78 tokens per session (3,168 once invoked), scanned A, a copy of pufferlib, MIT.

A Python framework for training reinforcement-learning agents, which learn by receiving rewards from an environment. It supports fast parallel simulations, multiple agents, and environments such as Atari and other games.

In plain words
What is it for?
Use it to train PPO agents, create custom environments, connect existing game environments, and test CNN or LSTM policies.
Why use it?
It helps reduce the time and engineering effort needed to run large reinforcement-learning experiments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to train PPO agents, create custom environments, connect existing game environments, and test CNN or LSTM policies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zaoqu-liu/scienceclaw/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 Zaoqu-Liu/ScienceClaw --skill pufferlib
Clone the repo
git clone --depth 1 https://github.com/Zaoqu-Liu/ScienceClaw

Made for: Claude Code, Codex.

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 pufferlib

README.md
[![agentmods](https://agentmods.dev/badge/skills/zaoqu-liu/scienceclaw/pufferlib/github.svg)](https://agentmods.dev/skills/zaoqu-liu/scienceclaw/pufferlib)
Your own site
<a href="https://agentmods.dev/skills/zaoqu-liu/scienceclaw/pufferlib"><img src="https://agentmods.dev/badge/skills/zaoqu-liu/scienceclaw/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 pufferlib

Your own site · 80×15
<a href="https://agentmods.dev/skills/zaoqu-liu/scienceclaw/pufferlib"><img src="https://agentmods.dev/badge/skills/zaoqu-liu/scienceclaw/pufferlib.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,168 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.
Origin 89% copy Near-identical to another mod 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.00078 $0.03168
Opus 5 $0.00039 $0.01584
Sonnet 5 $0.00016 $0.00634
Haiku 4.5 $0.00008 $0.00317

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

Security

Grade A, and why

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 7d ago.

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.

Origin

This is a copy

89% identical to pufferlib — 7 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/pufferlib/SKILL.md · 436 lines

How it starts

The opening of the file, as written. The whole thing — 436 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+LSTM training algorithm achieving 1M-4M steps/second.

Quick start training:

# CLI training
puffer train procgen-coinrun --train.device cuda --train.learning-rate 3e-4

# Distributed training
torchrun --nproc_per_node=4 train.py

Python training loop:

import pufferlib
from pufferlib import PuffeRL

# Create vectorized environment
env = pufferlib.make('procgen-coinrun', num_envs=256)

# Create trainer
trainer = PuffeRL(
    env=env,
    policy=my_policy,
    device='cuda',
    learning_rate=3e-4,
    batch_size=32768
)

# Training loop
for iteration in range(num_iterations):
    trainer.evaluate()  # Collect rollouts
    trainer.train()     # Train on batch
    trainer.mean_and_log()  # Log results

For comprehensive training guidance, read references/training.md for:

  • Complete training workflow and CLI options
  • Hyperparameter tuning with Protein
  • Distributed multi-GPU/multi-node training
  • Logger integration (Weights & Biases, Neptune)
  • Checkpointing and resume training
  • Performance optimization tips
  • Curriculum learning patterns

Read the full file on GitHub · 436 lines

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. 7d ago First seen · 436 lines · 78 tokens per session scan A 7eea50bcaa56

Subscribe to this mod's changes

pufferlib is a skill published in the GitHub repository Zaoqu-Liu/ScienceClaw (60 stars, last pushed 5mo ago), licensed MIT. It adds 78 tokens to every session and 3,168 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 89% identical to pufferlib, differing in 7 lines, and is treated as a copy.

Related

Other skills, from other repositories

pufferlib

Version-aware guidance for PufferLib reinforcement-learning environments, vectorization, policies, PuffeRL training, evaluation, and safe checkpoint review. Use when adapting Gymnasium/PettingZoo environments to published PufferLib 3.0.0 or working with the redesigned native 4.0 source line.

K-Dense-AI/scientific-agent-skills · 65 tokens

mjlab-to-mjswan

Port an mjlab task to mjswan: turn a local or remote GitHub repo that registers mjlab tasks into a browser app. Use when the user wants to run, visualize, or deploy an mjlab task (theirs or a third party's) in the browser with mjswan.

ttktjmt/mjswan · 0 tokens

ai-game-world-design

Complete mastery guide for designing and building AI-powered game worlds — procedural world generation, NPC behavior trees, LLM-driven dialogue systems, emergent storytelling, economy simulation, player modeling, and real-time difficulty adaptation. Covers the full stack from world-building fundamentals to integrating…

nirholas/three.ws · 88 tokens

PuerTS Agent Development Guide

Guide for developing LLM agents based on PuerTsAgent framework — covers resource directory structure, system-prompt, skills, builtin modules, and best practices.

Tencent/puerts · 39 tokens

ptcg-bc-large-model-submission

Submit a BC (behavioral cloning) Transformer agent for the Pokémon TCG AI Battle competition. Validated 2026-07-30: best.pth (15-epoch BC Large, dmodel=256) → public LB 600.0 (vs prior 165.6 — 3.6× improvement from using the best checkpoint instead of a stale submission). Use when: (1) training a BC agent on Kaggle…

topprismdata/cultivating-ml-agent · 207 tokens

pymc-bayesian-modeling

Bayesian modeling with PyMC. Build hierarchical models, MCMC (NUTS), variational inference, LOO/WAIC comparison, posterior checks, for probabilistic programming and inference.

foryourhealth111-pixel/Vibe-Skills · 48 tokens