CtrlK
BlogDocsLog inGet started
Tessl Logo

code-history

Investigate the history, usage, and liveness of code using search and git blame/log. Use when determining if code is dead, understanding why something exists, finding all callers before refactoring, or deciding whether something is safe to remove. Also useful for answering "who added this and why" or "is anything still using this".

79

Quality

100%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

SKILL.md
Quality
Evals
Security

Code History

Figure out if code is still used and whether it's safe to remove. Pick whichever techniques below are useful -- you don't need all of them.

Techniques

Search for callers with grep -rn 'symbol' --include='*.rs' across the whole repo. Classify hits as definition, test, re-export, or real caller. Zero real callers usually means dead. Also check pub use re-exports -- if nothing imports the re-export, it's still dead.

Find the introducing commit with git log --all --oneline --diff-filter=A -S 'symbol' -- '*.rs'. Then git show <commit> --stat to see what else was part of that change.

Trace the lifecycle with git log --all --oneline -S 'symbol' -- '*.rs' to see every commit that added or removed lines with the symbol. Look for commits that deleted callers without deleting the code they called -- that's usually how dead code happens.

Blame with git blame path/to/file.rs -L 100,120. If a function hasn't been touched since the original commit but surrounding code has evolved, it's probably orphaned.

Check transitive usage -- a symbol with zero direct callers might still be reachable through pub use re-exports or trait impls (impl Trait for). If nothing outside the crate uses the re-export, it's dead.

Decision framework

EvidenceVerdict
Zero real callers, only definition + testsDead. Remove with its tests.
Re-exported but no external importsDead. Remove re-export too.
Caller was deleted in a later commitDead from incomplete refactor.
Only caller is itself deadTransitively dead. Remove both.
One callerCandidate for inlining.
2+ callersAlive.

Output format

  1. What it does -- one sentence.
  2. Who introduced it and why -- commit hash, date, original purpose.
  3. What happened -- commit(s) that made it dead or reduced callers.
  4. Current state -- real callers, test-only callers, re-exports.
  5. Recommendation -- remove, inline, or keep. If remove, list all locations.

Git commands reference

git log --all --oneline --diff-filter=A -S 'symbol' -- '*.rs'  # first appearance
git log --all --oneline -S 'symbol' -- '*.rs'                   # all touches
git log --all --oneline -20 -- path/to/file.rs                  # file history
git show <commit>:path/to/file.rs                               # file at commit
git show <commit> -- path/to/file.rs                            # diff for one file
git show <commit> --stat                                        # files changed
git blame path/to/file.rs -L 100,120                            # blame range
git blame -w path/to/file.rs -L 100,120                         # blame ignoring whitespace
git log -1 -S 'deleted_line' -- path/to/file.rs                 # find deletion
git log --all --merges --oneline -S 'symbol'                    # merge commits
Repository
gitlabhq/orbit-knowledge-graph
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.