Show decision trail for a file line
arc why
command helps you understand the decision trail behind a specific line of code. It traverses the knowledge graph to find commits, PRs, issues, and other context that led to the current state of the code.
file
Option | Description |
---|---|
--max-depth <depth> | Maximum depth to traverse in the knowledge graph (default: 3) |
--include-issues | Include related issues in the results |
--include-prs | Include related pull requests in the results |
--include-docs | Include related documentation in the results |
--format <format> | Output format: text, json, or markdown (default: text) |
--output <file> | Write output to a file instead of stdout |
--debug | Enable debug logging |
src/main.py
.
trace
trace
command focuses on the historical changes to a file or line, the why
command focuses on understanding the decision-making process that led to the current state of the code.
Feature | why | trace |
---|---|---|
Focus | Decision trail | Historical changes |
Graph traversal | Bi-directional | Linear history |
Default depth | 3 | 1 |
Includes | Commits, PRs, issues, docs | Commits, file changes |
--max-depth
arc build
to ensure the knowledge graph is up to datewhy
command may take some time to execute. To improve performance:
arc build --incremental
why
command