Skip to content

About

Learn programming concepts through Socratic questioning - a slash command for Claude Code and OpenCode

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Socratic Quiz

An interactive learning game for your terminal. Learn programming concepts through Socratic questioning while waiting for your builds to finish.

What is this?

Socratic Quiz is a slash command for Claude Code and OpenCode that teaches you programming and computer science concepts through guided questions - not lectures.

Instead of explaining what "idempotency" means, it asks you questions that help you discover and understand the concept yourself.

Features

  • Socratic method - Learn through discovery, not memorization
  • Concept chaining - Each topic builds on what you've already learned. Learned idempotency? Next session might cover retry strategies, referencing what you know: "Remember idempotency? That's why this matters..."
  • 7 categories - CS fundamentals, design patterns, databases, networking, security, JS/TS, system design
  • Progress tracking - Streaks, stats, and session history
  • Enthusiasm detection - Digs deeper into topics you're excited about
  • Interrupt recovery - Resume where you left off if you quit mid-session

Installation

git clone https://github.com/briankeefe/socratic-quiz.git
cd socratic-quiz
./install.sh

The install script automatically detects whether you have Claude Code and/or OpenCode installed and sets everything up.

Manual Installation

If you prefer to install manually:

Claude Code:

mkdir -p ~/.claude/commands ~/.config/socratic-quiz
cp SocraticQuiz.md ~/.claude/commands/
cp validate.py ~/.config/socratic-quiz/

OpenCode:

mkdir -p ~/.config/opencode/commands ~/.config/socratic-quiz
cp SocraticQuiz.md ~/.config/opencode/commands/
cp validate.py ~/.config/socratic-quiz/

Usage

Start a session:

/SocraticQuiz

That's it! Answer the questions and learn.

Configuration

State Location

By default, your progress is saved to:

~/.config/socratic-quiz/state.json

Override with an environment variable:

export SOCRATIC_QUIZ_STATE_DIR=/path/to/your/dir

Session Example

> /SocraticQuiz

Welcome to Socratic Quiz! I'll teach you programming concepts through 
interactive questions. Your progress is saved at ~/.config/socratic-quiz/state.json

Let's talk about something fundamental in distributed systems.

What would happen if you ran this code twice?

    user.status = "active";

Would the result be different the second time?

> no, it stays active

Exactly! Setting a value to the same thing twice doesn't change anything 
after the first time.

Now try this one:

    user.loginCount = user.loginCount + 1;

Is this the same? Would running it twice give you the same result?

> no, it would increment twice

Correct! The count increases each time: 1 → 2 → 3...

So we have two types of operations here. The first one - where running it 
multiple times gives the same result as running it once - has a name. 
Any idea what it might be called?

...

How It Works

  1. Topic Selection - Picks a topic based on what you've learned, category balance, and detected interests
  2. Question Flow - 4-6 questions over ~5 minutes, building from simple to complex
  3. Wrong Answers - Gives hints first, then explains if needed
  4. Session End - Shows score, updates streak, offers to continue
  5. State Persistence - Saves everything for continuity between sessions

Files

File Purpose
SocraticQuiz.md The slash command prompt
validate.py State validation/repair script (runs after each session)
schema.json JSON Schema reference for the state file
install.sh Auto-detects Claude Code/OpenCode and installs

State Schema

See schema.json for the full schema. Key sections:

  • summary - Aggregate stats, streak, category weights
  • concepts - Every concept learned with scores and relationships
  • sessions - Full history of all sessions with Q&A logs
  • interrupted - Resume data if you quit mid-session

Contributing

Ideas for new categories, topics, or improvements? Open an issue or PR!

License

MIT

About

Learn programming concepts through Socratic questioning - a slash command for Claude Code and OpenCode

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages