lean-and-mean
Overview → spinlockdevelopment.github.io/lean-and-mean · in-depth guide
A Claude Code and Codex plugin. It writes concise prose and YAGNI code rules
into your project's AGENTS.md once, so they apply every session with no
plugin code in the loop. /endsession closes a session: it writes what was
learned back into that file, commits, pushes, then stops.
- Prose. Answer first. Concise, active sentences in plain technical English, broadly following ASD-STE100. No filler or repetition. A diagram or an HTML page when that explains it better.
- Code. Map what the change must reach and could break, finish all of it, then a YAGNI ladder: skip speculative work, then reuse the repo, stdlib, the platform, an installed dependency, one line, and only then new code. Never cut input validation, data-loss handling, security, or accessibility.
- Memory. Each correction becomes one binding line under
## Rules, so it does not happen twice.
Why use it
Faster, fewer tokens, lower cost: short answers, less code to review, and short sessions that keep each request's context small. The measured numbers: why sessions should be short.
Install
Claude Code (or /plugin marketplace add … and /plugin install … in the app):
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 per project.
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 the desktop app or CLI after installing. Review the plugin's SessionStart
hook in desktop Settings → Hooks or CLI /hooks, then start a chat at the
project root and run $lean-and-mean once.
To refresh an existing Git marketplace, run
codex plugin marketplace upgrade lean-and-mean and reopen Codex.
For the floating Session panel on macOS, build and install Codex Companion from a checkout. The companion uses its own activity hooks and shows estimated cache idle time.
Local checkouts, manual installs, and Codex notes: install details.
Use
| Claude Code | Codex | Effect |
|---|---|---|
/lean-and-mean:lean-and-mean | $lean-and-mean | Create or review AGENTS.md: refresh the block, reorder, verify commands and paths, prune, split past 250 lines. Usually runs on its own |
/lean-and-mean:lean-and-mean debt | $lean-and-mean debt | List every // lean: shortcut with its upgrade path |
/lean-and-mean:endsession | $endsession | Save Rules and Next, commit, push, and run ## Done steps when the work is complete. Then stop. Details |
| Session Status Mod | — | Cache Idle bar (minutes since the last reply) and End session button (a Session pane on desktop with project, branch, context and 5h/weekly limit bars (growth since the last prompt and today in a darker shade, time to the weekly reset), the task list, and a brief Next sessions list from AGENTS.md), auto /endsession with 5 minutes of cache left, a Rehydrate / Clear first question when the cache has gone cold. Off in /config. Details |
@agent-lean-and-mean:explainer | — | Explainer Agent: local .pages/<slug>.html page, written as short Markdown and rendered by the explainer kit |
A manual install into ~/.claude/skills/ gives the bare /lean-and-mean and
/endsession.
Extras (/lean-and-mean:statusline, /lean-and-mean:typesafe-ai): extras.
How it works
Claude Code loads AGENTS.md through a one-line CLAUDE.md stub
(@AGENTS.md); Codex loads it directly. Once the ## Operating Mode block is
in it, the mode is on. One SessionStart hook stays silent unless the block is
missing or a review is due. Hook details.
Off: disable the plugin and delete the Operating Mode block. Disabling alone leaves the rules active.
It governs code shape, prose, and context files, not correctness. Pair it with
/code-review; /simplify reviews code bloat.
Development
python3 -m unittest discover -s tests -v
claude plugin validate .claude-plugin/plugin.json && claude plugin test .
The Codex skill validators reject Claude's argument-hint and
disable-model-invocation frontmatter. That is a known exception: the fields
stay for Claude, and Codex's explicit-only policy is in
skills/endsession/agents/openai.yaml.
License
MIT. See LICENSE.
skills/typesafe-ai/ is copied from
typesafe-ai/skills, tracked as the
vendor/typesafe-ai-skills submodule. Copyright and credit belong to
TypeSafe AI (MIT, Copyright (c) 2026 TypeSafe AI; see
skills/typesafe-ai/LICENSE). The only change is
routing Jev calls through OpenRouter.