Clarity is a software design tool for developers and coding agents.
Renamed from Sanity: If you previously used
sanity, this is the same project under a new name.
Step 1: Install with npm (cross-platform):
npm install -g @legacycodehq/clarityOr install on macOS/Linux using Homebrew:
brew install LegacyCodeHQ/tap/clarityStep 2: Inside your project:
clarity setup # Adds usage instructions to AGENTS.md for your coding agentMore install options: Installation Guide.
- C
- C++
- C#
- Dart
- Go
- JavaScript
- Java
- Kotlin
- Python
- Ruby
- Rust
- Swift
- TypeScript
- Build maintainable software
- Understand codebases
- Audit AI-generated code
- Stabilize and reclaim apps built with AI
If you run clarity setup, your coding agent will use Clarity automatically from AGENTS.md.
If you want to use Clarity manually in your terminal, use clarity show commands like the examples below.
clarity show # Visualize uncommitted changes
clarity show -c HEAD # Visualize the latest commit
clarity show -c HEAD~3...HEAD # Visualize a commit range
clarity show -i src,tests # Build graph from specific files/directories
clarity show -w a.go,b.go # Show all paths between files
clarity show -f mermaid # Mermaid output (default is dot)
clarity show -u # Generate a shareable visualization URL
clarity languages # List supported languages and extensionsNote: For quick viewing and sharing, run
clarity show -uto generate a visualization URL directly.
-f dot: Graphviz DOT output (default)-f mermaid: Mermaid flowchart output-u: Generate a visualization URL for supported formats
- Run
clarity showafter every non-trivial code change to review blast radius. - Use
clarity show -c <commit>for clean, reproducible review snapshots.
Clarity works with Desktop and IDE coding agents. If you are using a CLI coding agent, the agent can open diagrams in your browser for review.
Clarity shows impacted files and highlights tests in green.
This project is licensed under the GNU Affero General Public License v3.0.