The disagreement engine for AI-assisted code.
Supported platforms: macOS (Apple Silicon & Intel) · Linux (x86_64) · Windows (x86_64)
Friction prevents LLM hallucinations and lazy coding by forcing AI agents into a structured disagreement. Instead of trusting a single AI output, Friction makes two isolated agents interpret the same requirement. It then highlights their divergences, putting you (the human) at the center of the architectural decision.
Most AI coding tools generate code and expect you to review it. But reviewing AI code is hard, especially when the AI takes shortcuts. Friction changes the paradigm:
- Dual-Agent Isolation: Two different agents (e.g., Claude Code and OpenCode) analyze your requirement completely independently. They cannot "contaminate" each other's thought process.
- Divergence Highlighting: The UI surfaces exactly where the agents disagree on the implementation plan.
- Adversarial Workflow (Phase 3): Agent A writes the code. Agent B reviews and attacks the final code in isolated Git worktrees.
- Bring Your Own CLI (BYOCLI): Supports
claude,codex,gemini, andopencodeout of the box. - Strict Isolation: Each agent runs in its own temporary environment (
cwd,HOME, configs) to ensure independent reasoning. - Local-First & Privacy-Focused: Sessions are persisted locally using SQLite (
~/.friction/sessions.db). No cloud telemetry. - Modern UI: Built with
assistant-uifor a seamless chat experience, retaining powerful custom UI cards for divergence and plan arbitration. - Reproducible Datasets: Opt-in JSON export of sessions (dataset-compatible) with full meta-data.
- Frontend: React 18, Vite, Tailwind CSS, Radix UI,
assistant-ui - Desktop Core: Tauri 2 (Rust)
- Local Storage: SQLite (bundled via
rusqlite) - Git Layer: Native
git worktreeandgit diffintegration
- Node.js (v20+)
- Rust (v1.77+)
- Cargo & Tauri CLI prerequisites (see Tauri Docs)
Clone the repository and install dependencies:
git clone https://github.com/friction-labs/friction.git
cd friction
npm installStart the web frontend only:
npm run devStart the full Desktop App (Tauri):
npm run tauri devBuild a debug version of the desktop app:
npm run tauri build -- --debugFriction does not require a .env file for CLI models. The application features a built-in onboarding and settings manager:
- First Launch: A full-page onboarding screen will guide you to configure your Agent A and Agent B CLIs.
- Settings: Navigate to
Settings > Agentsto define custom CLI command overrides and assign specific models to different phases. - Model Selection: Friction dynamically queries the CLIs (like
opencode models) to provide a live-updating model picker. If unavailable, it falls back to sensible defaults.
Note on Codex (Isolation): For Codex in phases 1 and 2, Friction requires either a non-empty
OPENAI_API_KEYor an existingauth.jsonhost file. Friction securely bridges this auth into the isolated temporary directory.
While CLI agents are managed via the UI, some internal API keys (like the Trust Judge) can be set via environment variables if you prefer bypassing the CLI for specific tasks:
FRICTION_JUDGE_PROVIDER=haiku # haiku | flash | ollama
FRICTION_JUDGE_MODEL=claude-3-5-haiku-latest
GEMINI_API_KEY=... # Required if using flash
OLLAMA_HOST=http://localhost:11434friction/
├── src-tauri/
│ ├── src/
│ │ ├── main.rs
│ │ ├── agents/ # CLI isolation and execution logic
│ │ ├── git/ # Git worktree management
│ │ ├── judge/ # Trust Judge LLM integration
│ │ └── session/ # SQLite local persistence
│ ├── capabilities/
│ ├── Cargo.toml
│ └── tauri.conf.json
├── src/
│ ├── components/
│ │ ├── ai-elements/ # AI-specific rendering components
│ │ ├── chat/ # Conversational interface (assistant-ui)
│ │ └── ui/ # Base UI components (Radix UI / shadcn)
│ ├── lib/ # App logic, orchestrator, state
│ ├── App.tsx
│ └── main.tsx
├── packaging/
│ └── homebrew/friction.rb
├── scripts/
│ └── release/macos-sign-notarize.sh
└── README.md
Contributions are welcome! Please read CONTRIBUTING.md for setup instructions, code conventions, and the pull request process.
If you're encountering CLI mismatches or IPC state drift, refer to the Runtime Diagnostics panel in the app (Settings → Agents → Diagnostics) to debug binary path resolution and CLI readiness.
# Run backend tests
npm run test:backend
# Type-check frontend
npm run buildTo notarize the app for macOS distribution, use the provided helper script:
scripts/release/macos-sign-notarize.shIf the un-notarized app is quarantined by macOS Gatekeeper:
xattr -cr friction.appThis project is licensed under the MIT License. See the LICENSE file for details.