Your new bicycle shifted crisply and precisely when it was new, but now the chain clatters on the rear cluster in some gears. Nothing seems to help.
Pictured is a barrel adjuster. There is one on the right side of the bicycle for the rear shifter and one on the left side for the front shifter. This Instructable concerns only the barrel adjuster for the rear shifter. I have had most of my problems with clatter at the gear cluster on the rear wheel.
The cure for the clatter problem is really pretty simple. I had read a very good manual shortly after getting my new bike with combination brakes and shifters, often called "brifters." Even though the manual discussed these problems, I forgot and had to relearn what I had already read. I was almost ready to accept some shift problems as "normal."
Step 1: First Step
A good first step is to make certain there is enough slack in the cable. A friend's new bicycle did not have enough slack in the cable, and there was clatter in the of the middle gears at the rear cluster. Tweaking the barrel adjuster for the rear derailleur (shifter) did not solve the problem, but only changed which gears clattered.
Release the tension on the shift levers and derailleurs so the cables are in their most relaxed positions. Loosen the cable clamp (hex socket screw between my two thumbs). Pull the cable to hand tight and tighten the cable clamp screw as tightly as possible.
Step 2: Tightening the Cable
Turn the barrel adjuster as shown to tighten the cable. Viewed from the top of the bicycle, from the cable housing side of the barrel adjuster, this would be counter-clockwise. With the bicycle on some kind of hook or work stand, shift the rear gears. Keep tightening half of a turn at a time until the chain jumps to the next larger sprocket when the shift lever depressed one additional click. Run the derailleur up and down through all of the rear gear positions. If the chain does not fall easily to the next smaller sprocket, turn the barrel adjuster a little in the opposite direction.
Step 3: Go Out and Ride
The barrel adjusters are positioned so that the cyclist can tweak them while riding. They are on the downtube for a road bike, but are usually on the handlebars for a mountain or for a comfort bike. What works in the shop does not always work on the road. The chain may still clatter on the cluster sprockets, even though it seemed to work perfectly in your shop.
Step 4: Catching on a Tooth
Part of the frustration is that a rider cannot see what is happening between the chain and the sprockets while out riding. Notice the yellow line on the chain in the photo. It is not normal for the chain to have the bend highlighted by the yellow line. The bend could be due to a stiff link. An old and worn chain is a problem, too. Shifting is better when the chain is clean and well-lubricated. The chain link in this photo is caught on a tooth from the sprocket next to the one you want to use. Not only will the chain clatter, but it will also skip under power with a terrible sounding clunk. Do not worry that you cannot see this while riding.
Step 5: Trouble Shifting to a Larger Sprocket
If you are attempting to shift to a larger sprocket (better for climbing a hill), but the shift is sluggish or clatters; turn the barrel adjuster a quarter turn as shown. The effect is to tighten the cable slightly.
Step 6: Sluggish Shift to a Smaller Sprocket
It is frustrating when you have crested a small hill and you shift for a smaller sprocket (more speed) at the rear cluster, but the derailleur seems sluggish and hangs up. It does not seem to move outward from the frame as it should. The problem could be that the derailleur is restricted in its movement by dirt or lack of lubrication or a weak spring in the derailleur. It could also be that there is some roughness in the cable or in its housing. Check and eliminate these problems first. Generally, sluggish shifting when the derailleur should move outward from the bicycle's frame is caused by too little slack in the cable. Turn the barrel adjuster as shown one fourth of a turn. Again, ride and check performance of the shifters over a couple of miles. Tweak as needed.
If your bicycle is new or if you replaced the shift cables, they will stretch after a couple of hundred miles and will need tension adjustments described here. But, you will also be very pleased that your bicycle once again has the same snappy shifting response that it previously had. There is no reason to settle for sluggish shifting or clatter in the gears.