Apple's Random-Clicking Mac "Monkey" Kept Choosing Quit, So MacPaint Switched Quit Off
Andy Hertzfeld's account shows how Steve Capps turned a tutorial replay trick into a crash hunter while memory on the first Macintosh was painfully tight.

Steve Capps built a desk accessory that made a Macintosh look possessed. In Andy Hertzfeld’s telling, dated October 1983, the machine seemed to be run by “an incredibly fast, somewhat angry monkey, banging away at the mouse and keyboard, generating clicks and drags at random positions with wild abandon.”
The trick came from a tutorial. Capps had been working on “journaling” for the Guided Tour disc, so a Mac could demo itself by replaying events recorded in an earlier session. The hooks that fed in those recorded events could just as easily feed in nonsense. The Mac didn’t check whether its visitor had a plan (or thumbs).
Capps then taught the nonsense some manners. A set percentage of events became menu commands, another share became window drags, and so on. Purely random poking can spend all day on blank space. Weighted poking goes where the code is.
The team had a good reason to want a tireless button masher. The original Mac had 128K of RAM, with around 16K set aside for the system and another 22K for the 512 by 342 black-and-white screen. That left applications 90K or so, which is the kind of fine print that ruins a feature list.
MacPaint had it especially rough. It needed three off-screen buffers, each the size of the whole screen. Multiply Hertzfeld’s rounded 22K by three and you get about 66K, a huge bite out of that 90K. Opening a desk accessory could push it to the edge, and Hertzfeld wrote that “the specific sequences that led to crashes were difficult to reproduce.”
So the Monkey went looking for them. “At first it could crash the system fairly easily, but soon we fixed the more obvious bugs,” Hertzfeld wrote. It was also good office entertainment. People watched to see what it would paint in MacPaint, or whether it would ever type something intelligible in MacWrite (a high bar for monkeys).
The next goal was an app that could survive the Monkey all night. Runs usually ended within 20 minutes, even without a crash, because the Monkey would invariably select Quit. The world’s most persistent tester kept clocking out early.
Bill Atkinson’s answer was a system flag named MonkeyLives, with “Lives” as in the verb, though people often said it the other way. MacPaint and other apps could check the flag, then disable Quit and fence off other places they wanted the Monkey to avoid. Now it could run all night or longer, pushing an app through what Hertzfeld called “every possible situation.”
The flag got prime real estate. System globals started at address 256, or $100 in hexadecimal, just past a 256-byte scratch area. The very first slot had recently opened up, and MonkeyLives moved in.
The tool faded after the 512K Macintosh eased the memory squeeze. Its name stayed at the front of the system globals, a corner office for a departed primate.
Where the next monkey bites
A safe forecast: anything that drives software by itself will find the one control you wish it hadn’t. Random clickers do it by chance. A scripted bot with a bad selector can do it with great confidence, and Delete is a much worse discovery than Quit.
The practical response is likely to look a lot like Atkinson’s flag. Give the app or the test environment a clear signal that automation is running, switch off the destructive paths, and keep a list of what got switched off. Then cover those paths separately, because a green overnight run says nothing about a button the tester was forbidden to touch.
The idea also had company later at Apple. A reader comment on Hertzfeld’s story, signed Paul, describes working there on a tool called Virtual User, developed in the late 1980s. “It used the same principle as the Monkey program but was structured and used as test tool,” Paul wrote.
The original had a simpler job description: click everything, drag everything, never go home. Atkinson’s flag handled that last part. Monkey see, monkey can’t quit.