Simplify code
- Read the target code, nearby tests, and repository guidance before editing.
- Preserve observable behavior, public interfaces, error handling, security boundaries, and required compatibility unless the user explicitly requests a change.
- Prefer direct control flow, clear names, existing abstractions, and fewer moving parts.
- Remove dead code, redundant wrappers, needless indirection, duplicate branches, and comments that only restate the code.
- Keep comments only for non-obvious intent, constraints, invariants, workarounds, or tradeoffs. Write them in a short, neutral voice without process narration.
- Avoid broad rewrites, speculative abstractions, dependency changes, and unrelated formatting.
- Run focused tests or checks that demonstrate behavior was preserved. Report any unverified area plainly.