Stop shipping code you don't understand.
A CLI tool that quizzes you on your staged code changes before letting you commit. Built for developers who use AI code generators and want to stay accountable for every line they ship.
Alpha Release — arivcode is in early development. Expect rough edges. Feedback and contributions are welcome!
AI coding tools like Cursor, Copilot, and Claude generate code fast — but speed without understanding is a liability. Bugs slip through when developers commit code they can't explain.
arivcode adds a simple gate: before your commit goes through, you answer a short quiz about your own changes. Pass the quiz, and the commit proceeds. Fail, and you go back to read the diff.
git add .
git commit -m "add feature"
│
├─ arivcode pre-commit hook triggers
├─ reads your staged diff
├─ sends diff to an LLM (OpenAI / Google / Anthropic)
├─ generates multiple-choice questions about YOUR changes
├─ you answer interactively in the terminal
│
├─ score >= 80% → commit goes through
└─ score < 80% → commit blocked, go read the diff
# Install globally
npm install -g arivcode
# Run the setup wizard (picks provider, API key, model)
arivcode init
# That's it — make changes, stage, and commit as usual
git add .
git commit -m "my changes"
# → quiz starts automatically if the hook was installed- Multi-provider LLM support — OpenAI, Google Gemini, and Anthropic Claude
- 3 difficulty levels — Beginner, Intermediate, Advanced
- 4 focus areas — Syntax, Execution, Architecture, Edge Cases
- Dynamic question count — 8 to 20 questions scaled to your diff size
- Per-project and global config — different settings for different repos
- Git hook integration — pre-commit hook blocks bad commits, prepare-commit-msg appends your score
- Score in commit messages — optionally badge each commit with your quiz score
- Emergency bypass —
arivcode quiz --skipwhen you absolutely must commit now
Interactive setup wizard. Asks for your LLM provider, API key, and model. Use --advanced to also configure difficulty, passing score, focus areas, and more. Use --global to save config globally instead of per-project.
Run the quiz on your current staged changes. This is what the pre-commit hook calls. Use --skip to bypass the quiz entirely.
Installs two git hooks in the current repo:
- pre-commit — runs
arivcode quizbefore each commit - prepare-commit-msg — appends quiz score to commit message (if enabled)
Removes arivcode-managed git hooks from the current repo.
Set a single config value without re-running the full init wizard.
arivcode config set passingScore 70
arivcode config set difficulty advanced --global
arivcode config set focusAreas "syntax,edge-cases"Upgrade arivcode to the latest version via npm.
Config is loaded in layers — each layer overrides the previous:
Defaults → Global config → Project config
| Key | Type | Default | Description |
|---|---|---|---|
provider |
openai | google | anthropic |
openai |
LLM provider |
apiKey |
string |
— | Your provider API key |
model |
string |
gpt-5.4-mini |
Model to use for quiz generation |
difficulty |
beginner | intermediate | advanced |
intermediate |
Quiz difficulty |
minLines |
number |
10 |
Minimum changed lines to trigger a quiz |
passingScore |
number (0–100) |
80 |
Percentage required to pass |
focusAreas |
string[] |
all four | Which question categories to include |
scoreInCommitMessage |
boolean |
false |
Prepend quiz score to commit messages |
Config file locations:
- Global:
~/.config/arivcode/config.json - Per-project:
~/.config/arivcode/projects/<project-name>.json
gpt-5.4 · gpt-5.4-mini · gpt-5.4-nano · gpt-4.1 · gpt-4.1-mini · gpt-4.1-nano · o3 · o3-mini · o4-mini
gemini-3.1-pro-preview · gemini-3-flash-preview · gemini-3.1-flash-lite · gemini-2.5-pro · gemini-2.5-flash
claude-opus-4-6 · claude-sonnet-4-6 · claude-sonnet-4-5-20250514 · claude-haiku-4-5-20251001
You can also pass any model string your provider supports via arivcode config set model <model-id>.
The number of quiz questions scales with your diff size:
| Lines Changed | Questions |
|---|---|
| 10 – 100 | 8 |
| 101 – 250 | 12 |
| 251 – 500 | 16 |
| 501+ | 20 |
- Changes below the
minLinesthreshold (default: 10) skip the quiz entirely. - You need to score at or above
passingScore(default: 80%) to pass. - Each question is multiple choice (A/B/C/D) with an explanation shown after scoring.
git clone https://github.com/asishgeorge/arivcode.git
cd arivcode
pnpm install
# Build
pnpm run build
# Run in development (no build needed)
pnpm run dev
# Run tests
pnpm run test
pnpm run test:watch
# Lint & format
pnpm run lint
pnpm run format:checkRequires Node.js 22+ and pnpm.
src/
├── commands/ CLI command handlers (quiz, init, hook, config)
├── core/ Business logic (config, git, LLM, quiz scoring, prompt building)
├── adapters/ I/O abstractions (filesystem, process runner, terminal UI)
└── types.ts Interfaces, schemas, and constants
tests/
├── unit/ Core logic tests
└── integration/ Full CLI command tests
The codebase follows clean architecture with dependency injection — all external I/O goes through interfaces defined in types.ts, making every component independently testable.
Contributions are welcome! This is an alpha release and there's plenty to improve.
- Fork the repo
- Create a feature branch (
git checkout -b my-feature) - Make your changes
- Run tests (
pnpm run test) and linting (pnpm run lint) - Open a pull request
Please open an issue first for large changes so we can discuss the approach.