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.
npx agentmods add instructions/unjs/std-env/agents-mdgit clone --depth 1 https://github.com/unjs/std-envWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02188 | $0.02188 |
| Opus 5 | $0.01094 | $0.01094 |
| Sonnet 5 | $0.00438 | $0.00438 |
| Haiku 4.5 | $0.00219 | $0.00219 |
Grade A, and why
std-env AGENTS.md 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 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.
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.
How it starts
The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agents
Project Overview
std-env — runtime-agnostic JS utility library for detecting environments, runtimes, CI providers, and AI coding agents. Published as std-env on npm under unjs/std-env.
Maintenance
AGENTS.md— Keep updated with technical details, architecture, and conventions for AI agents working on this projectREADME.md— Keep updated with user-facing documentation (usage, installation, exported APIs, examples)
When adding new features or changing behavior, update both files accordingly.
After finishing any code updates, always run pnpm lint:fix then pnpm test to auto-fix lint/formatting issues and verify everything passes.
- ESM-only (
"type": "module", single.mjsoutput) - Linted with
oxlint+oxfmt, typechecked withtsgo - Tested with
vitest - Built with
obuild
Scripts
| Script | Description |
|---|---|
pnpm run build |
Build with obuild (dist/index.mjs, dist/index.d.mts) |
pnpm run dev |
Start vitest in watch mode |
pnpm run test |
Lint + typecheck + vitest with coverage |
pnpm run lint |
Run oxlint and oxfmt |
pnpm run lint:fix |
Auto-fix lint/format issues |
pnpm run typecheck |
Run tsgo --noEmit |
Source Structure
All source lives in src/, single entry point at src/index.ts which re-exports everything.
| File | Purpose |
|---|---|
src/index.ts |
Barrel re-export of all modules |
src/agents.ts |
AI coding agent detection (detectAgent, agentInfo, agent, isAgent) |
src/providers.ts |
CI/CD provider detection (detectProvider, providerInfo, provider) |
src/runtimes.ts |
JS runtime detection (runtime, runtimeInfo, isNode, isBun, isDeno, etc.) |
src/flags.ts |
Environment flags (isCI, isDebug, isTest, isProduction, isDevelopment, isMinimal, platform, etc.) |
src/env.ts |
Universal env proxy + nodeENV constant |
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.
- yesterday First seen · 147 lines · 2,188 tokens per session scan A 91048081a5a7
std-env AGENTS.md is an instructions file published in the GitHub repository unjs/std-env (641 stars, last pushed 2d ago), licensed MIT. It adds 2,188 tokens to every session, about $0.0109 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-30.
Other instructions, from other repositories
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
core CLAUDE.md
Claude Code instructions for module-federation/core, covering claude task parallelization & development guidelines, core principles, maximum parallelization strategy, universal parallel task patterns and for any codebase task.
Claude-Code-Agent-Monitor CLAUDE.md
Instructions for hoangsonww/Claude-Code-Agent-Monitor, covering claude code working guide, project mission, repo map, non-negotiable engineering rules and commands you should know.
Claude-Code-Agent-Monitor AGENTS.md
Instructions for hoangsonww/Claude-Code-Agent-Monitor, covering codex project instructions, project intent, priorities, where to work and validation expectations.
teamcity-mcp CLAUDE.md
Instructions for Daghis/teamcity-mcp, covering claude code instructions for teamcity-mcp, project overview, development commands, testing and unit tests.
Ruvyxa CLAUDE.md
Instructions for thirawat27/Ruvyxa, covering claude instructions, what this repository is, working here, the checks and the example app.