Skip to main content

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:

  1. pulls out the code the agent just wrote,
  2. 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",
  3. merges those concepts into a persistent knowledge graph, and
  4. 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.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for learnlance-univ 0.2.15
File Size Uploaded
learnlance_univ-0.2.15.tar.gz 90.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for learnlance-univ 0.2.15
File Interpreter ABI Platform
learnlance_univ-0.2.15-py3-none-any.whl Python 3 none any Details

Total release size: 165.9 kB

Release files / learnlance_univ-0.2.15.tar.gz

Download URL learnlance_univ-0.2.15.tar.gz
Size 90.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cad1f46e5fd98ac6ad1ac3495a7e56a5b0684985394087eada617f16a652d632
BLAKE2b-256 checksum
How to use checksums
f1b212a77e388d789e10af491add7bdc64a2e699f359489341ab6253174cba38
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

Release files / learnlance_univ-0.2.15-py3-none-any.whl

Download URL learnlance_univ-0.2.15-py3-none-any.whl
Size 75.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b738c54be57416b5f4eaf8e5fb9d91255ad706fe3b3535055c4ef242181df2fb
BLAKE2b-256 checksum
How to use checksums
76f56e1593c09cebb1118084b690de956c79b5f675e658e60e2c1430dbe90a30
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

Release history Release notifications | RSS feed

This release

0.2.15 This release

2 release files

0.2.7

2 release files

0.2.5

2 release files

0.2.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page