env-hygiene

env-hygiene is a skill for Claude Code from lukasrepublic/agentic-foundry. It costs 115 tokens per session (2,048 once invoked), scanned A, original, MIT.

A development-environment cleanup guide for temporary resources such as containers, local Kubernetes clusters, and development servers. It tracks which resources belong to the current session.

In plain words
What is it for?
Use it to check running resources, reuse suitable ones, label new ones, and tear down resources you started.
Why use it?
It helps prevent unused test resources from piling up and avoids stopping resources shared by other work.

Skill for Claude Code

Written for Claude Code: $CLAUDE_SESSION_ID variable.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the foundry plugin — 81 skills, 8 agents, 8 hooks, 1 MCP server shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add lukasrepublic/agentic-foundry
Claude Code
/plugin install foundry

Made for: Claude Code.

Or install foundry, the plugin that ships this one along with the rest of its 81 skills, 8 agents, 8 hooks, 1 MCP server.

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-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/env-hygiene.svg)](https://agentmods.dev/skills/lukasrepublic/agentic-foundry/env-hygiene)
Your own site
<a href="https://agentmods.dev/skills/lukasrepublic/agentic-foundry/env-hygiene"><img src="https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/env-hygiene.svg" alt="Measured on agentmods" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,048 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.1 $0.00115 $0.02048
Opus 5 $0.00057 $0.01024
Sonnet 5 $0.00023 $0.00410
Haiku 4.5 $0.00012 $0.00205

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

Security

Grade A, and why

env-hygiene 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.

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/env-hygiene/SKILL.md · 116 lines

How it starts

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

/foundry:env-hygiene

The environment-isolation-hygiene lifecycle. Agents that spin up ephemeral dev/test RESOURCES must bring them DOWN when the work is done — no stacking, no leaks. The enforcement for the forgetful agent is automatic (a SessionEnd reaper); this skill is the on-demand status + teardown surface plus the discipline.

The directive (own what you start)

  • Reuse before start. Check whether a suitable resource is already running before firing up a new one (reference-counting spirit) — don't stack a second Colima/kind/dev-server.
  • LABEL what you start with the session id. Stamp ownership at create-time so the reaper can identify your resources (and only yours):
    • containers: docker run --label foundry.session=$CLAUDE_SESSION_ID …
    • clusters: name it foundry-$CLAUDE_SESSION_ID (kind create cluster --name foundry-$CLAUDE_SESSION_ID)
    • dev servers: record the pid with its command + start-time under .foundry/env-hygiene/<name>.json so the pid-recycling guard has a signature to verify.
  • Pair setup with teardown. Every fire-up has a matching bring-down at end of work.
  • Never stop the shared runtime. The container-runtime daemon/host (Colima/Docker/Podman) is shared singleton infrastructure — leave it running; status surfaces it, the operator stops it manually if they wish. Tunnels/VPN are status-only too.
  • Leave no orphans. What you started, you bring down (own-scoped).

Actions

action what it does
status Lists this session's owned resources (reaped on SessionEnd); the shared runtime daemon shown running but NEVER auto-brought-down; and any foundry-labelled orphan from a prior/non-current session as a manual-clear candidate.
teardown On-demand own-scoped reap — brings down THIS session's owned resources now (same decision core the SessionEnd hook uses).
python3 "${CLAUDE_PLUGIN_ROOT}"/scripts/foundry-env-hygiene.py status
python3 "${CLAUDE_PLUGIN_ROOT}"/scripts/foundry-env-hygiene.py reap    # on-demand teardown

Read the full file on GitHub · 116 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. 6d ago First seen · 116 lines · 115 tokens per session scan A 7f30026c04b1

Subscribe to this mod's changes

env-hygiene is a skill published in the GitHub repository lukasrepublic/agentic-foundry (1 stars, last pushed yesterday), licensed MIT. It adds 115 tokens to every session and 2,048 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-08-31.

Related

Other skills, from other repositories