hibi
0.1experimental · see where it's at →

hibi

better every day

A programming tutor that runs in your terminal. It reads the project you're working on and helps you learn to write the code yourself.

the hibi fox lying on the terminal
hibi 日々 ~/code/pipeline
Hi, Ana. What do you want to learn today?
Write however you like, ask for an exercise, or type /help.
❯ give me an exercise on channels
Write a function Fanout in internal/pipeline/fanout.go. It takes one input channel and returns three output channels, sending each value it receives to exactly one of them. When the input closes, all three outputs should close too.
There's already a test for it in fanout_test.go.
❯ I think I'm done
Before I run the tests: the test starts three consumers and then closes the input. What do you expect to happen to the three output channels?
❯ they all close
Two of them closed and one didn't:
│ --- FAIL: TestFanoutClosesOutputs
│ fanout_test.go:42: output channel 2 was never closed
You expected all three to close. Where in your code does each output channel get closed?
❯ no idea, can I get a hint?
hint 1 of 3
Look at the end of Fanout, right after the loop over the input finishes. The idea involved is who is responsible for closing a channel.
❯

Hints in steps.

When you're stuck, hibi first points to where the problem is. If you're still stuck, it tells you what the problem is. The fix comes last.

Checks by running.

Say you're done and hibi runs your project's tests. A passing test counts for a lot more than the model's opinion of your code.

Remembers you.

What you learn in one project carries over to the next, and all of it stays on your computer.

02 · why

Why hibi exists

Ask an AI assistant for help with code and you'll get working code. At work, that's exactly what you want. When you're learning, it gets in the way. You read the answer, it makes sense, you paste it in, and a week later you can't write it on your own. You also can't tell which parts you understood, and neither can the assistant, because it never asked.

hibi is built for learning. It holds the solution back on purpose and gives you more help as you keep trying. It checks your work by running it. And it keeps track of what you've shown you can do, so after a few weeks it knows where you're solid, where you're guessing, and what you haven't practised in a while.

03 · install

Install

hibi is published on npm, so once you have Bun it takes one command.

What you need

runtime

Bun 1.2 or newer. It's the program that runs hibi.

model

An API key from OpenAI or Anthropic. hibi uses one of their AI models, and the key works like a password that lets hibi use it on your account. You create it on their site and they bill you directly, usually a few cents per question.

optional

git. Without it, hibi can't tell the code you wrote from code that came with a template.

With Bun

bash
bun install -g @hwgo1/hibi

From source

If you want to read or change the code, install from the repository instead:

bash
git clone https://github.com/hwgo1/hibi
cd hibi
bun install
cd packages/cli && bun link && cd ../..
bun link @hwgo1/hibi

First run

Open a folder with your code and run hibi. The first time, it asks you three things:

$ hibi
hibi 日々
Hi! I'm hibi, a programming tutor.
I help you actually learn: I explain, suggest exercises and give hints,
without handing over the answer. Before we start, I need a few things.
1/3 Language
I'll speak American English. Press Enter to confirm, or type another (pt, es):
2/3 Name
What should I call you? (Enter to skip) Ana
3/3 Access key
hibi runs on another company's artificial intelligence, which charges per use —
usually a few cents per question. You create a key on their site and paste it
here; the cost goes straight to your account.
Which company do you want to use?
1 OpenAI
2 Anthropic
Choose [1]: 1
Create your key at: https://platform.openai.com/api-keys
Paste the key here: ••••••••3f9a
Testing the key… it works!
It's stored only on your computer.
All set.

Language comes first, so everything after it is already in your language. hibi tests the key before saving it and hides it on screen once you paste it. It also picks a recommended model for you, which you can change later with /model.

04 · first five minutes

Your first five minutes

  1. 1
    Open a project.

    cd into a folder with your code and run hibi. The first time, it reads the project to find out the language, how the tests run, and which files you wrote.

  2. 2
    Say what you want to learn.

    “I want to learn Go” and “what is a variable?” both work. If you mention a goal, hibi saves it and picks up from there next time.

  3. 3
    Ask for an exercise.

    hibi writes the task and tells you which file to work in.

  4. 4
    Try it, then say you're done.

    hibi runs your tests. If you get stuck, ask for a hint and watch it go from “look here” to “this is the problem”.

  5. 5
    Type /help.

    You'll see examples of what to ask, plus the two commands you'll use most.

05 · documentation

Documentation

5.1 · docs

Commands

Most of the time you talk to hibi in plain words. Commands are for when you want to look at what it has recorded or change a setting. /help all lists them in these same groups.

Your progress
/profile
What hibi has recorded about you: preferences, goal, and how solid each topic is
/state
What's open right now: the current exercise, how many hints you've had, questions waiting for an answer
/signals
What hibi has noticed about how you learn, and how sure it is about each thing
Conversation
/undo
Takes back the last answer and removes it from your record
/clear
Clears the conversation. Your exercise, hints and progress stay
/forget <topic>
Removes everything recorded about one topic
Settings
/prefs
Shows how hibi teaches you. /prefs <name> <value> changes a setting
/model
Lists the available models. /model <name> switches
/provider
Switches between OpenAI and Anthropic, if you've saved a key for both
/reset
Removes your saved key, so hibi asks for it again next time
Other
/help
Examples of what to ask. /help all lists every command
/index
Re-reads your project's files after big changes
/cost
How much this conversation has cost so far
/stop
Shuts down hibi's background process
/exit
Leaves hibi

Command names stay in English whatever language you pick, since you're the one typing them. Their descriptions in /help follow your language.

5.2 · docs

Hints

When you're stuck on an exercise, help comes in three steps. hibi shows which one you're on above its answer, as “hint 1 of 3”.

  1. step 1

    Points to the part of your code where the problem is and names the idea involved. It doesn't say what's wrong.

  2. step 2

    Names the problem and shows exactly where it is. It doesn't write the fix.

  3. step 3

    Shows the fix, explains why it works, and gives you a similar problem in a different setting to solve on your own.

The first hint

It comes after your first try, or after about three minutes on the problem. A hint before any attempt tends not to stick.

Going up a step

After two more tries, or about eight minutes without progress. On the same problem, the step never goes back down.

Starting at step 2

If you ask about code you already wrote, hibi can skip step 1. You've already found the spot, so pointing at it would waste your time.

Asking for the answer

Ask for it directly and you'll get it. That exercise then counts for less in your record, and hibi notes that you asked.

The model doesn't choose how much to reveal.

The hint tool has no “depth” setting, and none of hibi's tools can write an exercise's solution. How far a hint goes is decided by code, from your attempts and the time you've spent.

5.3 · docs

Checking your work

When you say you're done, hibi runs your project's own test command. Which one depends on the project:

go test ./...npm testcargo testpytest

It finds the command when it first reads your project and never takes it from the conversation, so nothing written in a file can change what runs.

Missing tools don't count against you.

If the tests fail because something is missing on your computer, like a compiler that isn't installed, hibi tells you and helps you fix it. That doesn't count as a failed attempt.

No tests?

Then hibi reads your code and judges it. That judgment counts for about a third of a real test in your record.

5.4 · docs

Questions before answers

Sometimes hibi asks you something before it explains or runs anything. There are three kinds of question, and each one comes at a natural pause.

Before a new topic

It checks what you already know. If you use promises in JavaScript, it might ask whether you're comfortable with them and then explain Go's select by comparison. Or it asks something like “if two programs add to the same counter at once, what happens?” and starts from your answer.

Before running your tests

It asks what you expect your code to do in this exercise. When the result proves you wrong, that's the best moment to fix how you picture it.

After an exercise

It asks you to say in one line what the problem came down to. A summary that's almost right shows a gap the passing test hides.

You can skip any question by carrying on with what you were doing. hibi asks at most once every four exchanges and six times per session, and if you skip two in a row it stops asking for the rest of the session. To turn questions off, use /prefs unsolicitedHints never.

5.5 · docs

Quizzes

Running code doesn't show everything. Knowing when to use a lock is different from being able to write one, so hibi also asks multiple-choice questions.

Three possible outcomes

Right, wrong, or “I don't know”. Saying you don't know gets recorded as something to learn next and never counts as a mistake. A lucky guess would make your record less accurate.

rightwrongI don't know
Wrong options you'd actually pick

The wrong options are mistakes a learner could really make, and each one is tied to the misunderstanding behind it. When you pick one, hibi talks about that misunderstanding instead of only giving you the right answer.

No peeking

The correct answer doesn't appear on screen until you've answered. hibi checks your answer in code, so the model can't be talked into marking it right.

5.6 · docs

Goals

Tell hibi what you're working toward: learning a language, getting ready for interviews, building a project. It saves that and brings it up when you come back (“Last time you were working on: learning Go”).

When you ask what to do next, hibi suggests two or three topics from your record:

  • ones you've never covered
  • ones you've tried but aren't solid on yet
  • ones you said you know but never showed
  • ones you haven't touched in about three weeks

It works these out fresh every session. There's no fixed syllabus, because a saved plan would be out of date the moment you learned something.

If you already know something it suggests, say so. hibi takes your word for it and moves on without testing you.

5.7 · docs

What hibi knows about you

hibi keeps two kinds of records.

The logevidence.jsonl

Everything that happened, one entry at a time. Entries are never edited or deleted, only added.

on September 12, goroutines, tests ran, passed, after one hint
The estimateprofile.json

How well hibi thinks you know each topic. It's calculated from the log, so when the formula improves, your whole history gets recalculated with it.

0.62 on goroutines, with confidence 0.40

Where each piece of evidence comes from

A passing test is a fact. A right answer on a quiz is an observation. The model deciding your code looks right is an opinion. Each entry in the log says which one it is, and that decides how much it counts.

SourceWeightExample
Test run1.0Your tests ran and passed or failed
Quiz answer0.8You answered a multiple-choice question
Behaviour0.5Something hibi observed in your project
Model's judgment0.35The model read your code and thought it was right
Your own word0.15You said you know it
hibi's own actions0hibi explained something or gave a hint

On top of that, solving something on your own counts in full, and solving it after seeing the fix counts about a third. Asking for the answer outright halves that again.

On your ownfull
After seeing the fix≈ ⅓
Asked for the answer≈ ⅙

Confidence

Every estimate comes with how much hibi trusts it. A low score with low confidence means hibi doesn't know much about you on that topic yet. hibi never shows a score without its confidence.

❯ /profile
mastery
goroutines: 0.62 (confidence 0.40, 3 direct)

What hibi has noticed

Once there's enough evidence, hibi starts to notice patterns in how you learn. /signals lists them, with how sure it is about each:

❯ /signals
observed tendencies
self-assessment = tends to overestimate (55%, 12 events)
hint-depth = usually unblocks at the first hint (50%, 10 events)
these are guesses — declare the opposite with /prefs to override one

The first line compares what this learner predicted before running the tests with what happened: they usually expected to pass before they actually did.

These are guesses, and they only show up after at least eight related events. Anything you set in /prefs always wins over something hibi guessed.

Topics

Topics form a tree that grows as you learn. “linked list”, “linked lists” and “lista encadeada” all count as the same topic.

linked listlinked listslista encadeadaone topic

Progress on a specific topic also counts, a bit less, toward the broader ones above it. Solving something about goroutines adds a little to concurrency too.

5.8 · docs

Disagreeing with a number

If hibi says your score on pointers is 0.2 and you think that's wrong, tell it. The number won't change because you asked. hibi offers a quiz or an exercise on pointers instead, and the result moves the score.

Disagreeing costs nothing and never lowers a score by itself. If you dispute the same topic again, the next result counts a little less. hibi still accepts the dispute and offers another quiz.

5.9 · docs

Undo and forget

/undo

Takes back the last exchange. Whatever it recorded about you stops counting. The conversation itself stays on screen.

/forget <topic>

Does the same for everything recorded about one topic.

Both work by adding a note to the log that cancels the earlier entries, so your history stays complete and can still be recalculated.

/forget all forget

This one is the exception. It deletes your whole learning history for good. Typing the word twice is the confirmation.

5.10 · docs

Settings

Change these with /prefs <name> <value>.

SettingValuesDefault
name
any text
what you gave at first run
language
a language code like pt-BR
detected from your computer
theoryDepth
minimal, balanced, thorough
balanced
exerciseSize
small, medium, large
medium
unsolicitedHints
never, when-stuck, proactive
when-stuck
explanationStyle
concise, detailed
concise

There's no setting for how much hibi holds back. You can change how it teaches, but the step-by-step hints always apply.

5.11 · docs

Where your data lives

Everything stays on your computer, in a folder called .hibi in your home directory:

~/.hibi/
credentials.json your API key, readable only by you
profile.json your preferences, goal and scores
concepts.json your topic tree
evidence.jsonl the log of everything that happened
repos/<id>/
repo.json what hibi learned about that project
session.json the current exercise, hints and questions

Your scores, topics and log are shared across projects. The session and project details belong to each project.

The only thing that leaves your computer is the conversation with the AI company you picked, sent with your own key.

To start over completely, delete the folder:

bash
rm -rf ~/.hibi
06 · how it's built

How it's built

hibi clithe terminal, a thin client
socket
editor panelplanned
socket
background processone per project · holds the session
corethe tutor · no disk, no network
~/.hibi/session, topics, log
AI provideryour key · the only outside connection

hibi has no AI model of its own. It runs the conversation around the model you choose: the teaching rules, the tools the model is allowed to call, and the record of your progress.

Each project gets a small background process that holds the session. The terminal interface is a thin client that talks to it over a local socket, so a future editor panel could join the same session.

hibi doesn't rely on the conversation text to keep track of things. The current exercise, the hint step and your history are saved to disk and rebuilt for every message. You can clear the conversation in the middle of an exercise and hibi still knows where you were.

The code is TypeScript on Bun, split into three packages. core is the tutor and has no disk or network access of its own; everything goes through small interfaces. daemon is the background process. cli is the terminal interface.

07 · status

Where the project is

hibi is at 0.1 and still experimental. Everything on this page works, and its author uses it every day.

not yet0.1 · experimental
Other interfacesThe terminal is the only one so far. The background process is ready for an editor panel, but there isn't one yet.
Plain-language outputWhat /profile, /state and /signals print is still in English and fairly technical.

The numbers that decide when a hint goes up a step (two attempts, eight minutes, three minutes before the first hint) and how often hibi asks questions are first guesses. Nobody besides the author has tested them yet. If hibi helps you too early or too late, open an issue and say which exercise it was.