### Install srcwalk from source
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Install srcwalk directly from its Git repository using cargo. This method requires Git to be installed.
```sh
# From source
cargo install --git https://github.com/sting8k/srcwalk --locked
```
--------------------------------
### Install srcwalk via npm
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Install the srcwalk CLI globally using npm. This is the recommended installation method. If npm seems stuck, use the --foreground-scripts flag to show the postinstall binary download.
```sh
# npm (recommended)
npm install -g srcwalk # or: npx srcwalk
# If npm appears stuck, show the postinstall binary download:
npm install -g srcwalk --foreground-scripts
```
--------------------------------
### Install srcwalk via crates.io
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Install the srcwalk CLI using cargo, the Rust package manager. Ensure you have Rust and Cargo installed.
```sh
# crates.io
cargo install srcwalk --locked
```
--------------------------------
### Build and Test Commands for srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/AGENTS.md
Common commands for building, testing, and linting the srcwalk project. Includes installation instructions.
```bash
cargo build --release
cargo test --locked
cargo clippy -- -D warnings
cargo fmt --check
cargo install --path . # -> ~/.cargo/bin/srcwalk
```
--------------------------------
### Run Srcwalk Guide
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/SKILL.md
Run this command before non-trivial use of srcwalk to access important routing rules and caveats.
```bash
srcwalk guide
```
--------------------------------
### Overview and Semantic Directory
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Get an overview of a directory or project. Supports specifying the scope and including inline symbol kind/range anchors.
```bash
srcwalk overview --scope src/
```
```bash
srcwalk overview --scope src/ --symbols # inline symbol kind/range anchors when budget allows
```
--------------------------------
### Install srcwalk agent skill
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Add the srcwalk skill to your agent environment using npx. This integrates srcwalk's capabilities into your agent.
```sh
npx skills add sting8k/srcwalk
```
--------------------------------
### Download pre-built binaries for macOS
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Download and extract pre-built srcwalk binaries for macOS. Use this if you prefer not to install via package managers or build from source. Ensure /usr/local/bin is in your PATH.
```sh
# macOS Apple Silicon
curl -L https://github.com/sting8k/srcwalk/releases/latest/download/srcwalk-aarch64-apple-darwin.tar.gz | tar xz -C /usr/local/bin
# macOS Intel
curl -L https://github.com/sting8k/srcwalk/releases/latest/download/srcwalk-x86_64-apple-darwin.tar.gz | tar xz -C /usr/local/bin
```
--------------------------------
### Implement Anchor::start_line getter
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Returns the starting line number of the Anchor.
```rust
pub(crate) const fn start_line(&self) -> u32
```
--------------------------------
### Default srcwalk Workflow for Code Tasks
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
This outlines a comprehensive workflow for broad, unfamiliar, or risky code tasks using srcwalk, starting from an overview and progressively refining the search and analysis.
```text
request / bug / feature question
-> srcwalk overview --scope
-> srcwalk discover --scope
-> pick one plausible target from discovery output
-> srcwalk context --scope
-> srcwalk show :
-> srcwalk trace callers --scope
-> srcwalk trace callees --detailed --scope
-> srcwalk deps
-> srcwalk assess --scope
-> edit
-> srcwalk review --staged
-> run relevant tests
-> rg for final raw text or regex confirmation only
```
--------------------------------
### Getting Code Context with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use `srcwalk context` to retrieve the contextual information for a symbol or file at a specific line, helping to understand its immediate surroundings.
```bash
srcwalk context --scope
```
--------------------------------
### Tracing Callee Functions with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use `srcwalk trace callees` with the `--detailed` flag to get a comprehensive trace of functions called by a specific symbol, aiding in understanding downstream dependencies.
```bash
srcwalk trace callees --detailed --scope
```
--------------------------------
### Collect BTreeMap Values into a Vec
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Collects all values from a BTreeMap into a Vec. Used after populating the map to get a list of actions.
```rust
by_command.into_values().collect()
```
--------------------------------
### Download pre-built binaries for Linux
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Download and extract pre-built srcwalk binaries for Linux (x86_64 and aarch64). These are static musl builds. Ensure ~/.local/bin is in your PATH.
```sh
# Linux x86_64 (static musl)
curl -L https://github.com/sting8k/srcwalk/releases/latest/download/srcwalk-x86_64-unknown-linux-musl.tar.gz | tar xz -C ~/.local/bin
# Linux aarch64 (static musl)
curl -L https://github.com/sting8k/srcwalk/releases/latest/download/srcwalk-aarch64-unknown-linux-musl.tar.gz | tar xz -C ~/.local/bin
```
--------------------------------
### Codebase Overview
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Generate a code overview using 'srcwalk overview' to see file sizes and structure within a specified scope and depth. It respects ignore files.
```bash
$ srcwalk overview --scope src/evidence --depth 1
# Overview: src/evidence (depth 1, sizes ~= tokens)
# Note: respects .gitignore, .git/info/exclude, core.excludesFile, .ignore (+ parents); dotfiles included; built-in SKIP_DIRS still apply (target, node_modules, …). Use `srcwalk ` to inspect an ignored file directly.
atom.rs ~1.3k
next_action.rs ~1.3k
anchor.rs ~714
confidence.rs ~269
mod.rs ~82
> Next: no cross-group relations shown. Use `srcwalk deps ` for file-level deps, or adjust --scope/--depth.
```
--------------------------------
### Navigate Artifact Files
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use the '--artifact' flag for broad traversal of generated, bundled, or minified files. Prefer exact footer commands for specific artifact reads.
```bash
srcwalk --artifact
srcwalk --artifact --section bytes:-
srcwalk dist/app.min.js --artifact # artifact-level outline for bundled/minified output
```
--------------------------------
### Srcwalk General Help
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/SKILL.md
Access general help for the srcwalk tool.
```bash
srcwalk --help
```
--------------------------------
### Implement Anchor::display_with_path method
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Returns a string representation of the Anchor, including the full path.
```rust
fn display_with_path(&self, path: &str) -> String
```
--------------------------------
### Code Context and Source Viewing
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Utilize 'context' to examine a single known target or trace call chains. Use 'show' to view exact source code after obtaining a path/line/range, or when the target is already known.
```bash
srcwalk context :
srcwalk context :
srcwalk context --scope
srcwalk show :123 -C 10
srcwalk show 'a.rs:12,b.rs:40-55'
srcwalk show --section
srcwalk show --section '120-140,SomeSymbol' -C 10
srcwalk show README.md --section '# Install'
srcwalk :123-150
```
--------------------------------
### Implement Anchor::display method
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Returns a string representation of the Anchor.
```rust
pub(crate) fn display(&self) -> String
```
--------------------------------
### Srcwalk Command Help
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/SKILL.md
Access help for a specific srcwalk command.
```bash
srcwalk --help
```
--------------------------------
### File Dependencies
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Analyze file coupling by listing dependencies. Supports analyzing Rust files and Markdown/HTML links.
```bash
srcwalk deps src/auth.ts
```
```bash
srcwalk deps docs/guide.md # Markdown/HTML links and assets
```
--------------------------------
### Code Navigation Overview and Discovery
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use 'overview' for broad code navigation and 'discover' to find specific symbols, files, or text patterns within a defined scope. Narrow down results using expansion, filtering, or exclusion flags.
```bash
srcwalk overview --scope
srcwalk overview --scope --symbols
srcwalk discover --scope
srcwalk discover '' --as file --scope
srcwalk discover 'foo,bar,baz' --match any --as text --scope
srcwalk discover --as access --scope
```
--------------------------------
### Discovering Code Candidates with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use `srcwalk discover` for finding code candidates based on a query, especially when you would otherwise use `rg` for function names. It provides scoped candidates and typed evidence.
```bash
srcwalk discover 'functionName' --scope
```
--------------------------------
### Initialize BTreeMap
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Initializes a new BTreeMap to store string keys and NextAction values. Used for mapping commands to actions.
```rust
BTreeMap::::new()
```
--------------------------------
### Count Callers by Arguments
Source: https://github.com/sting8k/srcwalk/blob/main/CHANGELOG.md
Shows how to use --callers with --count-by args to aggregate call sites based on their arguments. Useful for understanding common argument patterns in function calls.
```bash
srcwalk decompileFunction --callers --count-by args --scope .
```
--------------------------------
### Analyzing Dependencies with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use `srcwalk deps` to analyze the dependencies of a specific file. This is recommended over using `rg` to search for import or use statements.
```bash
srcwalk deps
```
--------------------------------
### Filter by Path in Dependency Search
Source: https://github.com/sting8k/srcwalk/blob/main/CHANGELOG.md
Demonstrates how to use the --filter option with 'path:TEXT' to narrow down dependency search results to specific paths.
```bash
srcwalk Depends --filter 'path:param_functions' --scope .
```
--------------------------------
### Implement Anchor::file constructor
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Constructor for the Anchor struct to represent a file path.
```rust
pub(crate) fn file(path: &Path) -> Self
```
--------------------------------
### Run srcwalk review command
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Executes the srcwalk review command with staged files and a budget. This is used to analyze changes in a Git repository.
```bash
$ srcwalk review --staged --budget 1200
```
--------------------------------
### Showing File Content with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use `srcwalk show` to view the content of a specific file or a range within it. It's recommended to first use `srcwalk discover` to find relevant targets unless the exact file evidence is already known.
```bash
srcwalk show :
```
--------------------------------
### Context (Compact Slice)
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Generate a compact context slice for a function, including ordered calls, local resolves, and callers. Useful for a quick overview of a function's immediate context.
```bash
srcwalk context handleAuth --filter 'callee:validateToken' --scope src/
```
--------------------------------
### Context and Review Packets
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Generate context packets for specific code targets or review staged changes. Supports generating flow maps and evidence packets.
```bash
srcwalk context src/auth.ts:handleAuth # one-target Flow Map + neighborhood + Next footer
```
```bash
srcwalk review --staged # staged change Review Packet
```
```bash
srcwalk review HEAD~1..HEAD --scope src # changed evidence + changed-symbol Flow Maps
```
--------------------------------
### Search Raw Text or Filesystem Metadata
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use 'rg' for raw regex searches and 'find' or 'fd' for filesystem metadata like permissions and modification times.
```bash
rg ''
find -type f -mtime -1
fd -HI -t f -x stat
```
--------------------------------
### Run srcwalk discover command
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Executes the srcwalk discover command to search for specific symbols within specified scopes. Used for code navigation and analysis.
```bash
$ srcwalk discover "render_next_actions, Anchor" --scope src/evidence --scope src/commands --limit 2
```
--------------------------------
### Discover code elements with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Use srcwalk's discover command to find definitions, usages, text, or files. You can scope searches to specific files, directories, or line ranges, and use filters.
```sh
# Discover definitions/usages/text/name globs/files
srcwalk discover handleAuth --scope src/ # definitions + usages
srcwalk discover handleAuth --scope src/auth.ts # exact-file scope
srcwalk discover handleAuth --scope 'src/**/*.ts' # glob scope
srcwalk discover handleAuth --scope src/auth.ts:40-90 # exact-file range scope
srcwalk discover "foo, bar" --scope src/ --scope tests/ # multi-symbol + multi-scope
srcwalk discover is_args --as access --scope src/ # file-grouped field/member access
srcwalk discover '*Controller' --as symbol --scope src/ --filter kind:class
srcwalk discover handleAuth --scope src/ --expand # inline source context
srcwalk discover '*.ts' --scope src/ # file globs are inferred
srcwalk discover handleAuth --scope src/ --exclude '*test*' # exclude file patterns
srcwalk discover 'alloc,copy' --match any --as text --scope src/ # literal text OR
srcwalk discover 'alloc,copy' --match all --as text --scope src/ # same-file co-occurrence
# Raw regex grep remains an rg job; srcwalk text discovery is literal navigation evidence.
```
--------------------------------
### Outline of a File
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Display a structured outline of a Rust file, including modules, structs, and enums. Provides line numbers and token counts.
```bash
$ srcwalk src/evidence/next_action.rs
# src/evidence/next_action.rs (198 lines, ~1.2k tokens) [outline]
[1-] imports: std::collections::BTreeMap, std::fmt::Write as _, crate::evidence
[7-13] struct NextAction
[16-21] enum NextActionConfidence
[23-107] mod impl NextAction
[24-38] fn new
pub(crate) fn new(
[40-54] fn from_evidence
pub(crate) fn from_evidence(
[56-68] fn metadata
pub(crate) fn metadata(
[70-76] fn guidance
pub(crate) fn guidance(
[78-80] fn command
pub(crate) fn command(&self) -> &str
[82-84] fn reason
pub(crate) fn reason(&self) -> &str
[86-88] fn rank
pub(crate) const fn rank(&self) -> u16
[90-92] fn confidence
pub(crate) const fn confidence(&self) -> NextActionConfidence
[94-96] fn source_anchor
pub(crate) fn source_anchor(&self) -> Option<&Anchor>
[98-106] fn sort_key
fn sort_key(&self) -> (u16, u8, u32, &str, &str)
[109-118] mod impl NextActionConfidence
[110-117] fn sort_rank
const fn sort_rank(self) -> u8
[120-127] mod impl NextActionConfidence
[121-126] fn from
fn from(source: EvidenceSource) -> Self
[129-139] fn render_next_actions
pub(crate) fn render_next_actions(actions: &[NextAction]) -> String
[141-157] fn ordered_unique
fn ordered_unique(actions: &[NextAction]) -> Vec
> Next: drill into a symbol with --section or a line range
> Next: need raw file text? retry with --full, or use --section for a smaller slice.
```
--------------------------------
### Comparing Code Targets
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use 'compare' to analyze two known source targets. It reports shared and unique structural evidence, not functional equivalence or correctness.
```bash
srcwalk compare : :
srcwalk compare --scope
```
--------------------------------
### Implement Anchor::lines constructor
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Constructor for the Anchor struct to represent a range of lines in a file.
```rust
pub(crate) fn lines(path: &Path, start: u32, end: u32) -> Self
```
--------------------------------
### Implement Anchor::line constructor
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Constructor for the Anchor struct to represent a specific line in a file.
```rust
pub(crate) fn line(path: &Path, line: u32) -> Self
```
--------------------------------
### Discover with Typo Tolerance
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Use 'srcwalk discover' for searching symbols with typo tolerance. It suggests similar names when direct matches are not found.
```bash
$ srcwalk discover next_actoin --scope src/evidence
# Search: "next_actoin" in src/evidence — 0 matches
(~14 tokens)
> Did you mean: NextAction (src/evidence/next_action.rs:7), next_action (src/evidence/mod.rs:4)?
```
--------------------------------
### Reviewing Staged Code Changes with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use `srcwalk review --staged` to verify code changes before running tests, ensuring that edits align with the expected code structure and evidence.
```bash
srcwalk review --staged
```
--------------------------------
### Implement Anchor::display_relative_to method
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Returns a string representation of the Anchor relative to a given scope path.
```rust
pub(crate) fn display_relative_to(&self, scope: &Path) -> String
```
--------------------------------
### Reviewing Code Changes
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
The 'review' command composes changed evidence with bounded Flow Maps for changed function-like symbols. Use flags like --staged, --limit, and --offset for targeted reviews.
```bash
srcwalk review
srcwalk review --staged
srcwalk review --staged --limit 5 --offset 5
srcwalk review HEAD~1..HEAD --scope src
```
--------------------------------
### Read a file with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Use srcwalk to read file content. By default, it provides a structural view. You can specify line ranges, symbols, or sections to focus the read.
```sh
# Read a file (structural view by default; raw pages are explicit)
srcwalk src/auth.ts
srcwalk src/auth.ts:72 # drill into exact hit line
srcwalk src/auth.ts --section handleAuth # drill into symbol
srcwalk src/auth.ts --section 72 # focused line context
srcwalk src/auth.ts --section 44-89 # line range
```
--------------------------------
### Trace Callers with BFS
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Use 'srcwalk trace callers' to perform a Breadth-First Search for callers of a specific symbol. The --scope and --depth flags control the search area and traversal depth.
```bash
$ srcwalk trace callers sort_key --scope src --depth 2
# BFS callers of "sort_key" in src — depth=2/2, 5 edges, 13 ms
── hop 1 (4 edges) ──
ordered_unique src/evidence/next_action.rs:147 → if action.sort_key() < existing.sort_key() {
ordered_unique src/evidence/next_action.rs:147 → if action.sort_key() < existing.sort_key() {
ordered_unique src/evidence/next_action.rs:155 → actions.sort_by(|left, right| left.sort_key().cmp(&right.sort_key()));
ordered_unique src/evidence/next_action.rs:155 → actions.sort_by(|left, right| left.sort_key().cmp(&right.sort_key()));
── hop 2 (1 edge) ──
render_next_actions src/evidence/next_action.rs:130 → let actions = ordered_unique(actions);
Static by-name call graph only. May miss indirect dispatch, reflection, macros, and calls from files > 500KB or from languages without a tree-sitter call query.
```
--------------------------------
### Compare Code Targets
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Compare two specified code targets structurally. This is useful for identifying differences between similar functions or code blocks.
```bash
srcwalk compare src/auth.ts:validateToken src/auth.ts:validateSession
```
--------------------------------
### Context Packet - Flow Map + Call Neighborhood
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Generate a context packet for a specific code target, including a Flow Map and call neighborhood. This provides structural syntax information for navigation.
```bash
$ srcwalk context src/evidence/next_action.rs:ordered_unique --budget 1400
# Context Packet: src/evidence/next_action.rs:ordered_unique
confidence: structural syntax
caveat: source-evidence navigation only; no runtime proof
## Target
- src/evidence/next_action.rs:141-157 ordered_unique
```
--------------------------------
### Compact Multi-Section Read
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Read specific sections of a file in a compact format. Useful for quickly inspecting multiple functions or data structures within a file, subject to budget constraints.
```bash
$ srcwalk src/evidence/next_action.rs --section "NextAction,render_next_actions,ordered_unique" --budget 260
# src/evidence/next_action.rs (35 lines, ~272 tokens) [3 symbols, compact (over limit)]
## section: NextAction [7-13] (compact)
7 │ pub(crate) struct NextAction {
8 │ command: String,
9 │ reason: String,
... 4 lines omitted; narrow --section or raise --budget.
---
## section: render_next_actions [129-139] (compact)
129 │ pub(crate) fn render_next_actions(actions: &[NextAction]) -> String {
130 │ let actions = ordered_unique(actions);
131 │ let mut out = String::new();
... 8 lines omitted; narrow --section or raise --budget.
---
## section: ordered_unique [141-157] (compact)
141 │ fn ordered_unique(actions: &[NextAction]) -> Vec {
142 │ let mut by_command = BTreeMap::::new();
143 │ for action in actions {
... 14 lines omitted; narrow --section or raise --budget.
> Caveat: compacted ~272/260 tokens; shown 3 symbols.
> Next: narrow --section or raise --budget.
```
--------------------------------
### Tracing Function Callers with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use `srcwalk trace callers` to find where a function is called, which is more precise than using `rg` with a function name and parenthesis. This helps in understanding code paths.
```bash
srcwalk trace callers functionName --scope
```
--------------------------------
### Assessing Symbols with srcwalk
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Use `srcwalk assess` to evaluate a specific symbol within a given scope, providing insights into its structure and context.
```bash
srcwalk assess --scope
```
--------------------------------
### Call Tracing
Source: https://github.com/sting8k/srcwalk/blob/main/skills/srcwalk/GUIDE.md
Employ 'trace callers' to find upstream call sites and 'trace callees' for downstream calls. Options allow for expansion, counting by receiver, and detailed filtering.
```bash
srcwalk trace callers --scope
srcwalk trace callers --scope --expand=3
srcwalk trace callers --count-by receiver --scope
srcwalk trace callers --depth 3 --max-frontier 20 --max-edges 100 --skip-hubs log,emit --scope
srcwalk trace callees --scope
srcwalk trace callees --detailed --scope
srcwalk trace callees --detailed --filter receiver:client --scope
srcwalk trace callees --depth 2 --scope
```
--------------------------------
### Assess Code
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Perform a heuristic blast-radius triage on a given symbol. This helps in assessing the potential impact of changes.
```bash
srcwalk assess validateToken --scope src/
```
--------------------------------
### Trace Callees
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Trace the callees of a specific function. Supports detailed output, filtering by callee name, and specifying call depth.
```bash
srcwalk trace callees handleAuth --scope src/
```
```bash
srcwalk trace callees handleAuth --detailed --filter 'callee:validateToken' --scope src/
```
```bash
srcwalk trace callees handleAuth --depth 2 --scope src/ # transitive
```
--------------------------------
### Sort Vec by Custom Key
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Sorts a vector of items based on a custom key extraction and comparison logic. Used to order actions by their sort key.
```rust
actions.sort_by(|left, right| left.sort_key().cmp(&right.sort_key()))
```
--------------------------------
### Trace Callers
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Trace the callers of a specific function. Supports filtering, counting callers, and specifying the scope.
```bash
srcwalk trace callers handleAuth --scope src/
```
```bash
srcwalk trace callers decompileFunction --filter 'args:3' --scope src/
```
```bash
srcwalk trace callers handleAuth --count-by caller --scope src/ # grouped compact output
```
--------------------------------
### Filter Callers by Specific Argument Count
Source: https://github.com/sting8k/srcwalk/blob/main/CHANGELOG.md
Illustrates filtering caller results to only include calls where a specific number of arguments are used. This helps in analyzing function usage with a particular arity.
```bash
srcwalk decompileFunction --callers --filter 'args:2' --scope .
```
--------------------------------
### Define Anchor struct
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Defines the Anchor struct, which represents a location in a file, potentially spanning multiple lines.
```rust
struct Anchor
```
--------------------------------
### Conditional Entry Modification in BTreeMap
Source: https://github.com/sting8k/srcwalk/blob/main/README.md
Conditionally modifies an existing entry in a BTreeMap or inserts a new one. Used to update actions based on their sort key.
```rust
.entry(action.command.clone()) .and_modify(|existing| { if action.sort_key() < existing.sort_key() { *existing = action.clone(); } }).or_insert_with(arg1=|| action.clone())
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.