Skip to content

Commit 9b0df2d

Browse files
authored
Improve CLAUDE.md (#2524)
1 parent 1e9f063 commit 9b0df2d

File tree

2 files changed

+52
-9
lines changed

2 files changed

+52
-9
lines changed

.claude/settings.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(rg:*)",
5+
"Bash(make:*)",
6+
"Bash(uv run pytest:*)",
7+
"Bash(uv run:*)",
8+
"Bash(git push:*)",
9+
"Bash(git checkout:*)",
10+
"Bash(gh pr create:*)",
11+
"Bash(gh pr view:*)",
12+
"Bash(git add:*)",
13+
"Bash(git commit:*)",
14+
"Bash(gh pr comment:*)",
15+
"Bash(gh pr checks:*)",
16+
"Bash(gh run view:*)",
17+
"Bash(gh pr list:*)",
18+
"Bash(gh api:*)",
19+
"Bash(pre-commit run:*)",
20+
"Bash(grep:*)",
21+
"Bash(find:*)",
22+
"Bash(coverage:*)"
23+
],
24+
"deny": []
25+
}
26+
}

CLAUDE.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,17 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
## Development Commands
66

77
### Core Development Tasks
8+
89
- **Install dependencies**: `make install` (requires uv, pre-commit, and deno)
9-
- **Run all checks**: `make` (format, lint, typecheck, test with coverage)
10-
- **Format code**: `make format`
11-
- **Lint code**: `make lint`
12-
- **Type checking**: `make typecheck` (uses pyright) or `make typecheck-both` (pyright + mypy)
13-
- **Run tests**: `make test` (with coverage)
10+
- **Run all checks**: `pre-commit run --all-files`
11+
- **Run tests**: `make test`
1412
- **Build docs**: `make docs` or `make docs-serve` (local development)
1513

1614
### Single Test Commands
1715
- **Run specific test**: `uv run pytest tests/test_agent.py::test_function_name -v`
1816
- **Run test file**: `uv run pytest tests/test_agent.py -v`
1917
- **Run with debug**: `uv run pytest tests/test_agent.py -v -s`
2018

21-
### Multi-Python Testing
22-
- **Install all Python versions**: `make install-all-python`
23-
- **Test all Python versions**: `make test-all-python`
24-
2519
## Project Architecture
2620

2721
### Core Components
@@ -125,3 +119,26 @@ This is a uv workspace with multiple packages:
125119
- **Lock file**: `uv.lock` (commit this file)
126120
- **Sync command**: `make sync` to update dependencies
127121
- **Optional extras**: Define groups in `pyproject.toml` optional-dependencies
122+
123+
## Best Practices
124+
125+
This is the list of best practices for working with the codebase.
126+
127+
### Rename a class
128+
129+
When asked to rename a class, you need to rename the class in the code and add a deprecation warning to the old class.
130+
131+
```python
132+
from typing_extensions import deprecated
133+
134+
class NewClass: ... # This class was renamed from OldClass.
135+
136+
@deprecated("Use NewClass instead")
137+
class OldClass(NewClass): ...
138+
```
139+
140+
In the test suite, you need to use the `NewClass` instead of the `OldClass`.
141+
142+
### Writing documentation
143+
144+
Always reference Python objects with the "`" (backticks) around them.

0 commit comments

Comments
 (0)