Captive chimpanzees do clever things, but how deep is their planning? Michael Balter describes a research study following how one chimpanzee harasses zoo visitors: "Stone-throwing chimp plans ahead".
The next day, Santino again threatened visitors with stones, but the group again backed away to avoid being hit. Santino was then observed pulling a heap of hay from inside his enclosure and placing it on the island close to where the visitors approached. He put several stones under the hay and waited until the group returned about an hour later. Then, without performing a dominance display, Santino pulled a stone from under the hay and threw it. Later, he pulled a stone that he had apparently hidden behind a log and tried to hit the visitors with that, as well.
This kind of research is a response to Morgan's Canon, the principle that animal behavior should be explained by the lowest-level cognitive process possible. If you want to demonstrate some kind of intentional planning, you have to do very close ethological study of every step in the planning process. The principle is a way of countering anthropomorphism -- animals sometimes do complex-looking things that actually impose very simple cognitive requirements. But it's good to remind ourselves that chimpanzees aren't ants.