Thanks for considering a contribution. This project is deliberately structured so the highest-impact contribution is also the easiest one.
contextrot supports any agent CLI whose transcripts can be parsed into the normalized session model. Each adapter is one self-contained file — no changes to analysis or reporting code needed.
- Copy
src/contextrot/adapters/claude_code.pyas a starting point. - Implement the two methods of
SessionAdapter:discover()— find transcript files on diskparse(path)— convert one file into aSessionofSteps andToolCalls
- Register it in
src/contextrot/adapters/__init__.py. - Add a small sanitized fixture transcript under
tests/fixtures/and a test file modeled ontests/test_adapter_claude_code.py.
Adapter ground rules:
- Tolerant parsing. Skip malformed lines, ignore unknown fields, never crash on a weird file. A partial session beats an exception.
- No network calls. contextrot is local-only; adapters read files, period.
- Sanitize fixtures. Strip real file paths, code, and personal data from any transcript you commit.
Wanted adapters: Codex CLI, OpenCode, Gemini CLI, OpenClaw, Cursor CLI, OpenTelemetry GenAI spans.
- New outcome signals (
src/contextrot/signals/): each signal must be independently testable, documented indocs/methodology.md, and reported separately in output. Open an issue first to discuss the heuristic. - Prescription rules (
src/contextrot/analysis/prescriptions.py): must be quantified from the user's own data, with an explicit evidence threshold. - Bug reports: include your contextrot version, agent CLI version, OS, and — if it's a parsing bug — a sanitized snippet of the offending transcript line.
git clone https://github.com/Priyanshu-byte-coder/contextrot
cd contextrot
pip install -e ".[dev]"
pytest
ruff check src tests
mypy srcAll three must pass in CI. Python 3.9–3.13 supported (CI tests the full matrix across Linux/macOS/Windows).
- Match the existing code: type hints everywhere, docstrings explain why and document format assumptions.
- Conventional commits (
feat:,fix:,docs:,test:,chore:). - Keep dependencies minimal — new runtime deps need a strong justification (install speed is a feature).
This tool's credibility rests on not overclaiming. Reports must always carry n-counts, confidence intervals, and the observational-diagnostic caveat. PRs that trade rigor for a scarier headline will be declined.