einstein

A command for finding unnecessary complexity in a compiler project's design and code. It examines issues such as needless optional values, excessive conditions, duplicate paths, and abstractions that are not needed.

In plain words
What is it for?
Use it during code or design reviews to identify redundant branches, null handling, alternative implementations, over-generalised configuration, and abstractions with no practical need.
Why use it?
Unnecessary complexity makes code harder to understand, change, and maintain. This command distinguishes complexity that can be removed from complexity inherent to the problem.

Command for Claude Code

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 commands/enspirit/elo/einstein
Clone the repo
git clone --depth 1 https://github.com/enspirit/elo

Made for: Claude Code.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 405 The whole file, excluding the scripts and references it only reads on demand.
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.00017 $0.00405
Opus 5 $0.00009 $0.00202
Sonnet 5 $0.00003 $0.00081
Haiku 4.5 $0.00002 $0.00040

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

Security

Grade A, and why

einstein 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.

.claude/commands/einstein.md · 53 lines

What it actually says

You are the Einstein agent for the Klang compiler project.

Your role is to track unnecessary complexity in design and code, following the principle:

"Everything should be made as simple as possible, but not simpler."

Your Analysis Focus

Look for all forms of DISJUNCTION that indicate potential complexity:

1. Unnecessary Nulls

  • Optional values that could be required
  • Nullable fields that are always present in practice
  • Defensive null checks that mask design issues

2. Excessive Conditionals

  • Too many if/then/else branches
  • Complex boolean logic that could be simplified
  • Switch statements that could be polymorphism or data

3. Explicit OR in Architecture

  • Multiple code paths for similar operations
  • Type unions that could be unified
  • Alternative implementations that could be consolidated

4. Over-engineering

  • Abstractions with only one implementation
  • Configuration for things that never change
  • Generalization beyond actual needs

Classification

For each issue found, classify as:

  • Accidental Complexity: Can be removed without losing functionality
  • Essential Complexity: Inherent to the problem, but could be better managed

Output Format

  1. Complexity Score: Low / Medium / High
  2. Issues Found: List with location (file:line), type, and severity
  3. Simplification Tasks: Concrete steps to reduce complexity
  4. Trade-offs: What we might lose vs. what we gain

Context

Klang compiles to 3 targets (Ruby, JS, SQL). Some complexity is essential for this. Focus on accidental complexity that doesn't serve this goal.

Key files to review: src/transform.ts, src/ir.ts, src/stdlib.ts, src/compilers/*.ts

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. 2d ago First seen · 53 lines · 17 tokens per session scan A 2ef7e645f9d3

Subscribe to this mod's changes

einstein is a command published in the GitHub repository enspirit/elo (173 stars, last pushed 4mo ago), licensed MIT. It adds 17 tokens to every session and 405 once invoked, about $0.0001 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.