- Core code lives in
src/claude_statusbar:core.pyhandles usage calculation and model lookup,cli.pyprovides the entrypoint (claude-statusbar,cstatus,cs), andupdater.pymanages self-upgrades. - Packaging metadata is in
pyproject.toml; built artifacts land indist/(keep generated wheels/sdists out of commits unless releasing). - Installer helpers:
install.shandweb-install.shfor one-line setup,uninstall.shfor cleanup, andpublish.shfor PyPI uploads. Demo and promotional assets sit indemo/,img.png, andpromotion/.
- Install for development (editable):
python -m pip install -e . - Run locally:
claude-statusbar(orpython -m claude_statusbar.cli --versionto verify wiring). - Build distribution:
python -m build(requiresbuild/wheel). - Publish to PyPI:
./publish.sh(expectsPYPI_API_TOKENor~/.pypirc; offers TestPyPI first). - Install optional dependency for richer data:
python -m claude_statusbar.cli --install-depsthen follow prompts forclaude-monitor.
- Python 3.9+; follow PEP 8 with 4-space indentation and short, imperative helper names (
get_current_model,try_original_analysis). - Keep dependencies minimal (stdlib only by default); guard optional imports and subprocess calls.
- Prefer pure functions with clear return types; add
typinghints where missing and keep logging quiet (current default ERROR).
- No automated suite exists yet; add targeted
pytestcases aroundcore.main, calculation helpers, and file parsing when you touch logic. - For manual checks: place sample Claude JSONL data under
~/.claude/projects/, runclaude-statusbar, and confirm token/cost figures and reset timer behave as expected across empty/malformed files. - If introducing flags, verify CLI help stays readable:
python -m claude_statusbar.cli --help.
- Match existing history: concise lowercase prefixes (
fix: ...,feat: ...,chore: ...) with imperative summaries. - PRs should describe behavior changes, note data sources used (
claude-monitorvs direct file scan), and include sample output before/after when altering the status line. - Keep diffs small and focused; avoid committing generated
dist/orbuild/outputs unless intentionally releasing.
- The tool reads from user-local Claude data under
~/.claude/; avoid logging or committing any captured traces. - Publishing requires secrets (
PYPI_API_TOKEN); export them locally and never bake into scripts. Use TestPyPI when unsure about release artifacts.