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.svg" alt="Measured on agentmods" 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 | $0.00033 | $0.01012 |
| Sonnet 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 8d 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.
- 8d 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 (4 stars, last pushed 6mo ago), licensed MIT. It adds 66 tokens to every session and 2,025 once invoked, about $0.0003 per session on Opus 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.
Other skills, from other repositories
implementation-loop
Disciplined plan-build-verify loop for implementing a feature or change. Use when building something new or modifying existing behavior, especially across multiple files.
debugging-loop
Systematic reproduce-isolate-fix-verify loop for bugs, test failures, and unexpected behavior. Use when something is broken and the cause is not yet known.
tw-component
Generate a UI component using correct Tailwind CSS v4 utility classes, CSS variable theming, and accessibility best practices. Prevents v3 syntax hallucination by grounding output in verified v4 patterns.
tw-migrate
Analyze a Tailwind CSS v3 project and generate a complete migration plan to v4. Scans config, CSS, and template files for v3 patterns and produces a prioritized checklist with exact find-and-replace commands.
tw-validate
Scan a Tailwind CSS project for v3/v4 version mixing, deprecated patterns, and common mistakes. Reports issues with exact file locations and suggested fixes.
android-feature
Workflow for implementing a new Android feature, screen, fragment, activity, dialog, adapter, or enhancement in this XML/MVVM template. Use whenever the user asks to add, build, implement, or extend functionality — before writing any code. Covers planning, the MVVM/MVI skeleton, the Android configuration checklist…