Lead with the observable result
Replace “improve this script” with the behavior that should change. Include one input/output example and a constraint that matters, such as preserving ordering or keeping the existing command-line interface. Name the files you think are involved, while asking the assistant to verify that assumption before editing.
Give context a budget
Supply the relevant error, a minimal fixture, and the command that reproduces the problem. Avoid pasting unrelated logs or entire repositories into a prompt. Remove credentials and personal data from examples. Ask the assistant to report missing information rather than silently filling gaps with invented project conventions.
Separate diagnosis and implementation
For unfamiliar code, request a read-only explanation first. Once the proposed change is clear, authorize a narrow edit and its relevant check. Read the diff alongside the result of that check. A confident explanation is helpful, but observable behavior and a reviewable change are what make the work usable.