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.
Set Up Agent Skills
Section titled “Set Up Agent Skills”The quickest way to give your agent access to Unfault is to generate skill files:
# For Claude Codeunfault config agent claude
# For OpenCodeunfault config agent opencode
# Install globally (shared across projects)unfault config agent claude --globalThis writes structured skill definitions to .claude/skills/ or .opencode/skills/ so the agent knows what commands are available and how to use them.
Manual Setup
Section titled “Manual Setup”If your agent doesn’t support skills, add this to your agent’s instruction file:
- GitHub Copilot:
.github/copilot-instructions.md - Cursor:
.cursorrulesor.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 stabilityThe Context Loop
Section titled “The Context Loop”A useful pattern before making significant changes:
# 1. Understand what depends on what you're touchingunfault graph impact src/utils/auth.py
# 2. Check the most critical files for contextunfault graph critical --limit 5
# 3. Review the current state of the dimension you're working inunfault review --dimension stability --output jsonInterpreting Review Output
Section titled “Interpreting Review Output”When unfault review --output json returns:
- Look at
contexts[].findings. Each finding hasfile_path,line,severity,title, andfix_preview. - Start with
HighandCriticalseverity findings. fix_previewis 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.