Human-Near-the-Loop - by Stephen Barr
SubscribeSign in
Human-Near-the-Loop<br>A simple CLI tool that changes the way you interact with your coding agents
Stephen Barr<br>Jun 08, 2026
Share
If a coding agent ever decided to rage-bait me, this is about the best way to do it.
I can’t tell you how many times I have come back to an AI session expecting a finished project, only to have it block on a truly silly question. I wanted to be able to tell the AI, ‘feel free to ask me, but if I don’t answer just use your best judgement.’ This article is about how to accomplish that.<br>Thanks for reading Trilogy AI Center of Excellence! Subscribe for free to receive new posts and support my work.
Subscribe
But, there is a bigger message here:<br>You can change the way you interact with your AI agents. How? Just ask them and hand them the tools to do so.
I want to show you a tool that I’ve called SJBIS. The “Stephen J Barr Information Surfacer.” It’s not particularly cleverly named. But as we know naming things is one of the hardest problems in all of computer science. But I built it to scratch my own itch and solve a problem. I use A LOT of AI CLIs. I typically probably have 10+ Claude and 30+ OpenCode sessions running at a given time, spread over five or six projects. That’s about my cognitive limit where I can effectively context switch between all of them.<br>The problem: CLI coding agents are effectively designed as Human-in-the-Loop . I don’t like this because I don’t scale nearly as well as AI does.<br>What I want: AI to ask me a question, but then to use its best judgement if it doesn’t get an answer from me. I’m calling this Human-Near-the-Loop .<br>Constraints: I want this to be able to integrate into any tool with absolutely minimal fuss.<br>Solution: A CLI tool which can ask me a question and wait for an answer. This separates the concern of ‘how do I ask Stephen a question’ from ‘how do I get Stephen’s attention?’<br>How I Designed This
I decided to use Claude Design. I hadn’t used it before, so I thought it would be a fun project to try it. The idea was that I would have a dashboard that I could run from anywhere, where any AI agent can ask me a question. Better yet, anything that needed my attention could try to reach me via this dashboard.<br>The more I thought about it, the more the scope grew. I could have an email checker subagent which used gog to check my Google emails, and surface them to me. I could have similar subagents which watched my iMessages and Signal. Ideally, I wanted to be able to express this intent:<br>I am working right now, show me all questions from my coding agents. And, if anyone in my immediate family messages me, let it through. Otherwise, keep it silent.
So, there would need to be some AI in the system that would understand who messages are from (e.g. agents, my siblings, my work colleagues, etc) and translate these into rules. The design took place over a conversation with Claude 4.8, and I quickly had this.
It wasn’t just a mockup, but an actual demo that I could play with. I really liked the look and feel of it, and I was able to export this to a zip file, and I was able to proceed with the implementation using OpenCode.<br>An idea emerged during my conversation with Claude that was super useful - having timeouts . The idea was that some questions, mostly those from AI agents, can have a timeout . The calling agent can then have a timeout, with instructions to use its best judgement if I don’t asnwer. This is the game changer.<br>Implementation
Claude Design included some great documentation for the agent. This includes a basic user stories, a CLI reference, and an architecture diagram. These artifacts were very useful for the AI to actually implement sjbis.
Claude’s design utilized a local SQLite. The only major change I requested is to switch this for PostgreSQL, with the idea being that I could use sjbis from anywhere. A bit of vibe coding with Kimi K2.6 (served via Fireworks.ai), referencing the design files from Claude design, and I quickly had a working project.<br>Armed with sjbis, AI agents could ask me a question by simply executing the sjbis command in their shell. sjbis would be responsible for getting that question to me and sending my response back. If it times out, the agent is instructed to use its best judgement, to tell sjbis what choice it made, and soldier on.<br>sjbis ask \<br>--question "Approve deploy of PyForge v0.4 to prod?" \<br>--yesno \<br>--agent-name PyForge \<br>--instance "Session s7b3d11" \<br>--blocking \<br>--deadline 1m \<br>--json<br># This will return a question id, and block until either<br># (A) I answer the question or (B) the deadline is reached
# On timeout, follow the working agreement:<br># apply your best judgement, then record it so the dashboard shows the auto-pick:<br>sjbis answer --answer "Yes" --via caller-timeout \<br>--note "No reply in 1m — proceeding; staging passed and prod is idle."
Key Lessons
1 - Be Near the Loop, but not In the loop
This is the whole point of sjbis, and is in...