learnlance 🧠🔍
A learning companion for Claude Code. Every time Claude finishes a turn and has generated or edited code, learnlance quietly:
- reads the session transcript and pulls out the code that was just written,
- asks Claude "what concepts could a developer learn from this?" — e.g. "you used a delta function, here's what delta encoding is",
- merges those concepts into a persistent knowledge graph, and
- regenerates an interactive HTML graph you can open any time.
No API key required. By default it reuses the claude CLI you're already
logged into (your Claude Code subscription), so there's nothing extra to set up.
So instead of code just appearing, you build up a visual map of everything you've picked up along the way — new nodes light up as 🌱 new topics learned.
Why it won't slow you down or break your session
- The API call runs in a detached background process — Claude Code never waits.
- The hook is wrapped so any failure is logged and swallowed; it can never interrupt your coding session.
- Turns with no substantive code make no API call (no cost, no noise).
Install (no pip, no API key)
# just install the Claude Code Stop hook — it uses your logged-in `claude`
python -m learnlance install
Run this from the learnlance/ project folder. That's it — start (or restart)
Claude Code and code as usual.
If claude isn't on your PATH, point learnlance at it:
python -m learnlance config --claude-bin "C:\path\to\claude.cmd"
Prefer a global
learnlancecommand?pip install -e .in this folder, then uselearnlanceinstead ofpython -m learnlanceeverywhere.Prefer a direct API call instead of the CLI?
learnlance config --backend api --set-key sk-ant-...
Use it
learnlance show # render + open the interactive knowledge graph in your browser
learnlance list -v # list learned concepts (with explanations) in the terminal
learnlance stats # quick counts, broken down by category
Per-session markdown recaps are written to ~/.learnlance/insights/<session>.md.
Configuration
learnlance config # show current settings
learnlance config --cli-model haiku # make the cli backend use a faster model
learnlance config --max-topics 3 # fewer concepts per turn
learnlance config --background off # run inline (blocks until analysis is done)
learnlance config --disable # pause without uninstalling the hook
learnlance config --backend api --set-key sk-ant-... # switch to the API backend
Everything lives under ~/.learnlance/:
graph.json (the graph), graph.html (the visualization), insights/
(markdown recaps), learnlance.log (diagnostics).
Uninstall
python -m learnlance uninstall
How it works (internals)
| File | Role |
|---|---|
hook.py |
Stop-hook entry; spawns the detached worker |
transcript.py |
Parses Claude Code's JSONL transcript for generated code |
insights.py |
Generates insights — via the claude CLI (default) or the API |
graph.py |
Merges concepts into the persistent knowledge graph |
viz.py |
Renders the offline, self-contained HTML graph |
install.py |
Wires the hook into ~/.claude/settings.json |
Zero third-party dependencies by design — the hook must run reliably wherever Claude Code launches it.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file learnlance-0.1.0.tar.gz.
File metadata
- Download URL: learnlance-0.1.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be6ebfd0e185e610e6e7f84a71d6761caf28136b894d738c7928f5e971645e8a
|
|
| MD5 |
22424acfc533459aee3964435a855fed
|
|
| BLAKE2b-256 |
e8d403256ab8a9ddfb4ba183dbc50df7cfdb2a13ea41d8d6c78ee06931de34c6
|
File details
Details for the file learnlance-0.1.0-py3-none-any.whl.
File metadata
- Download URL: learnlance-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c0699e2c153a1adf8f4e9a58e157fac6c2c0995a5686a2a78937262a3fd25f5
|
|
| MD5 |
71765d0d0c11685279c27eec3e1e3d3f
|
|
| BLAKE2b-256 |
079547357885998313f72366a121ccb0c53cb916446029d7f7273b12235fff1e
|