Tales from the jar side: Claude Code status line, Spring redirects (or not), OCP employees, and the usual social media
I have lots of unemployment jokes, but none of them work. (rimshot)
Welcome, fellow jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of August 10 - 17, 2025. This week I taught Functional Java on the O’Reilly Learning Platform.
Claude Code Status Line
I run Claude Code at the command line basically every day. My terminal (iTerm2) always has several open tabs, one in each directory where I have a running Claude Code session. Since I tend to leave those sessions running, I can’t tell at a glance which session is running in which directory. I have to enter “! pwd” to get it to print out the where I am.
Not anymore. Claude Code now has an agent to generate a cool status line for you. The slash command is called, naturally enough, /statusline. You just tell it what you want, and Claude Code generates a script that configures it for you.
I asked for a status line that showed the current directory, the model, and the local weather report, including emojis and colors to make it easy to read. The result looks like this:
(I’m not really in Vernon, CT, but hey, close enough.) When I looked at the generated bash script, I saw that it’s using the Open Weather Map API to update, which is what I would have done. Of course, it’s great that I didn’t have to, and it works in every shell automatically.
This was yet another illustration that the developers at Anthropic really do use their own products (or as we disgustingly say in IT, “they eat their own dogfood”). This was just the sort of innovation that fixed a minor annoyance I had as a user, and it’s both simple to generate and helpful to use.
Redirect or Not?
Warning: this section discusses a Java feature in the Spring framework that may be of interest to at most five of my readers. Maybe fewer. Maybe a lot fewer. Maybe just me. I thought I’d let you know ahead of time.
A couple weeks ago I talked about using a Spring app to generate video using Google’s Veo 3 system. The basic process looked like:
Send a POST request with a prompt to Veo 3’s endpoint and get back a job id.
Repeatedly poll that job id to find out whether the job is done or not.
When it’s done, access the URL in the response and download the video.
At the time, I emphasized how Java lets you avoid the “busy waiting” loop that polled to see if the video was ready or not. I used scheduled executors, and reactive streams, and finally virtual threads, to do the job. (Spoiler: virtual threads rule.)
But there was one aspect I didn’t talk about, though it caught my eye at the time. When you do to download the finished video, the URL responds with a 302 redirect. You have to use an HTTP client that understands redirects and can follow them.
What I eventually figured out was that in Spring:
The
RestTemplate
follows redirects by default.The
RestClient
class’s behavior depends on how you create it. If you just callRestClient.create()
, it does NOT follow redirects, but if you callRestClient.Builder.build()
, it does.
In other words, with the RestClient
, you need to be explicit about the behavior you want.
I created this GitHub repository to show the behavior and demonstrate how to pick the way you want the RestClient
to act. Again, that’s for both readers who might care.
Since it’s part of the VeoJava project, here’s a video I generated with the prompt:
A chrome robot/human police officer
sitting in a coffee shop, about to eat a donut
Not really what I had in mind, but at least it worked.
OCP
I’m working on a series of videos for O’Reilly Media that cover a range of Java topics to help developers fill in any gaps in their background. One of the videos is on the Open-Closed Principle in software development, which means that software should be open for extension, but closed for modification. In other words, it should be easy to add new features without modifying existing classes.
This principle was described by Bertrand Meyer, one of the giants of software design, in his book Object-Oriented Software Construction. I used that book when I was working on my MS in Computer Science, in a course called Object-Oriented Design. That book also introduced the world to the Eiffel programming language.
You might be thinking, “The what language?” Yeah, Eiffel is one of those languages that had some really cool features (like actual multiple inheritance with discriminators, design by contract built in, and more) but went nowhere. Still, the OCP abbreviation caught on, especially as part of the SOLID acronym:
Single responsibility principle
Open-closed principle
Liskov substitution principle
Interface segregation principle
Dependency inversion principle
(Can you tell I’m in the middle of preparing to teach my Software Design course this Fall?)
To make my video, I needed an example, so I asked Claude Code to generate one. As it likes to do, it gave me a set of classes that managed different types of employees based on pay, as in salaried, hourly, contractors, etc. In case you’re wondering, it used the template method design pattern to add new types of employees and compute their pay.
At the root, it defined a class called OCPEmployee
, and that both made me laugh and is the reason I’m telling you about this. If you’re old enough, you may vaguely remember a fictional company called OCP, which stood for Omni Consumer Products.
OCP ran many businesses in old Detroit, including law enforcement. Back in the 80’s they developed a not-entirely-successful product called RoboCop.
Once you get past the over-the-top violence (really dramatic at the time) in the movie, it’s a really good science fiction movie that explores what makes someone human or not. That movie has layers. It’s only later you realize that after everything that happened, the same people who were in charge before are still in charge afterwards (minus a couple of dead executives, but as they said, “that’s life in the big city”).
I couldn’t help making at least a small reference to the company in my video on OCP. I pointed out the irony of using that name for a company that tried to exert centralized control on everything, which is arguably a violation of the principle.
As an aside, the sequels to the original movie, and especially the remake, never happened.
Social Media Posts
Lyrics
“Dancing queen, young and sweet, was only seventeen,” is actually creepier, so I’ll go with the teeth idea.
That reminds me of this lyric:
You walked out of my dreams
And into my arms
Now you’re my angel divineYou’re sixteen
So statutory
And you’re mine
Not to mention Ringo was 33 when he sang it. Yikes.
Deadline pressure
Yup, that would do it.
Doors
Or open a window. Whatever works for you.
Snack time
I would never do this, as far as you know.
Dear Mr. Kotter
It’s an age check, but I get it.
Peace Prize
All Trump had to do to win his Nobel was arrest Putin in Alaska and deliver him to the Hague. That would have both clinched the prize and ended the war in Ukraine at the same time.
No such luck.
I’ll get to it soon
I said I’d do it. You don’t have to remind me every six months.
You’re beautiful
Today’s ear worm, with disturbing implications.
Speaking of dated ear worms
You don’t really want him to call.
Sandwich toss
That’s all I’m going to say about that, other than things clearly went a rye. Or was he — and it — a hero?
Birthday cake
I took my wife out to dinner for her birthday. This was dessert:
When she hesitated to order it, I asked her what part of “24-layer chocolate cake” was unclear to her?
For the record, the cake lasted four days.
Have a great week, everybody. :)
Last week:
Functional Java, on the O’Reilly Learning Platform
This week:
No classes, but lots of videos and semester prep.