We love contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or reporting issues, your help makes ClaudeCode better for everyone.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/claude_code.git cd claude_code - Install dependencies:
mix deps.get
- Run tests to make sure everything works:
mix test
- Elixir Version: This project requires Elixir >= 1.18
- Claude CLI: Install the Claude Code CLI from claude.ai/code
- API Key: You'll need an Anthropic API key for integration tests
-
Create a branch for your feature:
git checkout -b feature/your-feature-name
-
Write tests first (TDD approach):
# Add tests in test/ directory mix test test/path/to/your_test.exs
-
Implement your changes following the existing code style
-
Run quality checks:
mix quality # Runs format, credo, and dialyzer -
Update documentation if needed:
mix docs # Generate local docs to verify
# Run all tests
mix test
# Run specific test file
mix test test/claude_code/session_test.exs
# Run tests with coverage
mix test.all
# Generate HTML coverage report
mix coveralls.html- Unit tests - Mock the Port for predictable behavior
- Integration tests - Use mock CLI script when real CLI unavailable
- Property tests - Use StreamData for message parsing validation
Follow the existing patterns:
defmodule ClaudeCode.YourModuleTest do
use ExUnit.Case, async: true
describe "your_function/1" do
test "handles expected input correctly" do
# Test implementation
end
test "handles edge cases" do
# Test edge cases
end
end
endWe use Styler for code formatting:
mix format # Format all codeRun these checks before submitting:
mix credo --strict # Static code analysis
mix dialyzer # Type checking- All public functions need
@docstrings - Use doctests where appropriate:
@doc """
Example function that does something useful.
## Examples
iex> ClaudeCode.YourModule.your_function("input")
{:ok, "output"}
"""
def your_function(input) do
# Implementation
endWhen reporting bugs, please include:
- Elixir version:
elixir --version - ClaudeCode version: Check your
mix.exs - Claude CLI version:
claude --version - Reproduction steps: Minimal code example
- Expected vs actual behavior
- Error messages if any
Before requesting features:
- Check existing issues to avoid duplicates
- Describe the use case - why is this needed?
- Propose a solution if you have ideas
- Consider the scope - does it fit the project goals?
- Tests pass:
mix test - Quality checks pass:
mix quality - Documentation updated if needed
- CHANGELOG.md updated for notable changes
- Follows existing code patterns
Include:
- What - What does this PR do?
- Why - Why is this change needed?
- How - How does it work?
- Testing - How was it tested?
Example:
## What
Adds streaming support for real-time responses.
## Why
Users want to see Claude's responses as they're generated, like in the web interface.
## How
- Implements `stream/3` function
- Uses Elixir Streams for lazy evaluation
- Parses JSON messages in real-time
## Testing
- Added unit tests for stream parsing
- Added integration test with mock CLI
- Tested with real Claude CLI manually- Automated checks must pass (CI)
- Code review by maintainers
- Testing on different environments
- Merge when approved
Understanding the codebase:
lib/claude_code.ex- Main API modulelib/claude_code/session.ex- GenServer managing CLI subprocesslib/claude_code/cli.ex- CLI binary detection and command buildinglib/claude_code/options.ex- Options validation with NimbleOptionslib/claude_code/message/- Message type parsinglib/claude_code/content/- Content block parsinglib/claude_code/stream.ex- Stream utilities
See docs/ARCHITECTURE.md for detailed architecture information.
- CLAUDE.md - Project-specific development guidance
- docs/ROADMAP.md - Future plans and current phase
- docs/VISION.md - Project goals and philosophy
- HexDocs - Generated documentation at
/doc/index.html
Releases are handled by maintainers:
- Update version in
mix.exs - Update
CHANGELOG.md - Create git tag
- Publish to Hex.pm
- Be respectful and inclusive
- Help newcomers get started
- Share knowledge through issues and discussions
- Follow the Elixir Community Code of Conduct
Look for issues labeled:
good first issue- Perfect for newcomershelp wanted- Community contributions welcomedocumentation- Improve docs and examples
- Issues - For bugs and feature requests
- Discussions - For questions and community chat
- Discord/Slack - Real-time community support (if available)
Thank you for contributing to ClaudeCode! Every contribution, no matter how small, helps make the Elixir ecosystem better. 🎉