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 too much and build too much. Padded answers and unrequested helpers all need reading, review and upkeep. Every session also starts blank, so a mistake you fixed yesterday can come back today.

lean-and-mean writes a short instruction block into the project's root AGENTS.md. Codex loads that file directly. Claude Code loads it through a one-line CLAUDE.md that holds only @AGENTS.md. The block is then active every session, with no plugin code running.

How a session runs

One session with lean-and-mean The session starts and the host loads AGENTS.md. The hook checks that AGENTS.md has the current block, is under 250 lines, has no review flag, and that CLAUDE.md is the stub. If any check fails, the assistant tidies AGENTS.md, reloads it, then does your task. You work, and each correction becomes one Rule line. /endsession writes Rules and Next. It commits, pushes, and ships per the Done section when the work is complete. The session stops, and the next session starts from Next. Session starts host loads AGENTS.md Hook checks AGENTS.md current? You work correction → 1 Rule /endsession Rules, Next Commit, push ship per ## Done Session stops Next is saved no → tidy, reload, then your task next session starts on ## Next
One session. The loop closes through AGENTS.md: /endsession writes it, and the next session loads it.

What it does

Minimal code

YAGNI: the smallest change that works. New code comes last. The ladder.

Rules that stick

Every correction becomes one dated line under ## Rules. The file loads every session, so the mistake does not repeat. How AGENTS.md is kept.

Clean handoffs

/endsession saves Rules, the next task and the backlog. Then it commits, pushes and stops.

Short answers

The answer comes first, with no filler. Sentences are concise and active, broadly following ASD-STE100. A diagram or a page when that explains better.

Commands

CommandEffect
/lean-and-mean:lean-and-meanCreate or review AGENTS.md. It refreshes the block, reorders sections, checks commands and paths, and prunes stale lines. Safe to rerun. The hook usually asks for it.
/lean-and-mean:lean-and-mean debtList every // lean: shortcut and its upgrade path. Changes nothing.
/lean-and-mean:endsessionSave Rules and Next, commit, push, then stop. When the work meets ## Done, it also runs those steps, such as a merge or a deploy. When it does not, Next says what remains. Details.

Codex uses $lean-and-mean and $endsession. A manual install gives the bare /lean-and-mean and /endsession.

The session-start hook

A short shell script runs when a session starts. It checks AGENTS.md and prints nothing when all is well:

The tidy runs at session start because the context is small then, so it is cheap. Every hook condition.

Optional parts

Session Status Mod

A row above the Claude Code prompt (a side pane in the desktop app): a Cache Idle bar that counts up, End session button; on desktop, project and branch, context and 5h/weekly limit bars, the task list and Next sessions; auto /endsession at 5 minutes cache left, cold-cache question.

Explainer Agent

A subagent that writes a local page with diagrams when an answer is too long for the terminal. It writes short Markdown; the explainer kit does the design.

Utilities, such as a status line, the Explainer Agent and the typesafe-ai skill, are on the extras page.

Why it pays off

Fastershort answers and less code to read and review
Fewer tokensshort sessions keep each request's context small
Lower costless context resent per request; the numbers

Install

Claude Code

claude plugin marketplace add https://github.com/spinlockdevelopment/lean-and-mean
claude plugin install lean-and-mean@lean-and-mean

Restart Claude Code. Then run /lean-and-mean:lean-and-mean once in each project. It writes AGENTS.md and the CLAUDE.md stub. Until then, the hook loads the block each session and reminds you.

Codex desktop and CLI

Run these commands in a terminal.

codex plugin marketplace add https://github.com/spinlockdevelopment/lean-and-mean
codex plugin add lean-and-mean@lean-and-mean

Reopen Codex. Review the SessionStart hook in desktop Settings → Hooks or CLI /hooks. Start a chat at the project root and run $lean-and-mean once.

To refresh the marketplace, run codex plugin marketplace upgrade lean-and-mean and reopen Codex. See Codex Companion for the optional floating Session panel on macOS.

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 block lives in the file, so disabling alone is not enough.

Raw instructions

The plugin is plain text the model follows. Each page renders the Markdown on main:

lean-and-mean is MIT licensed.