Show decision trail for a file line
The 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
Show the decision trail for a specific line in a 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 |
This will show the decision trail for line 42 in src/main.py
.
This will traverse the knowledge graph up to a depth of 5 to find related information.
This will include related issues and pull requests in the results.
This will output the results in JSON format.
The default output format is a text-based tree showing the decision trail:
trace
While the 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 |
If no results are found, try:
--max-depth
arc build
to ensure the knowledge graph is up to dateFor large repositories, the why
command may take some time to execute. To improve performance:
arc build --incremental
why
commandShow decision trail for a file line
The 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
Show the decision trail for a specific line in a 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 |
This will show the decision trail for line 42 in src/main.py
.
This will traverse the knowledge graph up to a depth of 5 to find related information.
This will include related issues and pull requests in the results.
This will output the results in JSON format.
The default output format is a text-based tree showing the decision trail:
trace
While the 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 |
If no results are found, try:
--max-depth
arc build
to ensure the knowledge graph is up to dateFor large repositories, the why
command may take some time to execute. To improve performance:
arc build --incremental
why
command