# Def

> Locate symbol definitions quickly (precise for Python via AST; conservative candidates for other languages) and print a bounded context packet.

- Skill: `majiayu000/def` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/def`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/def/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/def

---


# def

## Use this skill when
- You need definition locations for a symbol without opening files manually.
- You want minimal, high-signal context for review or refactor work.

## Commands

```sh
# Auto (tries Python-precise, then other languages as candidates)
def MyClass .

# Prefer Python precision and include a small snippet
def MyClass . --lang py -C 2

# Methods / dotted qualnames (Python): find `Class.method`
def MyClass.__init__ mypkg --lang py -C 1

# Bias path ranking if you know where code likely lives
def MyClass . --prefer torch --prefer aten
```

## Notes
- Python results are AST-validated (low false positives).
- Non-Python results are heuristic candidates; use `ctx` to confirm if ambiguous.

