Skip to content

Use with AI Agents

AI coding assistants can write code fast. The failure mode is rarely syntax. It’s misunderstanding: wrong entry point, wrong pattern, missing context about what depends on what.

Unfault helps with that. Its graph commands surface codebase structure quickly, and its JSON output is built to be parsed and acted on by agents.

The quickest way to give your agent access to Unfault is to generate skill files:

Terminal window
# For Claude Code
unfault config agent claude
# For OpenCode
unfault config agent opencode
# Install globally (shared across projects)
unfault config agent claude --global

This writes structured skill definitions to .claude/skills/ or .opencode/skills/ so the agent knows what commands are available and how to use them.

If your agent doesn’t support skills, add this to your agent’s instruction file:

  • GitHub Copilot: .github/copilot-instructions.md
  • Cursor: .cursorrules or .cursor/rules/*.mdc
  • Claude Code: CLAUDE.md
  • OpenCode: AGENTS.md
# Unfault (codebase context)
Use Unfault to understand the codebase before and after edits.
Find symbols (semantic search):
unfault graph find is not yet available. Use grep or search tools instead.
Estimate blast radius before refactoring:
unfault graph impact <file>
unfault graph function-impact <file>:<function>
Find all files using a library:
unfault graph library <library-name>
Find the most connected files:
unfault graph critical
Review the current codebase:
unfault review --output json
unfault review --dimension stability

A useful pattern before making significant changes:

Terminal window
# 1. Understand what depends on what you're touching
unfault graph impact src/utils/auth.py
# 2. Check the most critical files for context
unfault graph critical --limit 5
# 3. Review the current state of the dimension you're working in
unfault review --dimension stability --output json

When unfault review --output json returns:

  • Look at contexts[].findings. Each finding has file_path, line, severity, title, and fix_preview.
  • Start with High and Critical severity findings.
  • fix_preview is a hint, not a complete patch. Use it as a starting point.
  • If a finding is in code you didn’t touch, note it but don’t fix it in the same PR unless it’s directly relevant.