danieldeusing

cat ~/articles/capi-claude-code-mod.mdx

Capi: a capybara that teaches me Portuguese while Claude works

I spend a good part of my workday waiting for Claude Code. So I wrote a mod that fills the wait with a quiz card: one true fact and one expression in the language I'm learning. It's open source, and it works for other languages too.

~3 min read #ai #claude-code #languages

I’ve lived in Brazil for about four years now. My Portuguese gets by in everyday life. The grammar is another story. It has holes, and I keep falling into the same ones.

I also spend a lot of my workday waiting for Claude. I’ve used Claude Code since the beta in early 2025, and sent the team a fair amount of feedback and GitHub issues along the way. I’m really happy with where it’s heading. But while it works, I mostly sit there and watch it think.

Then Anthropic added mods to Claude Code: small pieces of code that change how it works or looks. I knew right away what mine would do.

Meet Capi

Capi is a capybara. It lives in the band above the prompt and shows me a quiz card. Every card teaches me two things at once: one true fact about the real world, and one expression in the language I’m learning.

Here’s one from the video:

“Saca só: a parte suculenta do caju é o fruto de verdade, e a castanha é só a semente.”

(“Check this out: the juicy part of the cashew is the real fruit, and the nut is just the seed.”)

True or false? False. The juicy part, the cashew apple, is a pseudofruit. The real fruit is the cashew nut hanging underneath it (source: Embrapa). And on the way I picked up “saca só”, which is how you say “check this out” before telling someone something surprising.

Capi in 38 seconds: the band above the prompt, the caju card, and what each key does.

Keys, because my hands are on the keyboard anyway

  • 1–4 answer
  • 6 📐 grammar notes on that very sentence
  • 7 🔤 conjugation tables for every verb in it
  • 0 the card in my own language
  • 8 hear it
  • 9 flag a wrong fact. That card is never used again, and the fact gets checked again.

Clicking – folds the band, × hides it for the session, and /capi shows my progress.

The grammar notes are about the sentence that’s on the screen, not a chapter from a textbook. That’s the kind of help my particular holes need.

A Capi card with the caju sentence and, below it, five grammar notes in German: saca só as a colloquial imperative, do caju as de plus o, the adjective after the noun, é from ser and not estar, and só meaning only
Key 6: grammar notes on the sentence I’m looking at, explained in my own language.
The answered caju card: correct, the juicy part is a pseudofruit, source Embrapa. Below it a conjugation table for sacar in presente, pretérito perfeito and futuro, with ser as a second verb, and a note explaining saca só
Key 7: a conjugation table for every verb in the sentence. Here sacar, with ser listed right next to it.

It remembers

Capi uses Leitner boxes. A card I get right comes back after 1 day, then 3, 7, 30 and 90. A card I miss comes back after 20 minutes, in a different format. There’s a daily cap on new expressions (25 by default), so a long working day doesn’t bury me. And my history syncs between my Macs through iCloud.

A grammar card answered wrong: after embora always comes the subjunctive, so the answer was fosse. The fact: Brazil was the last country in the Americas to abolish slavery, on 13 May 1888, source Britannica
Missed: after “embora” comes the subjunctive. This card is back in 20 minutes.

Who writes the cards

Claude does. Every card is written by Claude (claude-opus-5-5) on my own plan. Only answering pulls new cards, so leaving the band on screen all day costs nothing.

Not only Portuguese

A .env file sets the language to learn, my own language, my level, the topics, which persons and tenses the conjugation tables show, whether the band shows all the time or only while Claude works (CAPI_SHOW), and the daily cap (CAPI_NEW_PER_DAY). So it works just as well for someone in São Paulo learning German.

Try it

Capi is open source, MIT licensed: github.com/danieldeusing/capi-cc-mod. You need Claude Code 2.1.287 or newer, with mods turned on.

Install it from seedr, my registry:

npx @danieldeusing/seedr add capi --type plugin --agents claude

Or straight from GitHub:

claude plugin marketplace add danieldeusing/capi-cc-mod
claude plugin install capi@capi

Claude still takes its time. Now I get a capybara and a grammar lesson out of it.