Skip to content

scode/leiter

Repository files navigation

Leiter

Latest Release License: MIT

Your partner agent who learns as you work.

Leiter makes Claude Code learn your preferences automatically — no manual steps after installation. It quietly improves in the background over time.

Inspired by Joe Romano, who was inspired by Matt Greenfield's thread on the topic.

Here is an example of it learning:

Leiter screenshot

Quickstart

  • brew install scode/dist-tap/leiter
  • leiter claude install
  • Start a new claude session and run /leiter-setup and follow the instructions.
  • If you did not enable auto-distillation during setup, remember to run /leiter-distill every now and then (once a day or so) to apply learnings from past sessions.

For more details, including if you cannot or do not want to use Homebrew, see docs/setup.md for the full setup guide.

How It Works

Leiter maintains a "soul" — a markdown file in ~/.leiter/soul.md — which contains instructions for how the agent should behave. The soul is updated based on distilling learnings from session logs (and can also be directly updated when prompted to). You can think of the soul file as an auto-updating personal CLAUDE.md file. You can view it at any time by running /leiter-soul.

Here's the TLDR of the mechanics:

  • Session start: Your soul file is injected into the session as context, so the agent starts with your preferences already loaded.
  • During the session: Just do what you normally do.
  • During the session (OPTIONAL): You can directly trigger immediate soul updates by saying something like "Instill that I never want you to create a PR unless explicitly asked."
  • Session end: The session transcript is automatically saved to a log directory under ~/.leiter.
  • Distillation: This refers to "distilling" the logs to extract learnings, and updating the soul. This can be automatic or manual.
    • If you chose auto-distillation during /leiter-setup, leiter will periodically launch automatic distillation in a background agent after the first turn in a session.
    • Otherwise, or in addition to automatic distillation, you can run /leiter-distill at any time to trigger immediate distillation.
      • NOTE: The current session is not capture during distillation because it has not yet been logged. If that is what you want, first /clear or exit claude and resume the session.

See docs/how-it-works.md for the full picture.

Usage

The quickstart above is all you need to use it. A little more details and guidance on whether to enable auto-distillation during setup is in docs/usage.md.

If you want to change your choices made during /leiter-setup, simply run /leiter-teardown followed by running /leiter-setup again.

Uninstalling

  • Run /leiter-teardown in a session.
  • Run leiter claude uninstall.
  • Uninstall the binary (e.g. brew uninstall leiter).

This will leave your soul intact, as well as any undistilled session logs in ~/.leiter. You are free to remove them if you would like.

Other topics

About

Turns Claude Code into a self-learning partner agent

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages