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 skills add cdbattags/ai --skill direnv-shell-commandsgit clone --depth 1 https://github.com/cdbattags/aiWrote 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.
[](https://agentmods.dev/skills/cdbattags/ai/direnv-shell-commands)<a href="https://agentmods.dev/skills/cdbattags/ai/direnv-shell-commands"><img src="https://agentmods.dev/badge/skills/cdbattags/ai/direnv-shell-commands/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.
<a href="https://agentmods.dev/skills/cdbattags/ai/direnv-shell-commands"><img src="https://agentmods.dev/badge/skills/cdbattags/ai/direnv-shell-commands.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00066 | $0.02025 |
| Opus 5.5 | $0.00026 | $0.00810 |
| Sonnet 5.5 | $0.00013 | $0.00405 |
| Haiku 4.5 | $0.00007 | $0.00202 |
Grade B, and why
direnv-shell-commands scanned grade B with 1 finding 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 3mo 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
- `chmod 600` because the file contains `.env` secrets How it starts
The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Running Shell Commands with direnv + Nix Flake
This project uses direnv + flake.nix for a reproducible dev environment.
The Nix daemon is sourced in ~/.zshenv so nix and direnv are always on
PATH — even in non-interactive shells like Cursor's Shell tool.
Bootstrap Pattern (cascading, fastest first)
Cursor's Shell tool runs non-interactive zsh. The direnv hook zsh from
.zshrc does NOT fire, so load the environment explicitly:
[[ -n "$IN_NIX_SHELL" ]] || { source .direnv/cursor-env.zsh 2>/dev/null || eval "$(DIRENV_LOG_FORMAT= direnv export zsh)"; }
This cascade tries three paths in order:
- Already loaded (
$IN_NIX_SHELLset from a previous call) — skip (~0ms) - Cached env file (
.direnv/cursor-env.zshexists and fresh) — source (~0ms) - Live direnv export (cache missing or stale) — full evaluation (~1-4s)
Run from the workspace root (where .envrc lives). The Shell tool is
stateful — subsequent calls in the same session inherit the environment.
First command in a session (bootstrap + run)
[[ -n "$IN_NIX_SHELL" ]] || { source .direnv/cursor-env.zsh 2>/dev/null || eval "$(DIRENV_LOG_FORMAT= direnv export zsh)"; } && pnpm dev
With working_directory set to the workspace root.
Subsequent commands (environment persists)
cd modules/web-app && pnpm db:seed
Quick Reference
| Pattern | Command |
|---|---|
| Bootstrap + run | [[ -n "$IN_NIX_SHELL" ]] || { source .direnv/cursor-env.zsh 2>/dev/null || eval "$(DIRENV_LOG_FORMAT= direnv export zsh)"; } && <your command> |
| Generate cache (full) | ~/.cursor/skills/direnv-shell-commands/generate-cursor-env.sh |
| Generate cache (minimal) | ~/.cursor/skills/direnv-shell-commands/generate-cursor-env.sh --minimal |
| Force live export | eval "$(DIRENV_LOG_FORMAT= direnv export zsh)" |
Three Bootstrap Tiers
Tier 1: nix-direnv (global, already active)
nix-direnv is installed to ~/.nix-profile and sourced in
~/.config/direnv/direnvrc. It overrides direnv's built-in use flake
with a faster implementation that:
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3mo ago First seen · 180 lines · 66 tokens per session scan B 20769b944008
direnv-shell-commands is a skill published in the GitHub repository cdbattags/ai (5 stars, last pushed 9mo ago), licensed MIT. It adds 66 tokens to every session and 2,025 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
direnv-shell-commands compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| direnv-shell-commandscdbattags/ai | Skill | 5 | 9mo ago | MIT | B | 66 | Claude Code, Codex |
| sonic-setup-new-projectorbitalsonic/AndroidPilot | Skill | 1 | 1mo ago | none | A | 0 | Claude Code |
| sonicg-setup-new-projectorbitalsonic/AndroidPilot | Skill | 1 | 1mo ago | none | A | 0 | Claude Code, Codex |
| sonicc-setup-new-projectorbitalsonic/AndroidPilot | Skill | 1 | 1mo ago | none | A | 0 | Cursor |
| sonic-setup-old-projectorbitalsonic/AndroidPilot | Skill | 1 | 1mo ago | none | A | 0 | Claude Code |
| sonicc-setup-old-projectorbitalsonic/AndroidPilot | Skill | 1 | 1mo ago | none | A | 0 | Cursor |
| sonic-localizeorbitalsonic/AndroidPilot | Skill | 1 | 1mo ago | none | A | 0 | Claude Code |