Debug flags
Global debug mode
Enable debug output for all commands:.clanker.yaml
- Config file location
- AWS profile and region resolution
- Tool selection decisions
- AWS CLI command invocations
- HTTP request/response details
- Prompt token counts
- LLM provider and model
cmd/root.go:35 for the global debug flag.
Agent trace mode
Enable detailed agent lifecycle logging:.clanker.yaml
- Decision tree analysis results
- Applicable nodes and priorities
- Execution order groups
- Agent start/completion events
- Dependency satisfaction checks
- Operation execution details
- Aggregation statistics
internal/agent/coordinator/coordinator.go:17 for the trace check.
Component-specific debugging
AWS operations
When debug mode is enabled, AWS operations show:internal/aws/llm.go:93 and internal/aws/parallel.go:19.
Backend API calls
When using backend credential storage, debug mode shows HTTP requests:internal/backend/client.go:73.
Routing decisions
See which agent handles your query:cmd/ask.go:105.
Kubernetes operations
K8s agent debugging shows:internal/k8s/llm.go:40.
IAM operations
IAM agent debugging includes:internal/iam/llm.go:35.
Debug output examples
Full debug trace
Maker plan generation
Credential resolution
Common debug scenarios
Why isn’t my query using the right agent?
Check routing with--route-only:
Why are AWS operations failing?
Enable debug mode to see the exact CLI commands:Which AI provider is being used?
Debug mode shows provider resolution:Are my credentials being loaded from backend?
Look for backend messages:Why is agent trace not showing?
Agent trace requires explicit flag or config:Debugging configuration
Verify config loading
Check profile resolution
cmd/profiles.go:10.
Inspect AI provider config
Performance debugging
Measure operation timing
Debug mode includes operation duration:Check prompt token counts
Monitor parallel execution
With--agent-trace, see how many agents run concurrently:
Environment variables
These environment variables affect debug output:| Variable | Effect |
|---|---|
CLANKER_DEBUG=1 | Same as --debug flag |
AWS_PROFILE | Override default AWS profile |
AWS_REGION | Override default AWS region |
GEMINI_API_KEY | Gemini API key (shown as *** in debug output) |
OPENAI_API_KEY | OpenAI API key (shown as *** in debug output) |
CLANKER_BACKEND_API_KEY | Backend API key for credential storage |
Troubleshooting tips
No output from clanker ask
No output from clanker ask
Check if output is being buffered. Force flush:Or check for errors in stderr:
AWS CLI commands fail
AWS CLI commands fail
Debug mode shows the exact command. Test it manually:Common issues:
- Wrong profile or region
- Expired credentials
- Missing IAM permissions
Agent doesn't spawn
Agent doesn't spawn
Use Look for “Decision tree analysis: 0 applicable nodes” — this means no patterns matched. Try:
--agent-trace to see decision tree evaluation:- More specific keywords (“lambda errors” vs “show me stuff”)
- Explicit flags (
--aws,--cloudflare, etc.)
Slow responses
Slow responses
Check operation timing in debug output:Possible causes:
- Large AWS resource counts (many EC2s, logs, etc.)
- Slow AWS API responses
- Network latency
Debug log locations
Clanker writes debug output to stderr, normal responses to stdout:Related resources
Agent architecture
How agents coordinate and execute
Backend API
Debug credential loading from backend
Configuration
Config file structure and defaults
CLI reference
Command flags and options