mlld language plugin for Claude Code
npx claudepluginhub mlld-lang/mlldmlld patterns for LLM agents and orchestrators
A scripting language for secure LLM orchestration. Compose prompts from files, commands, and modules. Chain LLM calls with pipelines. Label sensitive data and define guards to control where it flows.
npm install -g mlld
mlld quickstart # give this to your llm
mlld skill install # install skills for coding agents
VSCode Extension | Documentation
var @commits = run cmd {git log --since="yesterday" --oneline}
var @prs = run cmd {gh pr list --json title,url}
exe @claude(prompt) = run cmd {claude -p "@prompt"}
var @summary = @claude(`
Summarize my work from yesterday:
Commits: @commits
PRs: @prs
`)
show @summary
var @name = "Alice" # Variables
var @config = <config.json> # Load files with angle brackets
var @output = run cmd {echo "hello"} # Capture command output
show `Hello @name!` # Output with interpolation
log `Debug: @config.version` # Log to stderr
exe @greet(name) = `Hello @name!` # Define reusable functions
exe @process(data) = js { return data.map(x => x * 2) }
exe @fetch(url) = run cmd {curl -s "@url"}
import { @helper, @util } from @alice/tools
import { @config } from "./local-file.mld"
import @company/prompts as @prompts
# Import types control caching behavior
import module { @api } from @corp/sdk # Offline after install
import static { @template } from "./prompt.md" # Embedded at parse time
import live <https://api.io/status> as @status # Fresh every execution
import cached(1h) <https://feed.xml> as @feed # Cached with TTL
# Imperative branching
if @isProd [
show "Production mode"
] else [
show "Local mode"
]
# Pattern matching (first match wins)
exe @grade(score) = when [
@score >= 90 => "A"
@score >= 80 => "B"
* => "C"
]
show `Grade: @grade(91)` # A
# Simple condition
when @verbose => log "Verbose mode"
# Retry until valid
exe @validate(input) = when [
@input.valid => @input
@mx.try < 3 => retry "needs more detail"
* => "fallback"
]
# Switch-style
when [
@role == "admin" => show "Admin panel"
@role == "user" => show "Dashboard"
* => show "Login required"
]
var @files = ["a.md", "b.md", "c.md"]
# Execute for each
for @file in @files => show `Processing @file`
# Collect results
var @sizes = for @file in @files => run cmd {wc -c @file}
# Parallel execution
exe @review(file) = run cmd {claude -p "Review @file"}
var @sources = <src/**/*.ts>
for parallel @f in @sources => @review(@f)
# Transform with foreach
exe @upper(s) = js { return s.toUpperCase() }
var @caps = foreach @upper(@files)
# Loop with done/continue control
var @result = loop(10) [
let @count = (@input ?? 0) + 1
when @count >= 3 => done @count
continue @count
]
# Loop with until clause and pacing
loop(endless, 10ms) until @input >= 3 [
let @next = (@input ?? 0) + 1
continue @next
]
# While pipeline
var @countdown = @start | while(100) @decrement
var @result = run cmd {cat data.json} | @parse | @transform | @validate
# Built-in transformers
var @parsed = @input | @parse # Parse JSON (loose by default)
var @strict = @input | @parse.strict # Strict JSON only
var @extracted = @llmOutput | @parse.llm # Extract JSON from LLM response
# Parallel stages
var @results = || @fetchA() || @fetchB() || @fetchC()
var @readme = <README.md> # Load file contents
var @config = <config.json> # JSON auto-parsed
var @docs = <docs/*.md> # Glob patterns
var @optional = <missing.md>? # Null if missing
# Field access
var @version = <package.json>.version
var @title = <post.md>.mx.fm.title # Frontmatter access
# AST selectors (extract code definitions)
var @func = <src/api.ts { createUser }> # Specific function
var @handlers = <src/*.ts { handle* }> # Wildcard pattern
var @allFuncs = <src/util.ts { *fn }> # All functions
var @names = <src/api.ts { ?? }> # List all definition names
var @list = ["apple", "banana", "cherry"]
var @text = "Hello World"