Start

Getting started

Install Lore once. After that you do not operate it: projects register themselves, the agent learns the rules, and each edit is served only what it needs.

What you need

  • Python 3.10 or newer. Nothing else to install: Lore uses only the standard library.
  • git, which Lore uses to find a project's files and remote.
  • An agent that speaks MCP: Claude Code or GitHub Copilot CLI (set up by install.py), or VS Code (set up by hand, see Connect your agent).
  • Optional: the GitHub CLI gh, logged in with gh auth login. Lore uses it to read pull-request review comments and to check that a repository is yours.

Set it up

  1. Get the code Clone it anywhere. There is no package to install; the scripts find their sibling folders, so you can run them from any directory by path.
    git clone https://github.com/viktorg1/lore ~/projects/lore
    cd ~/projects/lore
    python3 -m unittest discover -s tests     # optional sanity check
  2. Connect your agents One command detects Claude Code and Copilot CLI and configures whichever it finds.
    python3 install.py
    Add --dry-run first if you want to see what it will change. It is safe to run again, and --uninstall removes what it added. Details: install.py.
  3. Start a new agent session The agent loads MCP servers when it starts, so open a fresh session (or restart the CLI). That is all the setup there is.
  4. Work as usual Ask the agent to edit a file in any git project. What happens next is described below.

What happens on first use

You will not see most of this; the agent does it as part of the task and tells you about the results in one line.

  1. Lore registers the project. The first time the agent asks about files in a git repository Lore does not know, Lore maps its folders and languages and files it under the folder's name. See registering projects.
  2. The agent sets it up. In a repository that is yours, the reply to the first get_rules asks the agent to run discover_conventions and, if the repository is on GitHub, learn_from_reviews, then save the conventions worth keeping with propose_rules.
  3. Lore screens what it saves. Rules that pass are activated at once; anything risky or contradictory waits for you. The agent says which.
  4. The agent tags the rules. It decides which rules apply to every edit and which only matter for certain work, and writes the trigger words that tell them apart. See how rules are chosen.
  5. Every later edit starts with a short call that returns only the rules that edit needs.

Check that it works

Is the server connected?

claude mcp list          # lore: ... - Connected
claude mcp get lore      # scope, command and status
copilot mcp list
copilot mcp get lore

Does the server answer?

This speaks the protocol to the server directly, without any agent:

printf '{"jsonrpc":"2.0","id":1,"method":"tools/list"}\n' | python3 mcp_server.py

You should get one line of JSON listing eight tools.

What does Lore know?

python3 review.py --name myapp list --details     # every rule, where it came from, its tags
python3 review.py --name myapp list --auto        # only what Lore activated by itself
python3 review.py --name myapp resolve src/api/users.py --task "add pagination"   # what the agent would be sent

The project name is the folder name (~/projects/myapp becomes myapp); ls ~/.lore shows what is registered.

Day to day

  • Correct the agent. Say what it got wrong. It saves a short, general rule and tells you; the rule applies from then on.
  • Glance at the UI sometimes. python3 serve.py opens a dark page to browse, edit, delete and re-scope rules. See serve.py.
  • Undo anything. python3 review.py --name myapp reject <id> deletes a rule, including one Lore activated.
  • Prune now and then. review.py usage lists approved rules least used first.

Choose how much you trust it

By default Lore activates rules by itself when they pass screening and the repository is yours. To make every proposed rule wait for your approval instead:

python3 install.py --approval manual

Other settings live in ~/.lore/config.json; see settings.

Prefer to drive it yourself? Every step the agent performs also exists as a command. Register with memorize.py, infer rules with discover.py, read pull requests with learn.py, and review with review.py. Rules saved by these scripts always start as pending.