The Simplest Way to Log Parallel Sub-Agent Conversations

Fazm Team··2 min read

The Simplest Way to Log Parallel Sub-Agent Conversations

When you have an orchestrator spawning multiple sub-agents, tracking what each agent is doing becomes a real problem. MCP call logs, tool usage traces, and conversation history all need to be captured somewhere. The simplest approach that actually works: have each sub-agent write its conversation to a file.

Why Centralized Logging Fails

The obvious approach is to pipe all agent output to a central logging service. But with 5+ agents running in parallel, the interleaved output becomes unreadable. Agent 3's error message appears between Agent 1's code generation and Agent 5's test results. Timestamps help but don't solve the fundamental readability problem.

Structured logging to a database adds complexity and latency. When an agent is mid-task and burning tokens, you don't want logging overhead slowing it down.

File-Per-Agent Pattern

Each sub-agent gets a dedicated log file, typically named by its task or role.

/tmp/agents/
  auth-refactor.log
  api-endpoints.log
  test-suite.log
  ui-components.log
  docs-update.log

The agent appends its full conversation - prompts, responses, tool calls, and results - to its file in real time. You can tail any file to watch a specific agent work. You can grep across all files to find specific patterns.

What to Log

The most useful things to capture are tool calls with their arguments and results, any file reads or writes, compilation output, and error messages. Raw conversation text is less useful than structured entries with timestamps and action types.

Reviewing After the Fact

When something goes wrong - and with parallel agents, something always goes wrong - you can read a single agent's log file top to bottom and understand exactly what it did, what it saw, and where it went off track. That linear narrative is impossible to reconstruct from interleaved centralized logs.

Keep it simple. One file per agent. Append-only. Review when needed.

Fazm is an open source macOS AI agent. Open source on GitHub.

More on This Topic

Related Posts