Claude Code & Codex plugin

lean-and-mean

Short answers, minimal code, and an AGENTS.md that remembers every correction. Shorter sessions, less code nobody asked for, no repeat mistakes.

The problem

Coding assistants say and build too much: padded answers, plus helpers, options and abstractions nobody asked for, all of which must be read, reviewed and maintained. And they forget: every session starts blank, so yesterday's corrected mistake can happen again today.

lean-and-mean fixes both by writing a short set of instructions into root AGENTS.md. Codex loads it directly; Claude Code loads it through a one-line CLAUDE.md containing @AGENTS.md. The instructions are then present every session with no plugin code running.

What it does

Minimal code

A YAGNI ladder picks the smallest change that works. New code comes last.

Rules that stick

Every correction becomes one dated line under ## Rules. The file loads every session, so the mistake doesn't repeat.

Clean handoffs

/endsession records Rules, the next task and the Todo list, commits and pushes, then stops. The next session starts small and on the right task.

Short answers

The answer comes first. Full sentences for explanations, short lines for status. No filler, no hedging. Short sentences in active voice, about 80% of the ASD-STE100 controlled language. A diagram or an HTML page when that explains it better.

The YAGNI ladder

Before writing code, the assistant stops at the first step that works:

  1. Only maybe needed later? Skip it and say so.
  2. Already in the project? Reuse it.
  3. In the standard library? Use it.
  4. Native to the platform (browser, OS, framework)? Use it.
  5. An installed dependency does it? Use it.
  6. Fits in one line? One line.
  7. Otherwise, the smallest new code that works.

Minimal never means careless. It never cuts input validation at trust boundaries, error handling that prevents data loss, security, accessibility, or anything you asked for. Also:

An AGENTS.md that maintains itself

Commands

CommandEffect
/lean-and-meanCreate or clean up AGENTS.md: refresh the instructions, reorder sections, verify commands and paths, prune stale lines. Safe to rerun; usually runs on its own.
/lean-and-mean debtList every // lean: shortcut and its upgrade path. Changes nothing.
/endsessionSave Rules, Next and Todo, commit and push, then stop. When the work meets the project's ## Done, it also merges, prunes merged branches and deploys as that section says; when it doesn't, Next says what remains. Ending at natural break points keeps sessions cheap and focused. Details.

Claude Code plugin installs spell them /lean-and-mean:lean-and-mean and /lean-and-mean:endsession; Codex uses $lean-and-mean and $endsession.

What happens automatically

A session-start hook stays silent unless:

The session band mod

Claude Code only. The plugin ships a mod: a small function-hooks module (hooks/register.tsx) that Claude Code loads with the plugin and runs inside the session. It draws a row above the prompt:

tasks 2/3   [ hide tasks ]  [ end session ]
  ✓ Fix the login redirect
  ✓ Add a test for it
  ☐ Update the changelog

How the mod works, including the optional status line with a cache countdown.

Extras

Each extra is covered in full in the guide.

Why it pays off

4×cost per request over 400K context versus under 100K ($0.33 vs $0.08): restart at task boundaries
$1.21 vs $0.27median cost to resume after an hour away versus starting fresh; the worst resume measured, at 455K, was $8.79
$0.27median /endsession: a deliberate handoff instead of lossy compaction

Measured from 63 sessions and 5,197 requests (2026-09-03 to 2026-10-03) at API list prices, mostly on Opus 5, whose cache reads cost $0.50; on Opus 5.5 at $0.20 the absolute figures are lower. Every tool call resends the whole context, so cost scales with requests × context size. See why sessions should be short for the full model.

Install

Claude Code

claude plugin marketplace add spinlockdevelopment/lean-and-mean
claude plugin install lean-and-mean@lean-and-mean

Restart Claude Code and run /lean-and-mean:lean-and-mean once in each project to write AGENTS.md and the CLAUDE.md stub. Until then the hook loads the instructions each session and reminds you.

Codex

codex plugin marketplace add spinlockdevelopment/lean-and-mean
codex plugin add lean-and-mean@lean-and-mean

Start a new session at the project root, trust the SessionStart hook when prompted, and run $lean-and-mean once.

No plugin support, or want bare command names? See manual install.

Turning it off

Disable the plugin and delete the ## Operating Mode section from AGENTS.md. The instructions live in the file, so disabling alone isn't enough.

Raw instructions

The plugin is plain text the model follows:

Also bundles typesafe-ai, TypeSafe AI's skill for the Jev model, routed through OpenRouter. Copyright and credit: TypeSafe AI (MIT). lean-and-mean is MIT licensed.