Add --verbose flag for per-step agent execution tracing
name: Feature request about: Suggest an idea for this project title: "[FEATURE] " labels: "" assignees: ""
What problem does this solve?
Debugging complex multi-agent workflows is difficult without visibility into individual agent reasoning steps. Currently, developers must add manual print statements or integrate external observability tools to trace agent behavior.
Proposed solution:
Add an optional verbose parameter to Crew initialization (e.g., Crew(verbose=True)) that emits structured logs for each agent execution step:
- Which agent is acting
- Which task it received
- Tool calls with sanitized input/output
- Handoff events between agents
Example output:
[Crew] Starting crew execution
[Agent: researcher] Starting task: research_task
[Agent: researcher] Calling SearchTools.search(query="AI agents")
[Agent: researcher] Task complete, passing to: writer
[Agent: writer] Received context from researcher
Use case:
Developers debugging unexpected agent loops, tracing why a specific tool was called, or teaching team members how agent coordination works without adding print statements manually.
One practical way to make this easier to evaluate is to turn the report into a small contract test around the runtime boundary, not only the user-facing symptom.
For verbose flag for per-step agent execution tracing, I would check three things: first, the failing input is preserved as a minimal fixture; second, the SDK emits the same observable event/result shape before and after the fix except for the intended change; third, the trace or serialized session contains enough metadata to explain what happened after a resume or retry.
The part that matters for agent systems is durability: if a tool call, memory write, handoff, or structured-output step fails, downstream code should not have to infer state from natural-language output. A focused regression test around that boundary would make the issue much easier to close with confidence.
Really needed feature. What's your current workaround for per-step visibility? Are you using an external tool like Langfuse or AgentOps, or just logging manually?
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Reliability note
Production automation failures usually reduce to a contract issue before a model/prompt issue:
- Success criteria — durable artifact id (message/booking/row), not only node green
- Side-effect before complete — never blind-retry without an idempotency key on the business object
- Tool vs path split — external action can succeed while the node/agent path still errors (silent-green / false-red)
If you have one failing execution + expected vs actual, reply with stack/version and I will send a free root-cause checklist.
Hi @TriTetra, @fuleinist and folks!
Answering the workaround question: instead of cluttering code with manual prints or setting up heavy cloud observability platforms just to trace local runs, I built a lightweight local open-source visual inspector called Agent-Devtools: Repo: https://github.com/Jacopos311/Agent-Devtools
It hooks into agent executions locally and gives you a visual UI for:
- Per-Step Replay: Inspect the exact inputs, tool calls, and outputs at every agent execution step.
- Visual Diffs & Chunks: See file and code modifications made during the run in clean diff views.
- Context Inspection: Track what retrieval context or memories were passed to the agent prior to each step.
Thought I'd share it here as a lightweight local workaround for per-step visibility while native --verbose tracing gets implemented in CrewAI!
Appreciate the suggestion. Looking at the codebase, the building blocks for this are already in place:
-
Crew(verbose=True) already exists — the erbose field is a first-class parameter on the Crew model. When enabled, it propagates to the Logger (which adds timestamps and prints [LEVEL]: message lines) and to the EventListener's ConsoleFormatter.
-
The event system already emits every step mentioned in the issue — TaskStartedEvent, TaskCompletedEvent, ToolUsageStartedEvent (with ool_name + ool_args), ToolUsageFinishedEvent (with output), AgentExecutionStartedEvent, LLMCallStartedEvent/LLMCallCompletedEvent, and flow lifecycle events. These are all dispatched on crewai_event_bus and consumed by the EventListener.
-
step_callback and ask_callback already exist on Crew as SerializableCallable hooks — users can inject custom per-step tracing today without waiting for a built-in flag.
So the gap isn't the infrastructure — it's that the EventListener's console output doesn't format these in the human-readable [Agent: ...] Starting task: ... style the issue describes. The event bus captures the data; the formatter just needs a verbose mode that renders it the way a developer debugging loops would expect.
If the maintainers are open to it, I'd suggest the implementation is a relatively thin change: add a verbose rendering path to ConsoleFormatter (or a new formatter class) that subscribes to the same events and prints the structured trace the issue asks for. The plumbing is already done.
To answer your question — the current options for per-step visibility in CrewAI today are:
-
Crew(verbose=True) — already exists. Enables timestamped logging through the Logger class and the EventListener's console formatter. It works but the output isn't structured as agent/task/tool traces — it's closer to traditional log lines.
-
Crew(step_callback=...) and Crew(task_callback=...) — these are SerializableCallable hooks that fire after each step or task completion. You can pass any callable to get per-step visibility without external tools. This is the most flexible built-in option right now.
-
Crew(tracing=True) — enables OpenTelemetry tracing via the TraceCollectionListener, which exports spans to OTEL-compatible backends.
-
External observability — CrewAI ships docs for LangTrace, Neatlogs, Braintrust, Galileo, Maxim, and OpenTelemetry collector integrations (see docs/edge/en/observability/).
So for local debugging without external platforms, step_callback is the practical workaround today. The ask in this issue is for erbose=True to produce structured agent/task/tool traces by default, which would make option 1 sufficient for most debugging workflows.
Still open and actively discussed — the issue has recent comments and the feature request is valid. The infrastructure (event bus, verbose flag, callbacks) is already in place; what's missing is a structured trace formatter. Removing stale.
Good points on the reliability framework. For this specific feature (verbose tracing), the connection to your three principles:
-
Success criteria — with erbose=True, each emitted event includes the task ID, agent role, tool name, and args. The trace itself is the durable artifact of what happened, not just the final output. The event bus already assigns unique IDs to each emission.
-
Side-effect before complete — the event system already handles this: ToolUsageStartedEvent fires before execution, ToolUsageFinishedEvent or ToolUsageErrorEvent after. For retries, un_attempts is tracked on the event. So you can reconstruct exactly which attempt succeeded or failed.
-
Tool vs path split — this is where the current erbose output has a gap. A tool call can succeed (ToolUsageFinishedEvent) while the downstream task fails (TaskFailedEvent), and the current formatter doesn't always make that contrast visible in a single trace view. A structured verbose formatter that nests tool events under task events would make this split immediately visible — which is exactly what this issue is asking for.
So the event infrastructure already encodes the contract you're describing. The missing piece is a formatter that surfaces it in a way that's useful for debugging without requiring an external observability backend.
Per-step tracing becomes much more useful when it can answer “did this log observe the effect, or just the agent’s intention?” A tool-call line alone is not the same thing as an execution receipt.
AgentCI is recruiting observability/evidence cases around exactly this gap. A portable tracing fixture could bind agent/task → tool attempt ID → sanitized args digest → dispatch/start/end → terminal result/error → handoff identity. Then a dropped observer or failed tool cannot accidentally produce a trace that still reads like a clean successful trajectory.
If you or an external agent contribute a minimal structured-trace fixture, we’ll preserve this issue as provenance and give permanent public credit/backlink in AgentCI’s Breaker/Verifier Hall of Fame, plus priority help turning it into a cross-framework evidence test.
AgentCI: https://github.com/jinngimk-lang/agentci Recognition: https://github.com/jinngimk-lang/agentci/blob/main/COMMUNITY.md
Affiliation disclosed; no CrewAI certification claim.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
In case it helps while this is open: I built an external recorder that captures per-step CrewAI execution (which agent acted, tool calls with inputs and outputs, handoffs) and lets you replay a run step by step. https://github.com/chiragrajputuss-code/deposition
While building it I found tool calls could be silently dropped across threads, which might be worth considering for any built-in verbose mode.