by awesome_dude | 2025-08-10 05:07:05+00:00
I've had Claude tell me that I've reached the maximum messages for a session, which was painful.

Having said that it was a good circuit breaker, Claude was stuck on three wrong solutions to an issue, and having to re explain it meant that I realised what the bug was without further input from Claude

edit: FTR where Claude was stuck (and where it helped me)

First, I have a TUI application, written in Go, that is using https://github.com/rivo/tview - I chose tview basically at random, having no background in any of the TUI libraries available, but tview looked like it was easy to understand.

I had written some of the code, but it wasn't doing what I wanted of it. I had gotten Gemini to help me, but it still wasn't doing what I wanted.

Claude first suggested that the application needed to be refactored to make it into an Event Driven MVC TUI app, which I absolutely agreed with.

Claude counselled me on my understanding of the Run() command, and how it was a blocking call (which I hadn't realised). The refactor/re-architecture fixed the way things were being run a great deal.

However I still had a bug that I could not fix, and Claude was equally stumped (as was Gemini)

When I clicked on any of the components in a flex row, the first component behaved as though it was the one that was clicked. When I clicked on any of the components in another flex row the last one behaved as though it was the one that had been clicked.

Claude repeatedly told me that the problem was that the closure that used the index of components (inside a loop) was the problem.

This was outright wrong because

1. That bug has been fixed in Go.

2. The code I was sharing with Claude had the "fix" of local := index - meaning that the local version should have been correct

3. I repeatedly showed Claude logs (that it suggested I create) that showed that ALL of the components were in fact receiving the click event.

The second solution that Claude was fixated on was that th components overlapped one another inside the flex box.

This was partially incorrect.

I told Claude that I could visually see that the components weren't overlapping.

I also told Claude that there were borders around each component that clearly weren't overlapping.

I gave Claude debug logs that showed that the mouse click co-ordinates were inside a single component.

The third issue that Claude claimed was the problem was a click propagation bug in the library.

Claude repeated these claims several times, despite me showing that it wasn't either of the first two things, and I could not find a bug/issue for the third.

The circuit breaking made me stop and think about things, and I realised that all I really had to do was say inside the box "If a click event has been received AND (and this was the fix) You (the component) now have focus then behave".

What I suspect is happening is that the flex box container receives the click, and then tells all of its children that a click happened.

What disappoints me is, if what I suspect is true, then I would have expected Claude to have known that either from the tview documentation OR from reading the tview code (Claude does seem well acquainted with the library)

If my suspicion is correct then the second and third issues Claude claimed were causing me the bug were partially true, that is the flex container is on top of the components, which is an overlap, just not the components themselves overlapping.

The second partial correctness is that the way that the click is being propagated to the components seems to be that the flex box container is telling all of its child components that a click occurred. This isn't really a bug, it's likely well documented (as if I would RTFM...) or clear from the code.