python-environment-manager

An automated tool for creating and managing Python environments used by ras-commander, a library for automating HEC-RAS water-flow models. It also helps Jupyter notebooks load the local source code during development.

In plain words
What is it for?
Creating and checking Conda environments, configuring Jupyter kernels, troubleshooting imports, and upgrading ras-commander. It also supports running example notebooks and testing changes from a local repository.
Why use it?
It removes guesswork when creating environments, fixing import errors, upgrading the library, or choosing between installed and local code. It keeps user environments separate from source-code development environments.

Agent for Claude Code

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 agents/gpt-cmdr/ras-commander/python-environment-manager
Clone the repo
git clone --depth 1 https://github.com/gpt-cmdr/ras-commander

Made for: Claude Code.

Per session 130 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,868 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.00130 $0.03868
Opus 5 $0.00065 $0.01934
Sonnet 5 $0.00026 $0.00774
Haiku 4.5 $0.00013 $0.00387

Measured yesterday against content hash 9a950886659b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

python-environment-manager 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 yesterday.

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.

| uv | Windows: `irm https://astral.sh/uv/install.ps1 \| iex`<br>Mac/Linux: `curl -LsSf https://astral.sh/uv/install.sh \| sh` |

Makes network callslowCapability

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

| uv | Windows: `irm https://astral.sh/uv/install.ps1 \| iex`<br>Mac/Linux: `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
.claude/agents/python-environment-manager.md · 510 lines

How it starts

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

Python Environment Manager

Set up and manage ras-commander Python environments. Handle environment creation, validation, troubleshooting, and upgrades.

Key Decision: No Editable Install for Development

CRITICAL: The rascmdr_local environment does NOT use pip install -e .

Instead, use a toggle cell in Jupyter notebooks that manipulates sys.path to load local source code. This approach:

  • Guarantees local source is always loaded (even if pip package exists)
  • Remains simple to understand and explain
  • Works reliably across all environments
  • Can be toggled with a single variable

Why sys.path.insert(0, ...) Works

Python searches sys.path in order (index 0 first). By inserting the local repo path at position 0:

  1. Python finds ras_commander/ in the repo first
  2. The pip-installed package (if any) is never reached
  3. 100% guaranteed local source loading

Standard Environment Names

RasCommander (User Environment)

Purpose: Standard user environment with pip package

When to use:

  • Running example notebooks as an end user
  • Using ras-commander for HEC-RAS automation
  • NOT editing ras-commander source code

Setup:

conda create -n RasCommander python=3.13
conda activate RasCommander
pip install ras-commander
pip install jupyter ipykernel
python -m ipykernel install --user --name RasCommander --display-name "Python (RasCommander)"

rascmdr_local (Development Environment)

Purpose: Development environment with dependencies only (NO ras-commander pip install)

When to use:

  • Editing ras-commander source code
  • Contributing to the library
  • Testing code changes immediately

Setup:

conda create -n rascmdr_local python=3.13
conda activate rascmdr_local

# Install DEPENDENCIES ONLY - NOT ras-commander itself
pip install h5py numpy pandas geopandas matplotlib shapely scipy xarray tqdm requests rasterstats rtree pyproj fiona

# Install Jupyter
pip install jupyter ipykernel
python -m ipykernel install --user --name rascmdr_local --display-name "Python (rascmdr_local)"

Read the full file on GitHub · 510 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. yesterday First seen · 510 lines · 130 tokens per session scan C 9a950886659b

Subscribe to this mod's changes

python-environment-manager is an agent published in the GitHub repository gpt-cmdr/ras-commander (78 stars, last pushed yesterday), licensed MIT. It adds 130 tokens to every session and 3,868 once invoked, about $0.0006 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.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens