learnlance 🧠🔍
Turn what AI coding agents build into a growing personal knowledge graph.
learnlance watches your agent — Claude Code, OpenAI Codex, Cursor, GitHub
Copilot (CLI / cloud / VS Code), Command Code, Kiro, Gemini CLI, Antigravity,
or plain git commit — and after every turn that writes or edits code, it
quietly:
- pulls out the code the agent just wrote,
- asks an LLM "what transferable 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.
Over time you get a browsable map of everything you've picked up while coding — new nodes light up as 🌱 new topics learned.
No API key required. By default it reuses an LLM CLI you're already logged
into (claude, gemini, copilot, cursor-agent, or ollama). Or use
--in-chat and the agent analyzes its own work — no separate CLI at all.
Why it won't slow you down or break your session
- Analysis runs in a detached background process — your session never waits.
- Every hook is wrapped so a failure is logged and swallowed; it can't interrupt your coding session.
- Turns with no substantive code make no LLM call (no cost, no noise).
Install
pip install learnlance-univ
learnlance setup
setup detects the agents you have and writes their hooks for the current
project. Run it again in each project you want tracked, then reload your editor
and code as usual.
Prefer the agent to analyze its own work in your chat, instead of a separate CLI?
learnlance setup --in-chat
Check what's actually installed and firing:
learnlance doctor
Install one agent by hand
learnlance install with no flags targets Claude Code; a flag targets the rest.
learnlance install # Claude Code (Stop hook)
learnlance install --cursor # Cursor
learnlance install --codex # OpenAI Codex
learnlance install --copilot # Copilot CLI / cloud / VS Code Chat
learnlance install --commandcode # Command Code
learnlance install --kiro # Kiro
learnlance install --gemini # Gemini CLI
learnlance install --antigravity # Antigravity
learnlance install --git # git post-commit (universal fallback)
Supported agents
| Agent | Captures on | Analyzes on |
|---|---|---|
| Claude Code | (whole transcript) | Stop |
| OpenAI Codex | PostToolUse |
Stop |
| Cursor | afterFileEdit |
stop |
| GitHub Copilot — CLI, cloud, VS Code | PostToolUse |
Stop |
| Command Code | PostToolUse |
Stop |
| Kiro | PostToolUse |
Stop |
| Gemini CLI | AfterTool |
AfterAgent |
| Antigravity | PostToolUse |
Stop |
| git | — | post-commit |
Each integration is written from the vendor's hook docs. learnlance doctor
reports what's configured on disk versus what has actually fired.
Use it
learnlance show # render + open the knowledge graph in your browser
learnlance list -v # list learned concepts, with explanations
learnlance stats # quick counts by category
learnlance help # every available command
The show view opens with a live loading spinner, then two declutter controls:
show related concepts (reveal dimmed umbrella nodes) and a min link strength
slider (hide one-off links).
Add a concept the agent missed
learnlance add "debouncing" # search the current dir for the topic
learnlance add "topological sort" --path ./src
learnlance add "event sourcing" --force # add even if it's not in the code
Clear the graph
learnlance clear "delta encoding" # remove one concept (+ orphaned related nodes)
learnlance clear # wipe the graph (asks first; -y to skip)
Per-session recaps are written to ~/.learnlance/insights/<session>.md.
Configuration
learnlance config # show current settings
learnlance config --llm-cmd "ollama run llama3" # use any CLI that reads stdin
learnlance config --cli-model haiku # model alias for the CLI backend
learnlance config --max-topics 3 # fewer concepts per turn
learnlance config --background off # run analysis inline (blocks)
learnlance config --disable # pause without uninstalling hooks
learnlance config --enable # re-enable
Everything lives under ~/.learnlance/: graph.json (the graph), graph.html
(the visualization), insights/ (recaps), learnlance.log (diagnostics).
Uninstall
learnlance uninstall # Claude Code (default)
learnlance uninstall --commandcode # one specific agent
How it works
learnlance normalizes every agent's hook payload into one CodeEvent, then runs
a harness-blind pipeline: insights → knowledge graph → HTML → recap. See
ARCHITECTURE.md for the full design.
| File | Role |
|---|---|
adapters.py |
Translates each agent's hook payload into a CodeEvent |
install.py |
Writes each agent's hook config (per project) |
autosetup.py |
Detects your agents and installs missing hooks |
hook.py |
Hook entrypoint; spawns the detached worker |
core.py |
The harness-blind learning pipeline |
insights.py |
Generates insights via an LLM CLI (or in-chat) |
transcript.py |
Parses Claude Code's JSONL transcript |
pending.py |
Buffers mid-session edits from tool-at-a-time agents |
graph.py |
Merges concepts into the knowledge graph |
viz.py |
Renders the offline, self-contained HTML graph |
codesearch.py |
Finds where a topic lives in your code (add) |
Zero third-party dependencies by design — hooks must run reliably wherever an agent launches them.
Contributing
LearnLance is actively looking for contributors. You don't need to understand the entire codebase to contribute.
Areas to help
- A coding-agent integration (adapter + installer)
- Knowledge graph algorithms
- Concept extraction
- Graph visualization
- CLI/UX
- Testing
- Documentation
- New learning workflows
Good first contributions
- Add support for another coding agent
- Improve graph visualization
- Add tests for transcript parsing
- Improve Windows compatibility
- Add a CLI command
- Improve concept deduplication
- Improve graph accessibility
- Add documentation or examples
License
MIT — see LICENSE.
Metadata
Release files for learnlance-univ 0.2.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| learnlance_univ-0.2.17.tar.gz | 91.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| learnlance_univ-0.2.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 166.3 kB
Release files / learnlance_univ-0.2.17.tar.gz
| Download URL | learnlance_univ-0.2.17.tar.gz |
|---|---|
| Size | 91.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b3228e7be9031902596675b16387c89142feac22760306c9e7cca4cede25c74
|
|
BLAKE2b-256 checksum How to use checksums |
befcb6768189e1d3355e1d178d175f2f3671c557bafc3859b9d37ce0c9444b05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / learnlance_univ-0.2.17-py3-none-any.whl
| Download URL | learnlance_univ-0.2.17-py3-none-any.whl |
|---|---|
| Size | 75.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f862bf1e117e84dabb016d8c4ed99c016947947297400bbd7047fb59dc90fab7
|
|
BLAKE2b-256 checksum How to use checksums |
3df8d7613211f74844007bcc2e5ba635521f6282f2461bd682f91bbe53d5f8d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency log