Lesma AGENTS.md

Lesma AGENTS.md is an instructions file for Codex, OpenCode from alinalihassan/Lesma. It costs 3,672 tokens per session, scanned A, original, MIT.

Project instructions for Lesma, a statically typed programming language and compiler written in C++ that produces machine code through LLVM. It covers the compiler, standard library, language server, and project layout.

In plain words
What is it for?
Use it when changing Lesma's parser, type system, compiler back end, standard library, command-line tool, language server, or benchmarks.
Why use it?
It explains how the compiler is structured and how to build and validate changes without guessing where code belongs.

Instructions file for CodexOpenCode

Install

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.

agentmods
npx agentmods add instructions/alinalihassan/lesma/agents-md
Clone the repo
git clone --depth 1 https://github.com/alinalihassan/Lesma

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/alinalihassan/lesma/agents-md.svg)](https://agentmods.dev/instructions/alinalihassan/lesma/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/alinalihassan/lesma/agents-md"><img src="https://agentmods.dev/badge/instructions/alinalihassan/lesma/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,672 This file is loaded in full into every session.
When invoked 3,672 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.03672 $0.03672
Opus 5 $0.01836 $0.01836
Sonnet 5 $0.00734 $0.00734
Haiku 4.5 $0.00367 $0.00367

Measured 4d ago against content hash bca47fcf9011, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Lesma 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 4d 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 · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — Lesma project guide for AI agents

This file gives future agents (and humans) a quick reference for how the Lesma compiler works, how to build it, and how to validate changes.


What Lesma is

Lesma is a compiled, statically typed, imperative, object-oriented language that targets LLVM. The compiler is C++23 and uses LLVM for code generation, optimization, JIT, and object-file emission. The standard library is written in Lesma (.les files in src/stdlib/).


Project layout

  • src/ — Compiler and stdlib
    • src/cli/main.cpp — CLI entry point (when LESMA_BUILD_CLI is on).
    • src/liblesma/ — Core library:
      • Common/ — Utils, logging, errors (LesmaError, CodegenError in Backend/CodegenError.h).
      • Frontend/ — Lexer, Parser (tokens → AST).
      • AST/ — AST node definitions and visitor interface.
      • Token/ — Token types and Token class.
      • Symbol/ — Symbol table, Type, Value, TypeUtils.
      • Backend/ — Codegen (AST → LLVM IR), MangleUtils, CodegenTypeUtils, linking/JIT.
    • src/stdlib/ — Lesma standard library (e.g. base.les, math.les, time.les).
    • src/lsp/lesma-lsp (when LESMA_BUILD_LSP is ON). Advertises UTF-8 position encoding (PositionEncodingKind::UTF8); clients must send Position.character as UTF-8 code units (bytes) from the line start. Enables vcpkg feature lsp (libgit2, minimal: pcre2 only, no HTTPS/SSH) for workspace-wide .les discovery in Git work trees without shelling out to git.
  • tests/lesma/success/ — Programs that must compile and run (exit 0).
  • tests/lesma/failure/ — Programs that must be rejected (expected to fail).
  • scripts/run_tests.sh — Runs the compiler on all success/failure cases (run + compile for each).
  • benchmark/ — Google Benchmark targets plus the benchmark suite integration harness (benchmark/SuiteWallClock.cpp).

Wall-clock benchmark (benchmark suite)

Read the full file on GitHub · 174 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. 4d ago First seen · 174 lines · 3,672 tokens per session scan A bca47fcf9011

Subscribe to this mod's changes

Lesma AGENTS.md is an instructions file published in the GitHub repository alinalihassan/Lesma (21 stars, last pushed 4mo ago), licensed MIT. It adds 3,672 tokens to every session, about $0.0184 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.