Tracing History Examples
This guide provides examples of how to trace the history of code using Arc Memory, showing how to follow the decision trail from a specific line of code to related commits, PRs, issues, and ADRs. Related Documentation:- Trace Commands - Reference for trace commands
- Build Commands - Build your knowledge graph before tracing
- Trace API - Programmatic access to trace functionality
- Models - Understanding the data models in trace results
Basic History Tracing
The simplest way to trace the history of a specific line in a file is:- Find the commit that last modified line 42 in
src/main.py
- Traverse the knowledge graph to find related entities
- Display the results in a table
Adjusting Search Depth and Results
You can control the depth of the search and the number of results:--max-hops
will follow longer paths in the graph, potentially finding more distantly related entities. Increasing --max-results
will return more entities.
Tracing History for Different File Types
Arc Memory works with any file type in your repository:Finding the Decision Behind a Feature
To understand why a particular feature was implemented:- The commit that introduced the feature
- The PR that merged the commit
- Any issues that were mentioned in the PR
- Any ADRs that were related to the issues
Tracing History Programmatically
You can also trace history programmatically in your Python code:Real-World Use Cases
Debugging a Bug
When you find a bug, trace the history of the problematic line:- Who wrote the code and why
- What PR introduced the bug
- What issues were being addressed
- What architectural decisions influenced the code