docs: add CLAUDE.md with project context for Claude Code sessions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 20:18:24 +02:00
parent 6c678fbcfb
commit 71c19370e5
+28
View File
@@ -0,0 +1,28 @@
# whisper-local
Lokales Speech-to-Text-Tool: Hotkey halten → Audio aufnehmen → faster-whisper transkribieren → Text einfügen.
## Entwicklungsumgebung
- Python 3.13+, Paketmanager: `uv` (Lock-File: `uv.lock`)
- Tests: `uv run pytest` (mit `pytest-asyncio` für async-Tests)
- Starten: `uv run whisper-local`
## Architektur
- Plattform-Dispatch via Factory-Funktionen: `create_listener()` / `create_inserter()`
- Linux: evdev (Hotkey) + ydotool/wl-copy (Wayland-Inserter)
- Windows: pynput (Hotkey) + pywin32 Clipboard + Ctrl+V (Win32-Inserter)
- Interfaces als `typing.Protocol` — keine abstrakte Basisklasse
## Wichtige Muster
- Hotkey-Key-Namen im evdev-Format (`KEY_F12`), auch auf Windows — `_pynput.py` übersetzt intern
- Key-Repeat-Unterdrückung im pynput-Backend: `_pressed`-Flag verhindert Doppelevents
- Async-Callbacks (`on_press`, `on_release`) via `asyncio.get_running_loop().call_soon_threadsafe`
## Konfiguration
- Linux: `~/.config/whisper-local/config.toml`
- Windows: `%APPDATA%\whisper-local\config.toml`
- Vorlage: `config.example.toml`
## Tests
- Plattform-spezifische Tests mit `@pytest.mark.skipif(sys.platform != "linux", ...)`
- Async-Callbacks mit `unittest.mock.AsyncMock` mocken