Skip to content

Clarity is a software design tool for developers and coding agents.

License

Notifications You must be signed in to change notification settings

LegacyCodeHQ/clarity

Repository files navigation

Clarity (formerly Sanity)

Built with Clarity License Release npm version Go Report Card

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.

Quick Start

Step 1: Install with npm (cross-platform):

npm install -g @legacycodehq/clarity

Or install on macOS/Linux using Homebrew:

brew install LegacyCodeHQ/tap/clarity

Step 2: Inside your project:

clarity setup # Adds usage instructions to AGENTS.md for your coding agent

More install options: Installation Guide.

Supported Languages

  • C
  • C++
  • C#
  • Dart
  • Go
  • JavaScript
  • Java
  • Kotlin
  • Python
  • Ruby
  • Rust
  • Swift
  • TypeScript

Use Cases

  • Build maintainable software
  • Understand codebases
  • Audit AI-generated code
  • Stabilize and reclaim apps built with AI

Manual Usage

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.

Common Commands

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 extensions

Note: For quick viewing and sharing, run clarity show -u to generate a visualization URL directly.

Output Options

  • -f dot: Graphviz DOT output (default)
  • -f mermaid: Mermaid flowchart output
  • -u: Generate a visualization URL for supported formats

Tips

  • Run clarity show after every non-trivial code change to review blast radius.
  • Use clarity show -c <commit> for clean, reproducible review snapshots.

Clarity in Action

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 graph in Codex app Clarity shows impacted files and highlights tests in green.


License

This project is licensed under the GNU Affero General Public License v3.0.