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/freshaengineering/lang_ex/agents-mdgit clone --depth 1 https://github.com/freshaengineering/lang_exWhat 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.03305 | $0.03305 |
| Opus 5 | $0.01653 | $0.01653 |
| Sonnet 5 | $0.00661 | $0.00661 |
| Haiku 4.5 | $0.00331 | $0.00331 |
Grade A, and why
lang_ex 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LangEx
Graph-based agent orchestration for Elixir. Builds stateful, multi-step LLM workflows using nodes, edges, conditional routing, state reducers, human-in-the-loop interrupts, and checkpointing. Inspired by LangGraph, built on BEAM primitives.
- Version: 0.11.0, Elixir: ~> 1.16
- Deps:
req,jason,telemetry; optionalredix,postgrex,ecto_sql,opentelemetry_api,opentelemetry_telemetry - Test: ExUnit with
mimicfor mocking
Commands
mix deps.get # Install dependencies
mix compile --warnings-as-errors # Compile (0 warnings required)
mix test # Run all tests (integration excluded)
mix test --include integration # Also run Redis/Postgres tests (needs docker compose up)
mix test path/to/test.exs:42 # Run specific test
mix format # Auto-format
mix format --check-formatted # Check formatting
Integration tests read LANG_EX_REDIS_URL / LANG_EX_POSTGRES_URL
(defaults match docker-compose.yml).
Always run mix compile --warnings-as-errors before considering work done. Zero warnings required.
Architecture
LangEx (facade: invoke/3, stream/3, get_state/2, get_state_history/2, update_state/3, delete_thread/2)
├── Graph # Builder: new, add_node (+retry/cache/defer/timeout/on_error), add_edge, compile, to_mermaid
│ ├── Graph.Compiled # Compiled executable graph
│ ├── Graph.Pregel # Super-step execution engine (internal)
│ ├── Graph.RetryPolicy # Exponential backoff + jitter for retry: nodes
│ ├── Graph.State # State management with reducers
│ ├── Graph.NodeCache # Bounded ETS memoization for cache: nodes
│ └── Graph.Stream # Lazy event streaming with modes + emit/1
├── NodeError / NodeTimeoutError # Structured node failure contract ({:error, %NodeError{}})
├── LLM # Behaviour for provider adapters
│ ├── LLM.Anthropic # Claude adapter (streaming SSE)
│ │ ├── Anthropic.SSE # SSE state machine (internal)
│ │ └── Anthropic.Formatter # Message wire format (internal)
│ ├── LLM.OpenAI # GPT adapter
│ ├── LLM.Gemini # Gemini adapter
│ ├── LLM.Resilient # Retry wrapper with backoff
│ ├── LLM.ChatModel # Graph node helper for LLM calls
│ └── LLM.Registry # Provider resolution by model string
├── Tool # Tool/function definition struct
│ ├── Tool.Node # Graph node for parallel tool execution
│ └── Tool.Annotation # Error recovery guidance for LLM
├── Message # Chat message types (Human, AI, System, Tool, RemoveMessage)
├── Middleware # Composable agent hooks for Prebuilt.agent
│ ├── Middleware.ModelRequest # The model call as data, with override/2
│ ├── Middleware.Summarization # LLM-summarised, persisted context compaction
│ ├── Middleware.ContextEditing # Clears stale tool-result contents (no LLM)
│ ├── Middleware.TodoList # write_todos planning tool + :todos state
│ ├── Middleware.ToolSelector # LLM tool pre-selection for large tool sets
│ ├── Middleware.ToolApproval # Human review of guarded tool calls (HITL)
│ ├── Middleware.ToolRetry # Retries transient tool failures in place
│ ├── Middleware.CallBudget # Caps model calls / tokens per run
│ ├── Middleware.ModelFallback # Retries a failed call on fallback models
│ ├── Middleware.Subagent # Delegation to nested agents as tools
│ ├── Middleware.Filesystem # Sandboxed file tools
│ └── Middleware.Rubric # Completion gate scoring the final answer
├── Checkpoint / Checkpointer # Pause/resume with Memory, Redis, or Postgres
├── Store # Long-term memory (ETS / Postgres backends)
├── Migration # Versioned Postgres migrations (V1, V2)
├── Prebuilt # Ready-made agent graph constructor
├── Command / Send / Interrupt # Graph control flow primitives
├── Config # Layered config resolution
├── ContextCompaction # Context window budget enforcement
└── Telemetry # Telemetry event definitions (+ Runs, OTel bridge)
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.
- 2d ago First seen · 240 lines · 3,305 tokens per session scan A 5fb94eb02032
lang_ex AGENTS.md is an instructions file published in the GitHub repository freshaengineering/lang_ex (40 stars, last pushed 5d ago), licensed MIT. It adds 3,305 tokens to every session, about $0.0165 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
adk-go AGENTS.md
AGENTS.md instructions for google/adk-go, covering agents.md, project overview, skills, setup & core commands and definition of done.
cli CLAUDE.md
Claude Code instructions for entireio/cli, covering entire - cli, architecture, key directories, commands (cmd/) and command layout.
cli copilot-instructions.md
Copilot instructions for entireio/cli, covering copilot instructions for entire cli, repository overview, build & validation commands, critical code patterns and error handling.
adk-go CLAUDE.md
Claude Code instructions for google/adk-go: See AGENTS.md for project context, commands, and contribution guidelines for AI coding agents.
agent-starter-pack GEMINI.md
Instructions for GoogleCloudPlatform/agent-starter-pack, covering agent starter pack - ai coding agent guide, core principles for ai agents, project architecture overview, 4-layer template system and key directory structure.
codedb AGENTS.md
AGENTS.md instructions for justrach/codedb, covering codedb agent guidelines, what codedb is (and isn't), review guidelines, pre-merge verification and security-sensitive areas.