Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing to claude-agent-sdk

## Development Setup

1. Clone the repo and install with dev dependencies:

```bash
pip install -e ".[dev]"
```

2. Install the pre-push git hook (runs lint checks before push, matching CI):

```bash
./scripts/initial-setup.sh
```

To skip the hook temporarily: `git push --no-verify`.

## Lint & Format

```bash
python -m ruff check src/ tests/ --fix
python -m ruff format src/ tests/
```

## Type Checking

```bash
python -m mypy src/
```

Type checking is only enforced for `src/` (not `tests/`).

## Tests

```bash
# All tests
python -m pytest tests/

# Single test file
python -m pytest tests/test_client.py
```

## PR Guidelines

- Use [Conventional Commits](https://www.conventionalcommits.org/) for PR titles (e.g., `fix:`, `feat:`, `docs:`, `chore:`).
- Keep PRs focused on a single change.
- Make sure lint, typecheck, and tests pass before opening the PR.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ If you're upgrading from the Claude Code SDK (versions < 0.1.0), please see the

## Development

See [CONTRIBUTING.md](CONTRIBUTING.md) for the full development setup, including dev-dependency install, lint, typecheck, and test commands.


If you're contributing to this project, run the initial setup script to install git hooks:

```bash
Expand Down