env-management

env-management is a skill for Claude Code, Codex from aipoch/open-science. It costs 105 tokens per session (1,481 once invoked), scanned C, original, Apache-2.0.

A notebook-runtime skill for checking installed Python or R packages and managing packages in the environment used by a notebook.

In plain words
What is it for?
Use it after an import failure, when checking a package version, or when installing, adding, or managing Python and R packages.
Why use it?
It resolves missing-package errors and helps confirm which package versions are available without changing notebook code to avoid the required library.

Skill for Claude CodeCodex

About the project

Open Science is a local-first, model-agnostic workbench for reproducible scientific research. Scientists use its AI agents, Python and R execution, data connectors, and traceable outputs for tasks such as literature review, analysis, simulation, and visualization across macOS, Windows, and Linux.

aipoch/open-science · 3,528 stars · on GitHub

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.

agentmods
npx agentmods add skills/aipoch/open-science/env-management
Any agent
npx skills add aipoch/open-science --skill env-management
Clone the repo
git clone --depth 1 https://github.com/aipoch/open-science

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 env-management

README.md
[![agentmods](https://agentmods.dev/badge/skills/aipoch/open-science/env-management.svg)](https://agentmods.dev/skills/aipoch/open-science/env-management)
Your own site
<a href="https://agentmods.dev/skills/aipoch/open-science/env-management"><img src="https://agentmods.dev/badge/skills/aipoch/open-science/env-management.svg" alt="Measured on agentmods" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,481 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
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 $0.00105 $0.01481
Opus 5 $0.00053 $0.00740
Sonnet 5 $0.00021 $0.00296
Haiku 4.5 $0.00011 $0.00148

Measured 5d ago against content hash 9421043a9c3e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

env-management scanned grade C with 2 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 5d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- `curl | bash`, downloading and running installers, or hand-rolled `subprocess` installs.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- `curl | bash`, downloading and running installers, or hand-rolled `subprocess` installs.
resources/skills/env-management/SKILL.md · 53 lines

How it starts

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

Environment and package management

The notebook runs against the session's bound runtime: the app-managed default (default-python / default-r) unless you bind another one with notebook_bind_runtime — a named environment you created, or one of the user's own detected interpreters. You never activate environments by hand, and you never install packages from inside a cell. Installs happen in the trusted main process through a single tool, manage_packages, and always land in the currently bound runtime. This page is the workflow for getting a package installed and for knowing when a package is not something you can install yourself.

When a package is missing

A run that fails with ImportError / ModuleNotFoundError (Python) or Error in library(x): there is no package called 'x' (R) means the package is not in the environment yet. The fix is one manage_packages call, not a code change. Do not rewrite the cell to use a different library that "does roughly the same thing" — install the package the task actually needs. Do not fall back to reading data or computing results a worse way to dodge the missing import.

Check an installed version

Use inspect_packages(language, packages) when the user asks whether a package is installed in an app-managed runtime or which version is present, or when your code depends on a version-specific feature. It reads package metadata from the session's bound app-managed runtime without importing the package or changing the environment. An installed result does not prove the import will succeed; use notebook_execute when importability itself is the question.

Inspection does not provision a missing app-managed default runtime. If it reports DEFAULT_RUNTIME_NOT_READY, use notebook_execute in that language to prepare the runtime under notebook execution approval, then retry inspect_packages.

inspect_packages intentionally rejects a user-owned external runtime because reading its metadata executes that interpreter. Use notebook_execute for an external runtime so the user sees the normal notebook execution approval.

Read the full file on GitHub · 53 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. 5d ago First seen · 53 lines · 105 tokens per session scan C 9421043a9c3e

Subscribe to this mod's changes

env-management is a skill published in the GitHub repository aipoch/open-science (3,528 stars, last pushed today), licensed Apache-2.0. It adds 105 tokens to every session and 1,481 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.