lang_ex: Instructions file for Codex

AGENTS.md

lang_ex AGENTS.md is an instructions file for Codex, OpenCode from freshaengineering/lang_ex. It costs 3,305 tokens per session, scanned A, original, MIT.

Repository instructions for LangEx, an Elixir framework for building multi-step AI workflows with state, routing, checkpoints, and human approval.

In plain words
What is it for?
Use them when developing, testing, formatting, or reviewing LangEx workflow code and its Redis or PostgreSQL integrations.
Why use it?
They explain the project's architecture, required checks, dependencies, and test commands so changes follow its conventions.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions subagents.

This is freshaengineering/lang_ex's own configuration. It tells Codex and OpenCode how to work on lang_ex itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything lang_ex configures →

Reuse

Borrowing it

Nothing to install: this file belongs to freshaengineering/lang_ex. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/freshaengineering/lang_ex/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/freshaengineering/lang_ex

Made for: Codex, OpenCode.

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 lang_ex AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/freshaengineering/lang_ex/agents-md/github.svg)](https://agentmods.dev/instructions/freshaengineering/lang_ex/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/freshaengineering/lang_ex/agents-md"><img src="https://agentmods.dev/badge/instructions/freshaengineering/lang_ex/agents-md/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.

agentmods 80×15 button for lang_ex AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/freshaengineering/lang_ex/agents-md"><img src="https://agentmods.dev/badge/instructions/freshaengineering/lang_ex/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,305 This file is loaded in full into every session.
When invoked 3,305 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.03305 $0.03305
Opus 5.5 $0.01322 $0.01322
Sonnet 5.5 $0.00661 $0.00661
Haiku 4.5 $0.00331 $0.00331

Measured 2mo ago against content hash 5fb94eb02032, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

AGENTS.md · 240 lines

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; optional redix, postgrex, ecto_sql, opentelemetry_api, opentelemetry_telemetry
  • Test: ExUnit with mimic for 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)

Read the full file on GitHub · 240 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. 2mo ago First seen · 240 lines · 3,305 tokens per session scan A 5fb94eb02032

Subscribe to this mod's changes

lang_ex AGENTS.md is an instructions file published in the GitHub repository freshaengineering/lang_ex (45 stars, last pushed 1mo ago), licensed MIT. It adds 3,305 tokens to every session, about $0.0132 per session on Opus 5.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.

Related

lang_ex AGENTS.md compared with instructions from other repositories

lang_ex AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lang_ex AGENTS.mdfreshaengineering/lang_exInstructions file451mo agoMITA3,305Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode