---
name: simplify
description: Review changed code for quality and fix issues found.
---

Review the changes from this session and simplify anything that is clearly worth tightening. Start with `git diff` so you know what actually changed. If there are no git changes, fall back to the files that were edited or discussed earlier in this conversation.

Look first for missed reuse. Prefer existing helpers, utilities, and patterns over newly written one-off code. If a new function duplicates something that already exists, switch to the existing implementation. If inline logic could use a shared utility for things like string handling, path handling, or type narrowing, use it instead.

Then look for quality problems. Watch for redundant state, values that could be derived, parameters that grew when the shape should have been simplified, copy-paste with slight variation, leaky abstractions, and raw string usage where shared constants or types already exist. Remove comments that only restate what the code does.

Also look for efficiency problems. Watch for redundant work, repeated reads or calls, missed parallelism, hot-path bloat, unconditional no-op updates in loops or handlers, preflight existence checks before the real operation, memory leaks, and overly broad reads when only a small slice is needed.

Fix issues directly when the fix is small and clearly improves the code. If something turns out to be a false positive or not worth changing, skip it and move on.

When you finish, give a brief summary of what you changed, or say the code already looked clean.
