Skip to main content
The --llm flag tries to contribute to solve context optimization problem for AI agents. Instead of manually writing hundreds of lines describing available tools, agents just run dx --llm and automatically discover what they can do in any project.

Context Optimization Problem

Before dx —llm: Manual context files that get outdated
With dx —llm: Dynamic, always-current context
Result: Agent always knows current project capabilities without manual context management.

Context & Cost Optimization

The dx —llm

Dynamic context discovery in minimal tokens:

Agent starts each task with 2 commands:

After dx —llm:

Auto-Updated Context

Agent-Friendly Design

No TUI Required

Commands run directly in shell, perfect for automated environments

Exit Code Aware

Proper exit codes enable AI agents to detect success/failure

Stdio Inheritance

Commands inherit stdin/stdout for seamless pipeline integration

Recording Built-in

AI can record sessions for debugging and analysis

AI Safety & Verification

Command Safety Check

AI analyzes:
  • Destructive patterns - rm -rf, dd, format, etc.
  • Network operations - External API calls, data uploads
  • File system risks - Writing to system directories
  • Permission escalation - sudo, su, privilege requests
  • Resource consumption - Infinite loops, fork bombs
Output examples:

Safety Configuration

AI safety is improving rapidly but not perfect. Always review AI recommendations, especially for:
  • Production deployments
  • Data deletion operations
  • System configuration changes
  • External API calls with side effects
Use AI verification as a first line of defense, not the only one.
AI agents work best when dx aliases are semantically meaningful (build, test, deploy) rather than cryptic (cmd1, run-x).