Vibe coding changed how we write software. It didn't change how we debug it.
AI coding assistants can generate a thousand lines of working code from a natural language prompt. They handle boilerplate, API integrations, data transformations, test scaffolding. The promise is real and the productivity gain is measurable. But the moment that generated code runs and something goes wrong, the assistant goes blind. It can't see the runtime. It can't inspect the HTTP response that came back malformed. It can't correlate an error in service A with a timeout in service B. It can't read a stack trace that scrolled past three minutes ago.
The feedback loop breaks at the most important step: understanding what went wrong.
The 80/20 Wall
Every developer building with AI assistants has hit the same wall. The AI gets the first 80% right. Often impressively right. The code compiles, the structure is clean, the patterns are idiomatic. Then you run it.
The last 20% is where the work lives. Integration bugs. Race conditions. Wrong API response shapes. An auth token that expires mid-request. A WebSocket that silently disconnects. The kind of failures that only show up at runtime, in the gap between what the code is supposed to do and what it actually does.
Stack Overflow's 2024 developer survey found that 66% of developers spend more time fixing AI-generated code than they expected. That number maps directly to this wall. The AI wrote the code. Now it can't fix it, because it can't observe the failure. You're left copying error messages into the chat, describing what you see in the terminal, and hoping the assistant can reconstruct enough context to help.
That's not a feedback loop. That's a game of telephone.
Why Terminal Output Isn't Enough
Terminal output is the default observability layer for most development. Print statements, console.log, stderr. It works when you're the one reading it. It falls apart when an AI agent needs to read it.
Terminal output is write-only. You print, it scrolls past, it's gone. If you weren't watching when the error happened, you missed it. If the relevant error was 200 lines ago, or in a different terminal entirely, it might as well not exist. There's no filtering, no structured data, no cross-process correlation.
AI agents read terminal output through a narrow window. They see the last N lines of whatever the process printed to stdout. If the bug produced a stack trace that's now off-screen, the agent can't scroll up. If the error happened in a background process running in a different terminal tab, the agent has no access to it at all. If the critical information was an HTTP response body buried inside a verbose log stream, the agent has to parse unstructured text to find it.
Three failures are worse than a lost line, because the answer was never in the scrollback at all. A wrong response that is not an exception: the API returns 200 OK with a useless body, nothing crashes, and success and failure print the same status. An intermittent failure: it happens on every fifth run, and finding the pattern means comparing runs side by side, which scrollback cannot do. Context that was never printed: the request body that triggered the bad response, the configuration at the time of the crash, the timing of a race. That data sat in memory, not in stdout.
Cursor, Claude Code, Devin, and every other AI coding assistant share this limitation. They can execute commands and read the output. But "read the output" means "read a snapshot of whatever text is currently visible." That's a straw. The debugging problem needs a fire hose.
The Feedback Loop and Its Missing Piece
The productive pattern with AI coding assistants follows a tight loop: write, run, check, fix. The assistant writes code. You run it (or the assistant runs it). Something checks whether it worked. If it didn't, the assistant fixes the issue. Repeat until clean.
Addy Osmani described this as the "LLM Coding Workflow" - the iterative cycle that turns AI-assisted development from a one-shot generation into a convergent debugging process. Owain Lewis put the key insight more bluntly: "If you can't debug it with the information available, neither can the agent."
The loop works when "check" means "read test output." Tests are structured. They pass or fail. The failure message is usually specific enough for the agent to act on. But tests don't cover everything, and they especially don't cover the failures you didn't anticipate.
The loop breaks when "check" means "figure out why a multi-step AI pipeline returned garbage at step 3 of 5." Or "determine why the API proxy returns 502 but only when the upstream model is still loading." Or "understand why the WebSocket connection drops after exactly 60 seconds." These are runtime debugging problems. They require observability, not test coverage.
The write-run-check-fix loop has a missing piece. The agent needs a way to observe runtime behavior that's persistent, structured, and queryable. Not ephemeral terminal output. Not a test that somebody thought to write in advance. A log store that the agent can both write to and read from.
What LogPiper Is
LogPiper is a real-time logging bus built into ToolPiper. It's one HTTP endpoint for ingestion, a query endpoint with structured filters, and an SSE stream for real-time monitoring, plus an All Logs view in ToolPiper's main window for when a human wants to look. That's the whole thing.
Write a log entry:
curl -X POST http://127.0.0.1:9998/v1/logs \
-H "Content-Type: application/json" \
-d '{"source": "my-app", "level": "error", "event": "api.timeout",
"message": "Upstream model took 45s, proxy killed the request",
"data": {"model": "llama-3.2-3b", "timeoutMs": 45000},
"correlationId": "req_abc123"}'Query logs after the fact:
curl "http://127.0.0.1:9998/v1/logs?level=error&limit=20"The buffer holds 5,000 entries in a circular queue, in memory. Oldest entries get evicted when the buffer is full, and a ToolPiper restart empties it. Make your log calls fire-and-forget with a short timeout and they never block your application. From the same Mac, writing and reading need no token, because the whole point is zero-friction writes from any local process.
No SDK. No client library. No dependency to install. If your language can make an HTTP POST, it can log to LogPiper. If your language can make an HTTP GET, it can query LogPiper. The interface is the protocol you already know.
Some entries arrive without anyone writing them. ToolPiper logs its own server's requests, each MCP tool call, and the output and crashes of the model backends it runs, and the ModelPiper web app logs its HTTP traffic with bodies when you run it locally. Correlation IDs are yours to set: put the same correlationId on related entries and one query returns them all, whichever process wrote them. For your own code, the payload is whatever you put in data, stored in full: the exact JSON that crossed the wire, not a summary, not a status code.
How Is This Different From What Already Exists?
Three categories of tools touch this space. They solve different problems.
Cursor Debug Mode
Cursor spins up a temporary HTTP log server for a single debug session. The AI agent can write logs to it and read them back. This is genuinely useful for quick, focused debugging within Cursor. The logs vanish when the session ends. It only works inside Cursor. If you're using Claude Code, Devin, or any other client, this doesn't exist for you.
Sentry, Datadog, Grafana MCP Integrations
These monitoring platforms have released MCP server integrations that let AI agents query production telemetry. Sentry's MCP server gives agents access to error reports and stack traces. Datadog's gives access to metrics and dashboards. These tools monitor your AI agent from the outside. They answer "how is the system performing?" and "what errors are users hitting?" They don't answer "what did this specific HTTP request body contain during this specific local debugging session?"
Production observability and local development debugging are different problems. One watches deployed systems at scale. The other helps you figure out why your code doesn't work yet.
LogPiper
LogPiper occupies a different position. The AI agent writes structured logs AND queries them. It's bidirectional. It outlives the chat session, keeping entries until you clear them, the buffer rolls over, or ToolPiper restarts. Cross-tool, because it's plain HTTP. The agent can POST an error log from instrumented code, then query that same log 10 minutes later when it's trying to understand a pattern across multiple runs.
Sentry monitors your AI agent. Cursor gives your AI agent a temporary log server. LogPiper gives your AI agent a log store it can write to and query, and it outlives the chat session.
The Workflow in Practice
Here's what this looks like when you're debugging with an AI coding assistant. This works identically in Claude Code, Cursor, Devin, or any tool that can make HTTP requests.
Step 1: Clear the buffer.
curl -X POST http://127.0.0.1:9998/v1/logs/clear \
-H "Authorization: Bearer tp_..."Start clean. No noise from previous sessions. Clearing is one of the two log routes that need a token, even from the same Mac: a ToolPiper bearer token with the system:control scope, which you create under Security in ToolPiper. The Clear Logs button in ToolPiper's All Logs view does the same without one, or you can skip the clear and filter on the source your instrumentation uses.
Step 2: Tell the agent to instrument the code.
The agent adds log POSTs at key points: before and after API calls, at branch points in business logic, around the code that's failing. Each log entry includes a source, level, event type, and structured data. The agent picks the instrumentation points because it wrote the code and knows where the likely failure modes are.
// The agent adds this around the suspected failure point
try {
const response = await fetch(apiUrl, { method: 'POST', body: payload });
const data = await response.json();
await fetch('http://127.0.0.1:9998/v1/logs', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
source: 'my-app', level: response.ok ? 'info' : 'error', event: 'api.response',
message: `Got ${response.status} from ${apiUrl}`,
data: { status: response.status, body: data, requestPayload: payload }
})
}).catch(() => {});
} catch (err) {
await fetch('http://127.0.0.1:9998/v1/logs', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
source: 'my-app', level: 'error', event: 'api.error',
message: err.message,
data: { url: apiUrl, payload: payload }
})
}).catch(() => {});
throw err;
}Step 3: Reproduce the bug.
Run the code. Trigger the failure. The logs land in LogPiper's buffer as they happen.
Step 4: The agent queries the logs.
curl "http://127.0.0.1:9998/v1/logs?level=error&limit=20"The agent sees the exact error, including the response body the instrumentation logged, the request payload that triggered it, the timestamp, and the source. No copying and pasting from a terminal window. No "can you describe what you see?" The structured data is right there.
Step 5: The agent fixes the code.
With the actual error data in context, the agent can make a targeted fix instead of a guess. If the API returned a 422 with a validation error, the agent sees the validation message. If the response shape was wrong, the agent sees the actual shape. If the request payload was malformed, the agent sees exactly what it sent.
Step 6: Repeat until clean.
Clear, reproduce, query, fix. Each cycle narrows the problem. The agent builds a mental model of the runtime behavior from structured data, not from your narration of what you saw in a terminal.
Why Bidirectional Matters
The word that matters in this architecture is "bidirectional." The agent doesn't only read logs that something else wrote. It writes logs from code it instrumented, and then reads those same logs to understand what happened. This closes the loop in a way that terminal output never can.
Consider the difference. With terminal output, the agent writes a print statement, you run the code, the output scrolls past, and either you copy-paste the relevant line into the chat or the agent reads whatever's in the visible terminal buffer. Three handoff points where information gets lost.
With LogPiper, the agent writes a structured log POST, the code runs, the log entry lands in the buffer, and the agent queries the buffer directly. Zero handoffs. Zero information loss. The agent wrote the instrumentation, so it knows exactly what fields to query and what the values mean.
The correlation ID pattern makes this even more powerful for multi-step workflows. The agent assigns a correlation ID to a job, instruments every step with that ID, runs the job, and then queries all entries for that ID. The complete timeline of a pipeline execution, from input to output to failure, in one query. No timestamp correlation. No grepping across log files. One ID, one query, the whole story.
What Changes When the Agent Can Self-Diagnose
The practical difference is fewer cycles and better fixes.
Without runtime observability, the agent guesses. It sees a failure message (if you provide one) and hypothesizes about the cause. "The API might be returning a different format." "The auth token might have expired." "The timeout might be too short." Each guess produces a code change. Each code change requires a full reproduce cycle. Some guesses are wrong, and the agent needs another round.
With a queryable log store, the agent knows. It doesn't hypothesize about the API response format. It reads the actual response. It doesn't guess whether the token expired. It sees the 401 with the expiry timestamp in the response body. It doesn't wonder about the timeout. It sees the duration logged at 45,230ms against a 30,000ms limit.
The shift is from "the AI can write code" to "the AI can understand what the code does at runtime." That's the gap vibe coding opened. The AI is extraordinary at generation. It's been blind at observation. LogPiper gives it eyes.
In practice, this means fewer back-and-forth cycles per bug. Fewer "I don't know what went wrong, let me try something different" guesses. More "I see the error, here's the fix." The debugging conversation gets shorter because the agent has the data it needs on the first query.
Beyond HTTP: What LogPiper Captures Automatically
Any code the agent instruments with log POSTs is only part of the picture. ToolPiper writes some entries on its own, so a few kinds of activity are already in the buffer before the agent adds a single line of instrumentation. The list is narrower than everything that touches ToolPiper, and the gaps matter as much as the coverage.
The automatic capture includes:
- ToolPiper's own HTTP server: a line for each request it handles (
server.http), refusals included, plusauth.acceptedandauth.rejecteddecisions - MCP tool invocations: the tool name and its arguments, with credential-named keys masked (
mcp.tools.call), then a completion or error entry with the execution time. The tool's output is not logged - Model backends: the stdout and stderr lines of the backend processes ToolPiper runs (
tool.output, with the backend id as the source), plustool.start,tool.stop,tool.errorandtool.crash. A crash entry carries the exit code or signal - Cloud API proxy traffic: request metadata (URL, method, whether it streamed). When a streaming call fails upstream with a 400 or worse, the error body is logged, up to 8,192 characters. Non-streaming calls log status and size only
- The ModelPiper web app, when you run it locally: every HTTP request it makes, as
http.request,http.response,http.errorandhttp.cancel, with request and response bodies cut at 8,000 characters and credential-named keys replaced with[REDACTED]. Streaming responses log status only. The hosted app at modelpiper.com logs nothing
What stays out: the traffic of other apps on your Mac (an entry exists only when something POSTs it), the prompts and completions of local model inference, MCP tool outputs, and the bodies of successful cloud calls. For those, the agent instruments the code that makes the call.
The agent can query level=error&limit=50 and see failures from every source at once: the error its own instrumentation logged next to a backend crash or a failed cloud call. When the web app is running locally, event=http.error&limit=20 returns its failed requests with the response bodies that explain them.
Limitations
LogPiper is an in-memory debugging tool with a 5,000-entry circular buffer. Old entries get evicted. It's not an archival system and it's not a replacement for production observability. Nothing survives a ToolPiper restart. If you need to keep logs, export the buffer to disk (POST /v1/logs/export, which needs a bearer token) before clearing it or quitting.
It works on localhost only. It's not a distributed tracing system. If your debugging problem spans multiple machines, LogPiper covers the local machine and you'll need something else for the remote side.
From the same Mac, writing and reading need no token by design, for zero-friction local writes. That is a feature for development and a non-starter for anything exposed to a network. ToolPiper answers only on 127.0.0.1, and clearing and exporting still require a bearer token.
The AI agent still needs to be told to check the logs. It won't do it automatically. You have to include "query LogPiper for errors" as part of your debugging prompt, or the agent will fall back to reading terminal output like it always has. MCP tool calls through ToolPiper are logged automatically, but the agent querying those logs is still a manual step. Automatic log-check-on-failure is a workflow improvement we're thinking about, but it's not built yet.
One line of project instructions closes most of that gap today. Put a rule such as "whenever a command exits non-zero, query http://127.0.0.1:9998/v1/logs?level=error&limit=10 before proposing a fix" in your CLAUDE.md, and the agent checks the log store without being prompted each time. The step after that is agent-initiated instrumentation: the agent adds log POSTs at API boundaries and decision points while it writes the feature, not as a debugging afterthought, so the data is already there when something fails.
And the buffer size is fixed at 5,000 entries. For a focused debugging session, this is plenty. For a long-running process that generates thousands of log entries per minute, you'll need to query frequently or export periodically. The buffer is a debugging scratchpad, not a time-series database.
The Debugging Gap Vibe Coding Created
Vibe coding made generation fast. It didn't make debugging fast. The AI writes the code in seconds. When that code fails at runtime, the debugging cycle drops back to the pre-AI pace: manual observation, manual context gathering, manual relay of information to the assistant.
LogPiper is one answer to this gap. A structured, queryable log store that outlives the chat session and that the AI agent can both write to and read from. The agent instruments code, reproduces failures, queries structured errors, and fixes the code with the actual runtime data in context. Not a guess. Not your description of what happened. The data itself.
The pattern is simple and it's tool-agnostic. Claude Code, Cursor, Devin, Zed, any tool that can make HTTP requests. The protocol is HTTP. The data is JSON. The workflow is clear, reproduce, query, fix.
ToolPiper is a free download from the modelpiper.com/download, and LogPiper is included in every installation.
This is the pillar article in the vibe debugging series. For a step-by-step guide using Claude Code, see How to Debug with Claude Code Using a Local Log Bus. For the technical architecture of LogPiper itself, see LogPiper: A Universal Logging Bus That Ships Free Inside ToolPiper.
