Local-first · macOS, Linux and Windows · a command-line tool today, VS Code next
~/keepjay-demo
demo $ kj source add . && kj scan
keepjay-demo: 4 cards in 3 files (4 new), 5 ms
Wrote 4 card ids into your files.
demo $ kj while -- cargo test
test result: ok. 5 passed; 0 failed; finished in 13.13s
`cargo test` exited with code 0 after 00:19 · reviewed 2 cards.
demo $ kj scan && kj stale
1 card is now stale: the code changed. stale
xsgfegt8 src/backoff.rs:33 Why does `delay` wait a random time up to the cap…
A terminal: scanning a repository finds 4 cards; reviewing two of them while cargo test runs; then changing the code under a card makes Keepjay flag it as stale.
You learned it once. Then it faded.
You worked out why that lock deadlocked, how the deploy really works, why
asyncio.gather doesn't cancel the other tasks. Three months later you're
looking it up again.
Notes don't help much, because you never re-read them. Flashcard apps would, but your
knowledge lives in code, and cards in another app drift away from the code they
describe.
How it works
Write the card where you learned it.
1
Add a @card comment next to the code.
The question goes on the @card line, the answer on the comment lines below. Or keep cards in Markdown files in your repo. Over 30 languages, from Rust and Python to SQL and LaTeX.
src/backoff.rs
32// @card Why does `delay` wait a random time up to the cap?33// So clients that failed together don't retry together:34// "full jitter" spreads the retries out.35pub fndelay(&self, attempt: u32) -> Duration {
36let cap = self.base * self.factor.pow(attempt);
37Duration::from_millis(rng.random_range(0..=cap))
38 }
2
Scan your repo.
Keepjay finds your cards, writes a short id into each so it keeps its history when you move it, and schedules them with FSRS, the modern spaced-repetition algorithm also used by Anki.
terminal
$ kj source add .
$ kj scan
keepjay-demo: 4 cards in 3 files (4 new), 5 ms
Wrote 4 card ids into your files.
// @card(3q42eycb) Why does `delay` wait…
3
Review in the gaps.
A few cards while your tests run, then back to work with the test output and its exit code. Or kj review --quick for a two-minute review, and kj status in your prompt.
kj while -- cargo testrunning 00:07
keepjay-demo
Why does delay wait a random time up to the cap?
So clients that failed together don't retry together: "full jitter" spreads the retries out.
1 Again 1m2 Hard 14h3 Good 5d4 Easy 1.8mo
4
Never study out-of-date answers.
Each card is anchored to the code under it. When that code changes, the next scan flags the card as stale. Keep it, edit it, or retire it with kj stale retire, which keeps its review history.
src/backoff.rs
// @card(3q42eycb) Why does `delay` wait…pub fndelay(&self, attempt: u32) -> Duration {
- let cap = self.base * self.factor.pow(attempt);+ let cap = self.base * self.factor.pow(attempt + 1);$ kj scan
1 card is now stale: the code changed. stale
Try it
Review three cards, right here.
Read the question, try to recall the answer, then reveal it and grade yourself. This is a review in Keepjay.
rust.cards.md
Why doesn't this compile?
let s = String::from("hi");
let t = s;
println!("{s}");
rust.cards.md
String isn't Copy, so let t = smoves it and s can't be used afterwards. Clone it (s.clone()) or borrow it (let t = &s).
Why it's different
Built for code, not copied from a flashcard app.
Your cards are plain text in Git.
Review them in pull requests, share them with your team, keep them forever.
+ // @card What does Arc::clone copy?+ // Only the pointer; the count goes up.let shared = Arc::clone(&config);
Cards know where they came from.
Each one is anchored to the code it explains, so it can tell when that code changes.
@cardfn delay()
It fits the gaps you already have.
Build waits, test runs, the minute before standup.
cargo test2 cards reviewed
It's fast.
Re-scanning a 10,000-file repo takes under half a second.
0.3 s · 10,000 files
Code looks like code.
Code on cards is syntax-coloured in your terminal's own theme.
Keepjay runs locally and works with no account. It makes no network calls unless you
opt in to an anonymous weekly usage ping, which sends no content, paths or names.
Every field is documented.
Everything local is free forever. The code is open source under the AGPL.
Coming next
VS Code extension See your cards in the gutter and review from the status bar.
Interview mode Your LeetCode solutions repo becomes a review plan, ready by interview day.
Ready by a date Set your exam or interview date and arrive with it fresh.
Review on your phone With Pro, your reviews sync to a phone app.
AI drafting Your coding agent suggests cards from today's session; approve them in one keystroke.
Or with a
one-time supporter licence. No features, just thanks.
Questions
Is it really free?
Yes. Everything that runs on your own machines is free forever. Pro will charge only for things we host for you: sync, backups and AI drafting.
How is this different from Anki?
Anki is a great flashcard app, and Keepjay uses the same scheduling algorithm. The difference is that Keepjay's cards live in your code and your Git history, and it notices when the code they describe changes. You can import your Anki decks.
Does it change my files?
Only to write a short id into each card's comment on the first scan, so the card keeps its history when you move it. You can turn that off per repo. stale retire removes a card's lines only after you confirm.
Which languages?
Over 30 with line comments, including Rust, Python, TypeScript, JavaScript, Go, Java, C, C++, C#, Kotlin, Swift, Ruby, shell, SQL, Haskell, Lua and Clojure, plus Markdown card files. Block comments (/* … */) come later.
Which editors?
Any, today: it's a command-line tool. A VS Code extension is next.
Is it stable?
It's an alpha. The core features work and are tested on macOS, Linux and Windows, but expect rough edges, and back up anything precious.
Why "Keepjay"?
Food-caching jays remember what they hid, where and when. Keepjay keeps what you learned, where it lives in your code, and notices when it changes.