This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Diffinity is a CLI tool for semantic and textual diffing of configuration files across multiple application runs. It compares files in two directories, using semantic diff for structured formats (JSON, INI) and text diff for others.
python -m venv .venv
source .venv/bin/activate
pip install -e .
diffinity <dir1> <dir2> [options]# Compare specific files
diffinity dir1/ dir2/ --includelist file1.json file2.ini
# Compare by file suffix patterns (replaces dir basenames in paths)
diffinity dir1/ dir2/ --includepatterns .json .ini
# Options
--output report.html # Export to HTML or TXT
--style compact|verbose # Output verbosity
--ignore-paths # Obfuscate filesystem paths in outputFour core modules with clean separation of concerns:
cli.py— Argument parsing (parse_args()) andmain()entry pointengine.py— Main orchestrator (run_diff()): constructs file pairs, invokes parsing, formats/prints output viarichfileio.py— File I/O and diff strategy routing:.json/.ini→ semantic diff (order-independent); others → plain unified diff;sanitize_paths()for path obfuscationreport.py— Export to.txtor.html
- Semantic diff for JSON/INI: Files are parsed into dicts and compared as sorted text, so key order differences are ignored.
- Pattern-based file matching (
--includepatterns): The basename of each input directory is substituted for the suffix pattern to locate matching files across both dirs. richis the only non-stdlib dependency, used for all terminal output coloring.
Uses bumpversion to update version across pyproject.toml, diffinity/__init__.py, and README.md:
bumpversion patch # or minor, majorThere is currently no test suite, CI, or linting tooling set up. The .gitignore includes entries for pytest, ruff, and mypy, suggesting these may be added in the future.