Skip to main content

chera (چرا) answers the WHY of your codebase: it rebuilds the story of an AI-built project from git history and coding-agent sessions, and serves it as a local web app.

Project description

chera · چرا

chera (چرا) means “why” in Persian. It answers the why of your codebase.

You built your project with AI agents (Claude Code, Cursor, Copilot…). It works — but months later nobody remembers why anything looks the way it does. Why redis? Why was the payment flow rewritten? What died along the way?

chera reconstructs the story of your project from evidence that already exists on your machine — git history and AI coding-agent sessions — and serves it as a local web app:

  • Story — the project as a narrated timeline of eras and episodes, each with its evidence (commits, agent prompts) and an honest confidence label.
  • Twin — a living map of the codebase: which decisions are still active, which are partial, which are dead.
  • Time-travel — scrub through time and watch the project grow.
  • Ask — free-form questions (“why do we use redis?”) answered only from evidence. When there is no evidence, chera says so instead of hallucinating.

100% local. Zero runtime dependencies. No API key required.

Install

pip install chera

Requires Python 3.10+ and git. Nothing else.

Quickstart

cd your-project
chera ui          # scan + open the web app at http://127.0.0.1:7345

That's it. Other entry points:

Command What it does
chera scan Build/refresh the project twin (.chera/twin.json)
chera ui Scan and open the local web app
chera watch Keep the twin updated as you keep committing
chera ask why redis Grounded Q&A in the terminal
chera timeline --depth decision The story as a terminal timeline
chera learn Chaptered Markdown course about your own project
chera report Single-file Markdown report

How it works

  1. Ingest — reads git log (authors, dates, messages, file changes) and, when present, Claude Code session files (~/.claude/projects/…) that overlap your repo.
  2. Episodes — commits are clustered into work episodes by time proximity; agent sessions are attached by time overlap.
  3. Why classification — every episode gets an evidence class:
    • documented — a recorded reason exists (commit body / agent prompt), quoted verbatim
    • hypothesis — chera infers a likely reason and labels it as a guess
    • unknown — no evidence; chera admits it
    • anomaly — reverts and suspicious patterns, flagged
  4. Decisions — each episode becomes a decision node with status_now (active / partial / dead) computed against today's tree, plus supersedes edges.
  5. Serve — a stdlib HTTP server renders the story locally and keeps it fresh.

Optional: LLM narration (BYOK)

chera is fully useful offline. If you want richer narration, bring your own key — any OpenAI-compatible endpoint (OpenAI, Ollama, LM Studio, OpenRouter…):

export CHERA_LLM_BASE_URL=http://localhost:11434/v1   # e.g. Ollama
export CHERA_LLM_MODEL=llama3
export CHERA_API_KEY=...                              # if your endpoint needs one
chera scan --narrate

Narration is grounded: the model only sees stored evidence, never invents reasons, and already-narrated episodes are never re-billed (incremental scans carry narration over).

Honesty contract

  • Every claim links to commits/sessions you can check.
  • Missing evidence is reported as missing — that absence is itself information.
  • Everything runs on your machine; nothing is uploaded anywhere.

Development

git clone https://github.com/mohammadpooshesh/chera
cd chera
pip install -e ".[dev]"
pytest
ruff check src tests

See docs/architecture.md, docs/data-model.md and CONTRIBUTING.md.

License

MIT © Mohammad Pooshesh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chera-0.1.0.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chera-0.1.0-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file chera-0.1.0.tar.gz.

File metadata

  • Download URL: chera-0.1.0.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chera-0.1.0.tar.gz
Algorithm Hash digest
SHA256 050850b70d9ff8a968ad9d0edf05bd93185a031611a3616cb224355ee17bf614
MD5 3f1498e0d6b8ce5627c50b8262f20051
BLAKE2b-256 77cfbd1887bd86a9772741e952330aab7e6f00873b1f21b80c5009ada190e8fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for chera-0.1.0.tar.gz:

Publisher: publish.yml on mohammadpooshesh/chera

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chera-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chera-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chera-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 702a8f42abe53db9959c8beaccf4f96af71a0e679da8861857f1d62294538eb4
MD5 edd494881bc5860aa01751fd3e9a9066
BLAKE2b-256 dfb9fb9d15e2753ecfffd3d00b62f728fe15c997681cac0a9561e051a4faf41a

See more details on using hashes here.

Provenance

The following attestation bundles were made for chera-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mohammadpooshesh/chera

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page