optimise

A command for reviewing a project's Claude Code, Claude Design, or Codex setup against a library of recorded lessons. It focuses on the tools and working habits around a project, not the project's application code.

In plain words
What is it for?
Use it to audit a registered project, discuss suggested setup changes, and record the approved improvements.
Why use it?
It helps find and apply improvements to agent settings, skills, hooks, prompts, and related workflows one change at a time with approval.

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/runnithan/claudex-setup/optimise
Clone the repo
git clone --depth 1 https://github.com/runnithan/claudex-setup

Made for: Claude Code.

Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 9,816 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00038 $0.09816
Opus 5 $0.00019 $0.04908
Sonnet 5 $0.00008 $0.01963
Haiku 4.5 $0.00004 $0.00982

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

Security

Grade A, and why

optimise scanned grade A with 1 finding 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.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`AGENTS.md`, any project `.codex/` directory, and the relevant `~/.codex/config.toml`, the

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/commands/optimise.md · 622 lines

How it starts

The opening of the file, as written. The whole thing — 622 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/optimise: audit a project's Claude setup and apply improvements

You are auditing ONE registered project's Claude tooling setup against the repo's lessons/ library, then walking the owner through concrete improvements interactively and applying the ones they approve. This is not a code review of the project's application code, every finding is about how the owner works with Claude on this project (config, agents, skills, hooks, prompting/keyboard habits), never about whether the app itself is buggy.

This command runs from inside the claudex-setup repo (the hub). The project being audited usually lives elsewhere on disk (its real path is in the registry frontmatter). You edit two places: the audited project's actual .claude/ (applying approved config changes), and the claudex-setup repo's projects/ tracking files (recording what you found and did).

Tune your behaviour to run reliably and unattended-friendly: follow the numbered steps in order, use the exact file paths and formats below, stop where the stop conditions say to stop, and run the final self-check before reporting done.


0. Inputs and mode resolution

  1. Read the argument string. The first bare token is the project slug (e.g. your-project, claudex-setup, another-project, personal-notes). If no slug is given, list the registered projects (the subdirectories of projects/, excluding the root-level registry files README.md, audit-log.md, and habits.md) and ask the owner which one to audit, then stop until they answer.
  2. Detect a tool flag anywhere in the argument string: --design selects the Claude Design sub-area, --codex selects the Codex sub-area, and --code (or no flag) selects the default Claude Code area. Set MODE = design, MODE = codex, or MODE = code accordingly. If the project is multi-tool and no flag was given, tell the owner the project has sub-areas and which flags reach the others (--design, --codex), the default must be a visible choice, not a silent one, then proceed with claude-code/. --design or --codex on a flat (single-tool) project is an error: only a multi-tool project has those sub-areas.
  3. Establish the repo root. This command lives in the claudex-setup repo; the registry is at <repo-root>/projects/. Use <repo-root> as the base for every projects/... path below.

Read the full file on GitHub · 622 lines

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 · 622 lines · 38 tokens per session scan A 115f08453082

Subscribe to this mod's changes

optimise is a command published in the GitHub repository runnithan/claudex-setup (1 stars, last pushed 2d ago), licensed MIT. It adds 38 tokens to every session and 9,816 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other commands, from other repositories