Skip to main content

Knowledge coverage for your codebase

Project description

Shikhu

CI

Shikhu helps you learn your codebases that you generate with AI.

It's a command-line tool plus a companion /shikhu-study skill for your coding agent: the CLI generates quizzes from your code and tracks your understanding, and the skill tutors you through the files you want to learn.

Use shikhu to study your codebase, track your understanding, and increase your understanding of your code. Shikhu does this by learning about your files, generating quizzes for you to take, and even by helping you study the code after you make it.

Conceptual understanding is measured by knowledge coverage — the share of your codebase backed by golden questions (questions you answered correctly and confirmed actually test understanding of the file). Three goldens per file = fully covered.

Think test coverage, but for your brain!

Getting Started

Prerequisites:

  • An Inception API key (required). This gives you access to fast, text-diffusion models for question generation and summarization. You can get one for free at Inception Labs.
  • A skill-compatible coding agent like Claude Code, Codex, or Cursor (strongly recommended). The core loop — refresh, quiz, coverage — runs entirely in your terminal, but Shikhu really shines when paired with the /shikhu-study skill (step 5): it turns "I don't get this file" into a guided walkthrough and feeds your weak spots back into future quizzes.

1. Install

To use Shikhu on your own codebase — install it as a standalone tool, then run it from inside any repo:

uv tool install shikhu

This puts shikhu on your PATH in an isolated environment (no clash with your project's dependencies). cd into any repo and the commands below just work — each repo gets its own coverage.db, .quizignore, and .env. (pipx install shikhu or pip install shikhu into a virtualenv work too.)

Provide your Inception API key via a .env file in the repo you're quizzing (auto-loaded), or export it in your shell:

INCEPTION_API_KEY=your-key-here

Get a key at Inception Labs.

2. Initialize

shikhu init

This creates a database and a .quizignore file (like .gitignore but for quiz generation). Add files to the latter to avoid getting quizzed on them, like config or docfiles. It also installs the /shikhu-study skill into your agent's skills directory (pass --no-skill to skip, or run shikhu install-skill yourself later).

3. Generate questions

Next, you're ready to batch some questions. Run the following command:

shikhu refresh

Shikhu scans your tracked files, checks for stale questions, and generates new ones using the Mercury API. Files matching .quizignore patterns are skipped.

Under the hood, refresh runs two passes in parallel: summaries (a cached Mercury summary per file, used to seed question generation and to feed /shikhu-study) and questions (one batch per file). Both skip files whose content hash and prompt version haven't changed, so re-running refresh after a small edit only regenerates the files that actually changed. If you only want to refresh summaries, run shikhu summarize; tune parallelism with --summary-workers (default 8).

4. Take a quiz

After working on your code base, it's time to take a quiz!

(document any args here too)

shikhu quiz

You'll get multiple-choice questions about your code. After each answer you can rate the question quality — good questions that you answer correctly can become golden questions. These are eventually used as measures of knowledge coverage. You'll have 3 golden questions per file, and passing all of them represents basic understanding of the file.

shikhu quiz has a couple of flags worth knowing:

  • --n <int> — number of questions in the round (default 5)
  • --file <path> — quiz only on one file (handy after editing it)

What happens to old questions? When you edit a file, Shikhu detects the change (via content hash) and marks that file's questions stale on the next refresh. Stale questions stick around in the database — nothing is deleted — and refresh generates a fresh batch on top.

Golden questions get special treatment. If a file changes after you mastered it, those goldens are flagged for re-validation: they come up first in your next quiz so you can prove the change didn't break your understanding. Answer correctly and they go back to golden + fresh; answer wrong and they lose golden status (your coverage updates accordingly).

5. Drill weak spots with /shikhu-study (optional)

When a quiz surfaces a file you don't really understand, use the /shikhu-study skill (installed by shikhu init, inside your agent) to walk through it. The skill loads a cached summary, takes you through the file, and logs every conceptual question you ask to the database.

Then turn those questions into quiz questions that test the same concepts:

shikhu generate-from-study path/to/file.py
shikhu quiz --file path/to/file.py

This reinforces exactly the gaps you surfaced during study — not generic file-level questions.

6. Check your coverage

Wanna know how well you know your codebase? Run this commmand

shikhu coverage

Shows which files you've mastered and which need work. Each file needs 3 golden questions to be fully covered.

All Commands

Command What it does
shikhu init Set up database, check API keys, create .quizignore, install the /shikhu-study skill
shikhu install-skill Install the /shikhu-study agent skill (use --global for all projects)
shikhu quiz Take a quiz (default 5 questions)
shikhu quiz --n 10 Quiz with 10 questions
shikhu quiz --file path.py Quiz on a single file
shikhu refresh Staleness check + regenerate stale questions and summaries
shikhu summarize Parallel Mercury summaries for every tracked file
shikhu summarize --file path.py Force-regenerate summary for one file
shikhu generate-from-study path.py Generate quiz Qs seeded by your prior /shikhu-study questions for that file
shikhu coverage Print knowledge-coverage report
shikhu clean Delete the database (asks for confirmation)
shikhu clean --yes Delete without confirmation

How It Works

  1. Question generation — Mercury (Inception Labs) reads your source files and generates conceptual multiple-choice questions about design decisions, architecture, and how things work.

  2. Quizzing — Answer questions in the terminal. Rate question quality. Correct answers on good questions become golden — validated proof you understand that file.

  3. Coverage tracking — Each file targets 3 golden questions. Coverage = how many files have reached that bar.

  4. Staleness — When code changes (detected via SHA-256 hashing), related questions are marked stale so your coverage stays honest.

  5. Study-driven generation/shikhu-study captures the conceptual questions you actually ask while learning a file. shikhu generate-from-study turns those into quiz questions, so the next quiz tests the gaps you surfaced — not just whatever Mercury picks from the file.

Golden Questions

A golden question is one you:

  • Answered correctly
  • Rated as good quality
  • Confirmed it tests real understanding of the file

3 golden questions per file = fully covered. Golden questions go stale when the underlying code changes, keeping coverage honest over time.

Privacy & Data

Everything Shikhu knows lives in one local SQLite file, coverage.db, in the repo you run it from. Nothing is uploaded anywhere. Two things are worth knowing:

  • File contents are sent to the Mercury API (Inception Labs) to generate questions and summaries — that's the only data that leaves your machine, under your own API key. Use .quizignore to exclude anything you don't want sent.
  • Shikhu reads your local Claude Code transcripts for the current project (~/.claude/projects/...) to find conceptual questions you've asked, and stores them in coverage.db to seed better quiz questions. These prompts never leave your machine — but it's one more reason coverage.db must stay out of git. shikhu init adds it to your .gitignore automatically.

Configuration

.quizignore

Controls which files are skipped during generation:

# Skip these
*.lock
.claude/
tests/
deprecated/

Environment Variables

Variable Required Purpose
INCEPTION_API_KEY Yes Mercury API for question generation

Tech

  • Python 3.12+, managed with uv
  • Mercury for question generation
  • Typer + Rich for the CLI
  • SQLite for local storage
  • SHA-256 file hashing for staleness detection

Love the repo and have some ideas?

Feel free to open an issue! We aren't accepting PRs at this time.

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

shikhu-0.1.2.tar.gz (171.7 kB view details)

Uploaded Source

Built Distribution

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

shikhu-0.1.2-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file shikhu-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for shikhu-0.1.2.tar.gz
Algorithm Hash digest
SHA256 70d4f60f0d7a5f888cef07952d579d9133b658b3eea43c7500c8b1082b464c05
MD5 ce05d352d5fee9b9dee3aac267da28cb
BLAKE2b-256 296f34640a8e9ae38e617c95f37fd723fc99e4e1f17722fc5e939dc66c23b0d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for shikhu-0.1.2.tar.gz:

Publisher: release.yml on arjunpatel7/shikhu

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

File details

Details for the file shikhu-0.1.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for shikhu-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 30664e953925d64b3021b2721d0e3634d368880f5fab1f0a4d0bc92fb95c1218
MD5 a2a4a907ace94ca551cf7dfcc65177ce
BLAKE2b-256 b1adc833f0fbe2e9ead7c2778961ef36f1f6f7dba839c9aa732b12ceca3929d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for shikhu-0.1.2-py3-none-any.whl:

Publisher: release.yml on arjunpatel7/shikhu

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