← Back to context

Comment by ElFitz

8 hours ago

Funnily enough, I grew tired of having to do that myself and sort of automated it by triggering calls to the same (or smarter) model, with the recent agent actions, turns, and outputs, and the user’s last n and first x messages.

Two triggers: random and some half-reliable spiral / loop detection.

The spined off has instructions to check what the agent is doing, compare it to what it’s supposed to do, and either offer suggestions, refocus it, or do nothing. And its response then gets injected in the agent’s context.

Not perfect, but surprisingly effective for such a simple thing.

Can you explain how you piped recent agent actions/turns/outputs? I was looking into this yesterday and tried playing around with streaming json, including hooks, but i (really Claude) would need to write a parser (prob with jq) to filter the noise. Was thinking we tail -f that and select whatever we care about. Kind of an observer to catch such spiraling.