Hex.pm Hex Docs License

Help make Claude Code write production-ready Elixir, every time.

Claude, not to be confused with the Claude (probably should have picked a better name πŸ˜…), is an elixir library, batteries-included integration that helps ensure every line of code Claude writes is checked for proper formatting, compiles without warnings, and follows your project's conventionsβ€”automatically.

πŸš€ Quickstart

New to Claude? Our quickstart guide walks you through a complete setup with real examples.

Quick Start

# Install Claude
mix igniter.install claude

# That's it! Now Claude:
# βœ“ Checks if files need formatting after editing
# βœ“ Detects compilation errors immediately
# βœ“ Validates code before commits

The Problem

When Claude Code writes Elixir, you often need to:

  • Run mix format manually after every edit
  • Discover compilation errors only when you run the code
  • Remember to update related test files
  • Ensure consistent code style across your team

The Solution

Claude hooks directly into Claude Code's workflow:

# When Claude writes this code with formatting and compilation issues:
defmodule MyModule do
  def process_user_data(user, options) do
    {:ok, %{id: user.id, name: user.name, email: user.email, created_at: user.created_at, updated_at: user.updated_at, status: user.status, role: user.role}}
  end

  def calculate_total(items) do
    Enum.reduce(items, 0, fn item, acc -> acc + item.price * item.quantty end)  # Typo!
  end
end

# Claude immediately sees:
# ⚠️ File needs formatting (line too long)
# ❌ Compilation error: undefined function quantty/0
# 
# And can fix both issues to produce:
defmodule MyModule do
  def process_user_data(user, options) do
    {:ok,
     %{
       id: user.id,
       name: user.name,
       email: user.email,
       created_at: user.created_at,
       updated_at: user.updated_at,
       status: user.status,
       role: user.role
     }}
  end

  def calculate_total(items) do
    Enum.reduce(items, 0, fn item, acc -> acc + item.price * item.quantity end)
  end
end

Features

🎯 Smart Hooks

Automatically check formatting, catch compilation errors, validate commits, and more.

β†’ See Hooks Documentation for details and configuration.

πŸ€– Sub-agents

Create specialized AI assistants with built-in best practices from your dependencies.

β†’ See Sub-Agents Documentation for details and examples.

πŸ”Œ MCP Server Support

Integrate with Phoenix development tools via Tidewave.

β†’ See Quickstart for configuration.

πŸ“š Best Practices

Usage rules will be added to your CLAUDE.md automatically so you can have the best chance of your agents following best practices.

Installation

Requirements

  • Elixir ~> 1.18
  • Claude Code (CLI)
  • Mix with Igniter support

Install via Igniter

mix igniter.install claude

This will:

  1. Add claude to your dependencies
  2. Generate .claude.exs configuration
  3. Install hooks in .claude/settings.json and .claude/hooks
  4. Create specialized sub-agents in .claude/agents

Configuration

Claude uses .claude.exs for project-specific configuration. See our guides for:

How It Works

This library leverages Claude Code's hook system to intercept file operations:

  1. Claude edits a file β†’ PostToolUse hook triggered
  2. Hook runs Mix tasks β†’ mix format --check-formatted, mix compile --warnings-as-errors
  3. Feedback provided β†’ Claude sees any issues and can fix them
  4. Process repeats β†’ Until the code is production-ready

This happens automatically, without interrupting Claude's workflow.

Documentation

Contributing

We welcome contributions!

# Run tests
mix test

# Format code
mix format

# Run quality checks
mix compile --warnings-as-errors

Support

Roadmap

πŸš€ Coming Soon

Custom Slash Commands

  • /create-subagent - Generate a new sub-agent with guided prompts
  • /create-hook - Scaffold a new custom hook with boilerplate
  • Auto-generate commands in .claude/commands/ during installation

Scoped CLAUDE.md's

  • Directory-specific instructions (e.g., *_web/CLAUDE.md for Phoenix)

More MCP Servers

  • Database tools (PostgreSQL, MySQL, Redis)
  • Testing and documentation servers
  • Auto-configuration based on project dependencies

Dynamic Sub-agents

  • Generate sub-agents for each dependency with context automatically
  • Common workflow templates (LiveView, GraphQL, Testing)

Want to contribute? Open an issue on GitHub!

License

MIT - see LICENSE for details.


Made with ❀️ by the Elixir community