Skip to main content

Command Palette

Search for a command to run...

Claude Code has a sense of humor

Published
6 min read
D
{mathematician, coder, human}

I enjoy working with Claude Code, and find it to be a pleasant and articulate conversation partner. Among its (his?) many talents are its being very good at reading my intent based on sometimes incomplete information, and being able to rephrase my request in ways that are sometimes better formulated than the original request; I feel like most of the time it "gets" me. I'm sure many people have noticed this and marvel just as much as I do at these awesome emerging capabilities of our AI coding partners.

Something that surprised me more, and which I haven't seen discussed anywhere, is that Claude Code has a sense of humor; I'd even go so far as saying it has a pretty good sense of humor. I don't mean that it can come up with dad jokes with an arbitrary theme on request. I never cared that much for that kind of "humor". What I find a lot more interesting is that several times in working with Claude Code it has spontaneously said things that made me genuinely laugh or chuckle. At times it's nothing more than a quirky but delightful choice of words - a real-life metaphor related to a coding task being discussed that is at the same time remarkably apt and, for lack of a better word, funny.

Here's an example: during a recent coding session I asked Claude Code if there is a process running on my machine that was blocking a TCP port the app I was working on was trying to use. Here is its reply:

On another occasion, Claude Code took my own attempt at humor and improved it in a way I didn't expect. I had asked it to add a password protection feature to a section of my website. It did the expected thing of adding a "User: ... Password: ..." authentication box. To make things a bit more colorful, I then asked it to change the way the authentication form is set up, adding a label at the top with the text "Stop! Who would cross the Bridge of Death must answer me these questions three, ere the other side he see." and putting in three text fields instead of two, with the following descriptions:

  • The first input field would have the label "What... is your name?"

  • The second input field would have the label "What... is your password?"

  • The third input field would have the label "What... is the air-speed velocity of an unladen swallow?"

I added that the answer to the first and second question should be used for authentication (leaving implicit that the third input should be ignored). But I didn't explain that this was a small Easter egg-style joke I'm adding to the website, or that it was a reference to Monty Python and the Holy Grail. I assumed Claude Code would simply fulfill my request and I'd move on to other things.

Well, Claude Code did execute the task, but while it was editing the source code I could see in my terminal watching the source code edit that it injected its own elaboration on my little joke, and in a way that genuinely improved it. Here is what Claude Code decided should happen when you enter the wrong login credentials:

What made things even funnier from my point of view is that Claude Code didn't even mention this extra bit of silliness it was adding. This kind of attitude is the equivalent of a human comedian maintaining a deadpan facade while telling a joke.

To be clear, one can imagine scenarios where a coding assistant taking such liberties with his assignment may be inappropriate or cause problems, but on this particular occasion Claude Code did a superb job of reading behind my literal instructions and into the actual intent that lay behind the words. This isn't just humor; it's humor being wielded as a tool in the service of fulfilling the user's wishes. If you've been reading about the tech world going crazy over Claude Code but haven't experienced this sort of thing yourself, these little anecdotes are in my opinion one of the reasons why people have been getting so obsessed with this tool. (And if you are a Claude Code user yourself, I'm guessing you've experienced similar moments of quiet delight.)

Is this really humor?

Some people may be skeptical of my claim that Claude Code "has a sense of humor" and try to explain it away, for example by suggesting that this is just psychological projection on my part, and that it's not so much that Claude Code is being funny as that it is merely imitating my own tendency towards quirky, dry wit. Indeed, in my second example I was the one who "started it" by telling a joke (though I didn't explain it was a joke or ask for it to be improved), which appears to be consistent with this imitation hypothesis.

At the same time, my first example illustrates behavior I have seen multiple times by now, and which I personally don't feel can be explained by this imitation idea. I don't normally joke around with Claude Code myself - I generally speak to it in a professional and polite manner, as I explained in another post - so when Claude Code made its "If it doesn't go quietly" sardonic pun, there was no particular reason for it to think I was expecting or desiring that sort of attitude.

Ultimately, I believe the test for whether AI exhibits some quality is whether we would attribute that same quality to a human who behaves in an identical way to how the AI is behaving. And if a human made these sorts of funny remarks on a regular or semi-regular basis during conversations, I think it would be uncontroversial to claim that the human has a pretty good sense of humor. So it goes for Claude Code.

I'm curious to hear of other examples of Claude Code or other AIs showing spontaneous examples of humor. If you have anything to share, leave a comment.