mantic-sh
Simple guidance for deciding when to use Mantic.sh and how to run it effectively.
When to use this skill
- Find code by intent when exact keywords are unknown.
- Locate likely files before reading a large codebase.
- Jump to symbol definitions across packages.
- Find symbol references for refactors or code review.
- Estimate blast radius with impact-aware search.
- Keep retrieval context across a multi-step coding task.
Common trigger phrases:
- "where is X implemented"
- "find auth/payment/router logic"
- "go to definition of X"
- "find references of X"
- "show impact of changing X"
When not to use Mantic.sh
- Exact literal or regex text search (prefer
rg). - Mass text operations (for example, scanning all TODO comments).
- Interactive fuzzy browsing (prefer
fzfstyle workflows).
Decision flow
- If the task is exact text or regex matching, use
rgfirst. - If the task is intent-based discovery, use
mantic <query>. - If a symbol name is known, use
mantic goto <symbol>ormantic references <symbol>. - If change risk matters, add
--impact. - If results are weak, retry with better domain terms or
--semantic.
Procedure
- Run Mantic without installation:
npx mantic.sh@latest "<query>" --files
- Choose output mode:
--filesfor fast path lists--jsonfor structured processing--markdownfor readable terminal output
- Use symbol intelligence when applicable:
npx mantic.sh@latest goto "<SymbolName>"
npx mantic.sh@latest references "<SymbolName>"
- Use deeper analysis only when needed:
npx mantic.sh@latest "<query>" --impact
npx mantic.sh@latest "<query>" --semantic
- Restrict scope for precision:
--path <dir>--code,--test,--config
- Open top-ranked files and continue with normal edit/test workflow.
Completion checks
- Query type matches the selected search mode.
- At least one relevant file or symbol location is found.
- Impact was checked before risky changes.
- Fallback to
rgwas used if Mantic output is empty or too broad.
Quick examples
npx mantic.sh@latest "stripe payment webhook" --files
npx mantic.sh@latest goto "UserService"
npx mantic.sh@latest references "handleLogin"
npx mantic.sh@latest "session auth middleware" --impact --json
MCP note
If your environment already exposes Mantic MCP tools (search_files, get_definition, find_references), prefer those tools over shell commands in that environment.