Skip to content

Instantly share code, notes, and snippets.

@rjurney
Last active May 3, 2025 07:37
Show Gist options
  • Save rjurney/769862540c4d210267f987f88b0040f2 to your computer and use it in GitHub Desktop.
Save rjurney/769862540c4d210267f987f88b0040f2 to your computer and use it in GitHub Desktop.
My current CLAUDE.md file, always a work in progress...
{
"permissions": {
"allow": [
"Bash(git status:*)",
"Bash(git diff:*)",
"Bash(git log:*)",
"Bash(poetry update:*)",
"Bash(pip show:*)",
"Bash(pip freeze:*)",
"Bash(pip list:*)",
"Bash(mypy:*)",
"Bash(pytest:*)",
"Bash(black:*)",
"Bash(isort:*)",
"Bash(flake8:*)",
"Bash(jupyter notebook:*)",
"Bash(poetry run mypy *)",
"Bash(poetry run mypy:*)",
"Bash(poetry run black:*)",
"Bash(poetry run isort:*)",
"Bash(poetry run flake8:*)",
"Bash(poetry run pytest:*)",
"Bash(poetry run pytest tests/)",
"Bash(ls:*)",
"Bash(poetry add:*)",
"Bash(poetry install:*)",
"Bash(poetry update:*)",
"Bash(touch *__init__.py"
],
"deny": [
"Bash(pip install:*)"
]
},
"dontCrawlDirectory": false,
"mcpServers": { },
"ignorePatterns": [ ],
"exampleFiles": [
"abzu/crawl.py",
"abzu/cli/process_kg.py",
"scripts/build_graph.py",
"abzu/cli/crawl.py"
]
}

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

  • Install Dependencies: poetry install
  • Run CLI: poetry run abzu
  • Build/Generate abzu/baml_client code: baml-cli generate
  • Test baml_src code: baml-cli test, poetry run pytest tests/
  • Test single: poetry run pytest tests/path_to_test.py::test_name
  • Lint: pre-commit run --all-files, poetry run flake8
  • Format: poetry run black ., poetry run isort .
  • Type check: poetry run mypy

Code Style

  • Line length: 100 characters
  • Python version: 3.12
  • Formatter: black with isort (profile=black)
  • Types: Always use type annotations, warn on any return
  • Imports: Use absolute imports, organize imports to be PEP compliant with isort (profile=black)
  • Error handling: Use mdecific exception types with logging
  • Naming: snake_case for variables/functions, CamelCase for classes
  • BAML: Use for LLM-related code, regenerate client with baml-cli generate
  • Whitespaces: leave no trailing whitespaces, use 4 spaces for indentation, leave no whitespace on blank lines
  • Strings: Use double quotes for strings, use f-strings for string interpolation
  • Docstrings: Use Numpy style for docstrings, include type hints in docstrings
  • Comments: Use comments to explain complex code, avoid obvious comments
  • Tests: Use pytest for testing, include type hints in test functions, use fixtures for setup/teardown
  • Type hints: Use type hints for all function parameters and return types
  • Type checking: Use mypy for type checking, run mypy before committing code
  • Logging: Use logging for error handling, avoid print statements
  • Documentation: Use Sphinx for documentation, include docstrings in all public functions/classes
  • Code style: Follow PEP 8 for Python code style, use flake8 for linting

Claude Logic

  • Command Line Interfaces - at the end of your coding tasks, please alter the 'abzu' CLI to accommodate the changes.
  • Separate logic from the CLI - separate the logic under abzu and sub-modules from the command line interface (CLI) code in abzu.cli. The CLI should only handle input/output from/to the user and should not contain any business logic. For example the module for abzu process kg should be in abzu.kg.* and not in abzu.cli.api. Similarly, the module for abzu process articles should be in abzu.articles.* and not in abzu.cli.api.
  • PySpark - Limit the number of functions within scripts that control dataflow in Spark scripts. We prefer a more linear flow. This only applies to Spark code.
  • Flake8 - fix flake8 errors without being asked and without my verification.
  • Black - fix black errors without being asked and without my verification.
  • Isort - fix isort errors without being asked and without my verification.
  • Mypy - fix mypy errors without being asked and without my verification.
  • Pre-commit - fix pre-commit errors without being asked and without my verification.
  • New Modules - create a folder for a new module without being asked and without my verification.
  • init.py - add these files to new module directories without being asked and without my verification.
  • Edit Multiple Files at Once - if you need to edit multiple files for a single TODO operation, do so in a single step. Do not create multiple steps for the same task.

Alerts

  • BEEP when you are done with something and prompt me, the user in your UI. I need to hear that you're done because I do more than one thing at once. Use the comand echo -ne '\007' to beep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment