From cclens
Investigate cclens findings about the user's Claude Code usage to root cause and propose concrete config fixes — recurring tool failures, unused or heavy config, always-on context cost. Use when the user wants to optimize their Claude Code configuration, cut token waste or friction, or act on cclens doctor findings.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cclens:optimizeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`cclens optimize` normally launches a *new* `claude` session seeded with an
cclens optimize normally launches a new claude session seeded with an
advisor prompt. This skill runs the same analysis but adopts that prompt in the
current session instead, so the user stays where they are.
Binary: use cclens if command -v cclens finds it. Otherwise run every
command below through Nix instead: nix run github:lambdalisue/cclens -- <subcommand …>.
If neither cclens nor nix is available, stop and tell the user how to
install it (nix profile install github:lambdalisue/cclens, or
cargo install --git https://github.com/lambdalisue/cclens).
Store: if ./cclens.db exists, use it and omit --db. Otherwise use the
per-user store so no file is dropped into the current project:
DB="${XDG_CACHE_HOME:-$HOME/.cache}/cclens/cclens.db"
mkdir -p "$(dirname "$DB")"
and pass --db "$DB" to every command below.
cclens analyze --db "$DB"
PROMPT="$(mktemp)"
cclens optimize --frozen --print --db "$DB" > "$PROMPT"
If the user asked to optimize their global setup or one specific project, add
--scope global or --scope project:<slug> to the optimize command — the
prompt then pins the work to that config layer.
--print writes the full advisor prompt — the prescribed instructions plus the
complete findings briefing — to stdout. It goes through a temp file (mktemp
creates it private, 0600), not your tool-output stream, because the briefing
carries real paths and error excerpts from the user's transcripts.
Read the temp file and adopt its contents as your instructions for the rest
of the task: investigate each finding to a root cause yourself (using
cclens sql against the store, and the user's actual config files), conclude
with a prioritized fix-plan naming specific file edits, and pause only for the
user's approval of that plan before editing anything.
Delete the temp file (rm -f "$PROMPT") as soon as you have read it. Do not
paste the briefing wholesale back to the user — deliver the conclusions.
npx claudepluginhub lambdalisue/cclens --plugin cclensRuns cclens doctor to produce a one-screen health check of Claude Code usage — token spend, context cost, tool failures, unused config. Use when asked about setup health or resource waste.
This skill should be used when the user asks to "fix claude code", "fix claude", "optimize claude", "improve claude performance", "fix my settings", "setup claude code", "configure claude code", "claude code settings", "tune claude", "fixclaude", "claude is broken", "claude is slow", "claude is lazy", "claude is not working", "make claude better", "keep session alive", "session timer", "rate limit", "avoid rate limits", "rate limited", "fix claude code settings", or wants to optimize their Claude Code installation for maximum performance. Provides an interactive wizard walking through performance settings, rate limit optimization via session timer bump, and optional plugin improvements step by step.
Finds and fixes context window waste in Claude Code or Codex setups. Recovers 5-25%+ of tokens through config cleanup and autocompact management.