Workshop notes
At the cable bench
Housing compresses, ferrules loosen and a tight bend can add drag. A fresh inner wire alone does not always restore a clean shift.

Trace the route
Check the housing ends, guide under the bottom bracket and the loop into the rear derailleur. Look for pinched sections near bags, racks and steering stops.
Identify the system
Shift and brake housing have different construction. Match the housing, ferrule and inner cable to the control they serve and keep the old parts together for reference.
Recheck on the bike
Turn the handlebar in both directions and run through the gears. A bag strap or light bracket can alter a previously clear cable path once fitted.