At first sign-in, confirm your name and choose Continue without a key to start editing and checking proofs. To use the assistant, choose Set up API key at sign-in or open the Lemex panel later.
Choose Mathlib Playground on the welcome screen, or expand Playgrounds in the sidebar and choose New playground. It opens a private scratch file with import Mathlib, using the prepared Lean and Mathlib versions. New playgrounds have distinct names such as Scratch.lean and Scratch2.lean. Paste your code; files save automatically after a short pause. Save or Ctrl+S (Cmd+S on macOS) saves immediately.
Autosave is enabled for editable files, including Lean, Markdown, and TeX. Live text edits save through the shared document connection. The fallback save path waits about 1.5 seconds after typing. Pending saves finish before changing workspaces. The status bar shows Saving…, All changes saved, or a save problem. Connection failures retry with a delay. Conflicts pause autosave and preserve your edits in the current tab; resolve the conflict or use Reload file to discard local changes. Keep the tab open until saving succeeds. Read-only library sources are never saved.
Choose Open .lean file to upload one UTF-8 Lean file of at most 2 MiB. Its contents open as Main.lean in a new workspace. Files importing other modules from your own project need the full project instead.
Saved files appear under Playgrounds and can be reopened with their chats. Hover over a playground or focus it with the keyboard to show Rename playground and Delete playground. Rename changes its displayed name and download name, keeping its code and chats. Deleted playgrounds can be restored with Undo or Trash. Moving a playground to Trash automatically stops its active work first.
Use Check File to run a Lean check or Download .lean to download the current editor contents, including unsaved edits. Use Convert to project to enable source control and multi-file Lemex requests; conversion keeps the same folder, files, chats, and pinned environment. If a terminal command adds extra files to a playground, its file tree appears so you can open them. The editor and each private terminal copy use Main.lean. The playground name, such as Scratch.lean, identifies the workspace and names its download; renaming it does not change Lean imports. The terminal header shows which workspace is connected, and switching workspaces closes its terminal.
The shared Mathlib template stays protected; your own playgrounds can be deleted. The server verifies the prepared environment once and reuses that check when opening new playgrounds. If you see Checking the prepared Mathlib environment…, other projects remain available while the check runs. Use Retry Mathlib preparation after a failed check. If Mathlib is not installed, ask the server administrator to prepare it. Opening a playground does not call Lemex automatically.
Choose Import or create project. Create a project with compatible library presets, paste an HTTPS repository URL, or upload a local folder.
The Project name field is at the top. Lean, Mathlib, CSLib, and Physlib prepare automatically on the server; the picker updates when each library is ready. Lean basics defaults to the latest stable release, with other releases and an exact-version option in Lean version. Library presets use their compatible versions, and existing projects keep their pins.
GitHub and GitLab subdirectory links work too, such as https://github.com/epfl-lara/jordan-curve-theorem/tree/main/HOLLight-Lean or https://gitlab.com/group/project/-/tree/main/Lean. For branch names containing /, use More options → Branch, tag, or commit. Imports keep their Lean version and dependency pins.
For a private repository, open Private repository access and enter a token. Save for this repository is selected by default: imports, pulls, pushes, terminals and agents reuse it for that repository. To share a token across repositories on the same host, choose Git connections and connect the host instead. A repository token takes priority over a host connection. A GitHub fine-grained token needs access to the repository and Contents: Read and write to push, or Read-only to clone. A GitLab token needs write_repository to push, or read_repository to clone. Enter the matching username for a deploy token. Select GitHub or GitLab and enter your own host for a self-hosted installation.
Connections are saved for your account on this server, including after a server restart. Tokens are never displayed again. Enter another token for the same repository or host to replace it, or choose Disconnect in Git connections to remove that saved token. A repository connection is separate from its host connection. Revoke the token at your Git host to invalidate it everywhere. Commit author sets the name and email used by Source control, terminals and agents. Reopen an existing terminal or start a new agent run after changing its author. Use your account email or its no-reply address.
For access for just one import or push, clear Save for this repository. Use Use a different token to override an existing connection. A one-use token is cleared when the operation starts. If saving fails, the masked token stays in the form so you can retry. A private import downloads the full repository history. Tokens entered before repository saving was available were cleared and need to be entered once more.
For GitLab, use the HTTPS clone URL ending in .git. If a repository URL redirects, setup tries its .git form once on the same host. If it still fails, copy the direct HTTPS URL from the repository's clone menu and create a new import. Lemex cannot repair setup until the project files have been downloaded.
Enable publishing changes back is selected for repository imports. Leave Working branch blank to create a unique branch at the imported revision, or enter a branch name. If the name conflicts, the app preserves existing branches, chooses a unique alternative and shows the change. Importing never pushes changes. Clear the checkbox if you only want to work locally; you can enable publishing later in Publish. GitHub, GitLab and other HTTPS Git repositories are supported.
Use Upload or drag files/folders into the upload area. Upload in the Files header adds to the open project. The app asks about ambiguous project folders and name conflicts.
Let Lemex repair setup if needed allows an automatic configuration repair after setup fails. Use Stop setup to cancel.
Retry setup reuses a completed clone if fetching the selected revision failed. If repository authentication is needed, use its saved connection or enter another token. If cloning itself was interrupted and left partial files, create a new import as directed by the error. Partial files are preserved. A missing branch or tag needs a new import with an existing revision.
When available on the server, the specialized Lemex setup agent starts automatically after a recoverable setup failure. It diagnoses an isolated copy, proposes configuration repairs and validates them with Lean before they are applied. The progress card shows when repair is queued, its current activity and elapsed time. Repair has a 15-minute default execution budget after an assistant slot and provider key become available; time spent waiting is excluded.
If you need help, choose Ask Lemex to fix setup, including before an imported project has a Lean environment. This opens a setup-help draft in Ask & Search. Your text, selected model and reasoning effort stay intact. Lemex receives the setup diagnostics directly; you do not need to copy logs into chat. Nothing starts until you choose Send.
Setup help proposes only root Lean and Lake configuration changes for review. It preserves existing Lean and dependency pins and cannot change proof sources. Review and apply the proposed configuration, then choose Retry setup. If you want source edits or an intentional version change, choose Exit setup help and make that request in an ordinary chat. Your chat history and draft stay available while preparation runs; new assistant tasks wait until setup finishes or you stop it.
Automatic repairs also preserve source files and pins. Their configuration updates are saved together. A newer edit or an interrupted save stops acceptance rather than combining old and new configuration.
Setup shows its current stage, from preparing Lean and libraries to testing the environment. If automatic setup needs a configuration repair, Lemex is repairing setup appears while Lemex diagnoses the problem. Testing the setup repair appears before the checked configuration is accepted and setup retries. You can open another project while this runs.
Project setup above the editor shows the setup result, Lean version and a short source revision. Open it for the repository, folder, full revision and any warnings. Setup output names each build or check and reports its elapsed time. It belongs to the latest setup attempt, and long output shows a marked tail. The heading stays visible while you scroll the output. Dependency revision hashes include the package name. Lean errors and linter warnings remain visible; a ready environment can still contain project targets that need repair.
Setup also checks that local Lean files can resolve their compiled imports. After live assistant edits finish, or you accept reviewed Lean edits, LeanFlow rebuilds the saved project's modules and refreshes the open Lean document. Your editor text is preserved. If imports still cannot load, Project setup shows a warning: fix the build errors, run Check Project, then use Restart Lean. Import readiness does not certify unfinished proofs.
Use Refresh setup in an open project to recheck its environment. Valid compiled caches are reused. Choose the adjacent info icon for details about cache reuse and automatic repair. Stop active checks and chats, and close the terminal before refreshing.
To rename or move a project file or folder, right-click it in the file sidebar or open its ⋯ menu. Choose Rename or Move to folder…. Unsaved edits are saved first, and existing destinations are never overwritten.
Choose the parent under Destination folder. To move figures to Problems/figures, choose Problems. Change Name to rename it in the same move. Check New path before confirming.
Keep Update imports and file links selected to update recognized references automatically. It is on by default. This covers Lean imports, Markdown links and images (including Lean comments), and common TeX commands such as \includegraphics and \input. Relative links inside moved documents follow their new location. The result shows how many references changed. Paths built in code and unsupported or ambiguous references need a manual update. Check HTML image tags, deeply indented Markdown links, folder links, and imports using custom Lean source directories manually.
Reference discovery runs locally without holding the file-save queue. It excludes dependencies and protected files and uses a 32 MiB, five-second scan budget. Only files that still match their scanned version are updated. The move completes even if a reference update cannot be saved; a warning tells you to review the remaining imports and links. Newer editor drafts stay intact.
Simultaneous reference updates wait briefly for capacity while unrelated editing stays available. If the queue is busy, retry the move shortly. Turning off Update imports and file links skips that queue; update the references manually afterward.
You can move files while checks, assistant runs, PDF builds and terminals stay open. Wait for setup or a Git operation to finish first. If an assistant or terminal later tries to update the old path, its conflicting update is kept in its private copy. A Lean check that sees changed files asks you to run it again. Project setup files stay in place. Open files, chat attachments and focused proofs follow the new paths while you are connected. If you were offline, refresh the file list and reopen the file at its new path.
An open terminal receives saved file moves and clean file updates automatically. Moving an unchanged text file with mv in the terminal also updates recognized imports and links, including SVG diagram links in Lean comments. References that cannot be identified safely need manual review; the terminal shows a warning. Conflicting private edits stay available for recovery.
Choose Share project to find an account or create an Editor or Viewer link. Project roles are Admin, Editor, and Viewer. Admins manage access and deletion; granting another Admin requires acknowledging those powers. Keep at least one Admin.
For a competition in one repository, give each participant an Editor invitation to the same project. In Files, double-click each Lean file you want to keep open. Switch between the file tabs above the editor. They share one Lean connection in that browser workspace. Everyone with edit access can change the shared source, including when two people work in the same file.
Concurrent browser edits merge live. Each person's chats, API key, provider, model, and Git connections stay private. Editors can run their own agents, use their own credentials, and prepare the project. Terminals use private copies and publish checked file changes. A conflicting terminal copy can be downloaded with Recover terminal files.
Revoking an invitation link stops new joins. Remove existing members separately. See Project sharing for permissions, conflict handling, and terminal recovery.
Automatic Rename Symbol, refactoring, and editor code actions are disabled. Lean can produce edits that change what a name refers to or leave invalid references. A renamed program can still compile with a different meaning.
Edit the declaration and its references manually. Review Source control → Changes and use Check Project to check your edits. Pressing F2 or choosing Rename Symbol (unavailable) explains the restriction. Hover, Alt/Option-click, F12, and Go to Definition remain available.
Choose Lean docs beside the search bar to read local copies of Functional Programming in Lean, Theorem Proving in Lean 4, and the Lean Language Reference. On a small screen, use the book icon beside search. The reading panel opens below the editor, leaving Lemex available beside it. Choose Expand for more reading space, or Split view to return. Close and reopen Lean docs to keep your current chapter.
Choose a book, follow its chapter links, or use Search this book to find matching chapters. Contents returns to the start. The displayed Lean version belongs to the downloaded book; your project's pinned Lean version stays unchanged.
With a prepared project open, choose Ask Lemex to add the current chapter to your draft. Select a passage first to include it. Your existing draft is preserved, and nothing is sent until you send the message. Lemex knows which books are installed and can search and read them directly. For Lean explanations, it is instructed to consult relevant chapters and include clickable book and chapter references when it uses them. These links open the cited page in Lean docs.
If a book is missing, ask the server administrator to install the local books.
Choose a Markdown file such as README.md in Files. The editor highlights headings, emphasis, links, lists, and code fences. Choose Preview Markdown to read the formatted document, including tables and math written as $x^2$, $$x^2$$, \(x^2\), or \[x^2\]. Edit Markdown returns to the same editor. Changes save automatically.
Formatted previews support documents up to 512 KiB. Larger Markdown files stay available in the editor.
Choose a .pdf file to open a read-only PDF viewer. Use Download PDF or Open PDF in new tab if your browser cannot display it inline. Choose Reload PDF after changing a document through the terminal. PDFs can be uploaded alongside source files, up to 16 MiB per PDF and 32 MiB total per upload. PDF viewing does not compile LaTeX or attach PDF contents to Lemex chats.
Choose a PNG, JPEG, GIF, WebP, AVIF, BMP, ICO, or SVG file in Files to view it. Actual size and Fit image control its display; Download image saves the original. Raster previews support files up to 16 MiB, with a bound on decoded image size. SVG previews support up to 2 MiB. Choose Edit SVG to edit its source, then Preview SVG to save and view your changes.
Choose an HTML file to view its static page, including inline styles and local project images and stylesheets. Scripts, forms, and external resources are disabled. Edit HTML opens the source; Preview HTML saves changes before displaying the page. HTML previews support documents up to 2 MiB. Use Reload HTML after changing a linked image or stylesheet.
Project images also display inside Markdown documents and assistant replies, using links such as . Choose an image to open it in Files. Ask Lemex to save generated diagrams as SVG; uploaded raster images can be linked as well. New raster output in an assistant's private copy is not published as a project file. External images stay links until you choose to open them.
To inspect a figure in chat, choose Enlarge in its caption. Choose Actual size to see the original detail or Fit image to see the whole figure. Press Escape to return to the conversation.
Show a project image beneath a Lean comment by referencing its path relative to the Lean file:
/-  -/
-- [Another diagram](figures/other.png)Choose the arrow beside the caption to collapse or expand a picture. Choose the picture to open the full preview. Use Reload after regenerating a figure. Comment previews show up to 20 images in Lean files of at most 512 KiB. External URLs are not loaded.
Drag the scrollbar inside Files to scroll long lists. The separate strip to its right resizes the sidebar. You can also focus a separator and use the arrow keys.
Open a .tex file to edit highlighted LaTeX beside its PDF. Choose Options in the PDF panel to select the root document, then choose Build PDF. Options also contains rebuild-on-save, the build log, and PDF reload and download controls. Collapse it to leave more room for the document. The build saves your open drafts first and stops if a file has a save conflict. Included .tex files, local styles, bibliographies, and PDF/PNG/JPEG figures are captured from the root document's folder and its subfolders. Generated files stay outside your project sources.
Enable Rebuild on save to update the PDF after saving edits. Unsaved typing does not trigger a build. A saved Informalize paper updates the preview automatically, even with Rebuild on save off. For other edits, choose Build PDF to update an out-of-date preview. A failed build keeps the last successful PDF visible; open its reported errors to jump to the source line. Stop cancels a queued or running build.
Double-click a position in a current compiled PDF to focus the corresponding LaTeX source. Linked passages have a Lean badge. Hover a linked passage to preview its destination, then click the badge to open it. Rebuild after a source edit to refresh these locations.
Use Ask & Search to ask Lemex to read, edit, and compile a document. It can read the generated PDF's extracted text and use compiler diagnostics to repair LaTeX. Text extraction can omit figures and mathematical layout. Review-first edits remain candidates until accepted; live editing follows the option selected for Ask & Search. A successful TeX build does not verify Lean proofs.
The compiler supports pdfLaTeX, automatic reruns through latexmk, and BibTeX. It requires a separate TeX worker image. Existing Lean toolchains stay pinned.
Put the root document at the common parent of its inputs and use paths such as \input{chapters/introduction}. Parent paths such as ../chapter.tex and absolute paths are blocked by the isolated compiler. A root in a subfolder can include files below that subfolder.
Click a file to open it in a preview tab beside Save. Its italic name marks it as temporary: viewing another file replaces that preview. Editing keeps the tab open, even after saving or undoing the edit. Ctrl+S (Cmd+S on macOS) saves and keeps the tab open, even without edits. Your cursor stays where it is. You can also use Keep open (the pin beside Save), double-click its tab or sidebar entry, or focus the tab and press Enter to keep it open without editing. New files and recovered drafts also stay open. Go to Definition keeps the source tab open so you can return to it.
Use the tabs to return to files kept open in this project. Tabs restore the cursor and scroll position. Hover over a tab to see its full path. Focus a tab and press Delete to close it with the keyboard. The dot marks unsaved edits; closing that tab first attempts to save just that file and keeps the draft available if saving fails. Discard this file discards only the tab being closed. Other drafts stay open, including files with save conflicts or deleted files. Closing a tab does not delete the file. Switching projects clears the tab list.
After 30 minutes without typing, clicking, scrolling, or touch interaction, the Lean editor sleeps to free server memory. Click or type to reconnect. Your open text, cursor, and undo history stay in the browser. Background assistant runs and checks continue while the editor sleeps.
Put the cursor on a completed #eval command to see its output in Goals & diagnostics. For example:
#eval show IO Unit from do
IO.println "Hello"Numeric shifts (n <<< bits), #eval, #reduce, IO, and ordinary Lean metaprogramming are supported in files Lemex edits, including Mathlib projects. Final checks compile the code and independently verify its proofs.
An interactive program such as LeanTui's #eval chessMain [] waits for keyboard input. Remove that command, then use Restart Lean to recover the editor. Unsaved edits stay in the editor. Save your changes and open Terminal to run the project's executable, for example lake exe chess-demo.
Choose Check File to save your changes and compile the selected .lean file. If you’re waiting for live Lean feedback, Check this file in the queue notice submits the same check. You can keep editing and switching tabs while it runs. The result below the editor names the file you checked. If it says earlier version, it applies to the saved copy Lean checked. Select that file and run the check again for current sources.
Choose Check Project to check the project’s default targets. It uses the project's pinned native lake check when available to independently recheck each project declaration and its complete dependency chain, including referenced Mathlib declarations. Unused imported declarations are excluded. Older releases keep their existing build check. The selected file is also compiled if it is outside the default targets. See Project checks and Lean caches for scope, compatibility and worker setup.
While a project or file check runs, Checking… shows the elapsed wall-clock time in minutes. Use Stop check beside it to cancel the check and wait for its worker to stop. Fix or remove the blocking command before checking again.
If an older imported project reports a ProofWidgets package-lock.json.hash read-only error, stop its active checks and chats, then use Refresh setup. Setup prepares and tests the dependencies before sharing them read only, preserving the project's Lean version and dependency pins.
Choose Terminal in an open, prepared workspace. Save editor changes first, then run commands such as lake env lean Main.lean or lake build. The terminal starts in a private copy of the selected project, using its pinned Lean environment. It cannot access a containing checkout or another project. Shared dependencies and toolchains are read only, and outbound network access is available.
Type normally, use the arrow keys for command history, and press Ctrl+C to interrupt a command. Drag the separator above the terminal to resize it. Text file edits publish to the saved project with version checks. If another collaborator changed the same file, publication pauses and preserves the private copy. Close the terminal and choose Recover terminal files to download it. Run a Lean check after publication to verify the saved code.
The worker includes the Lemex CLI. Run lemex to open it, or lemex --version to see its version. Configure your own CLI login or provider inside the terminal if needed. The server's assistant credentials stay private, and the terminal home is temporary.
Git is available in the private copy with a new local repository. Its commits, branches, and remote settings do not change the saved project's Git history. Use Source control to publish that history. To use a separate remote from the terminal, configure it explicitly with git remote add origin https://github.com/owner/project.git, using your own URL. HTTPS commands reuse your saved token for that repository or its host connection from Git connections. Run commands only when you trust them to use that Git access.
Closing the terminal, changing workspaces, or disconnecting stops its shell and background processes, then finishes checked file publication. An idle terminal closes after 30 minutes without input or output. Builds that continue producing output stay connected. Reconnect terminal starts a new private copy. If published changes modify Lean or Lake configuration, close the terminal and use Retry setup to prepare the updated environment.
Close the terminal before preparing, changing or publishing Git history, or uploading files. Moving project data to Trash refuses another collaborator's active work. Terminal builds use the private copy's cache; checks use the saved project. Terminals share worker capacity with editors, agents, setup, and checks.
- Open a Lean file. In Outline, click a declaration to navigate, then + Chat to attach it.
- Or highlight lines in the editor, open Select context in chat, and choose Use selected lines. The same menu lists declarations and accepts ranges such as
70–74. Highlighted lines keep that exact line range, even inside a theorem. - Check Focused on, write your request, and send. Click the target to revisit it, or clear it to remove focus.
Look beside each theorem, lemma, or example in the editor or Outline for its current Lean status. A green check means Lean finished checking it without errors or warnings. An amber triangle marks a warning or a proof placeholder such as sorry. A red cross marks an error. A clock means Lean has yet to finish checking this version. Put the cursor on a reported problem to see details in Goals & diagnostics.
Targets belong to their chat. Ask Lemex uses the current proof or selection; Optimize also selects optimization mode. Save changed lines before sending a focused update during a run.
| Task | Use it for |
|---|---|
| Ask & Search | Ask questions, find lemmas, or work on project text files. |
| Proofs | Complete or repair a proof while keeping its statement. |
| Formalize | Turn mathematical prose into Lean statements and proofs. |
| Informalize | Write Lean statements and proofs into a paper or notes. |
| Optimize | Shorten a valid proof or reduce its elaboration work. |
Your requests and follow-ups guide the work in each mode. In Ask & Search, Proofs, Formalize, and Optimize, you can also request document edits, source renames, statement or import changes, and setup repairs.
Open a Lean file, choose Informalize, and send the message to write up its theorems. The open file is included automatically. To write up one theorem, choose it in Outline. You can also name a theorem or file in chat, attach several sources, or let Lemex find the relevant proofs in the project.
Leave Output document empty to let Lemex choose where to write. To use an existing paper, ask “Add the proofs to the Results section of paper.tex.” Lemex can write a single article, split a larger paper into a main TeX file and chapters, or create linked Markdown notes. For a list of results, ask for statements only. Lemex still checks the Lean proofs.
Lemex checks each source proof with the project’s Lean version and builds a PDF for LaTeX. By default, it saves the paper and its chapters together when the checks pass. Choose Open PDF in chat to read the checked build, or Open document to see the source and preview together. Use the small arrow beside a printed statement to open its Lean declaration. Use the arrow beside the declaration to return to the LaTeX source, or open Paper links to choose a destination. To review the changes before saving, turn off Options → Edit files live before sending. If a check fails, the chat identifies the issue. You can inspect any available draft and request a correction in the same chat.
Compare optimization's token and heartbeat measurements: a shorter proof can take more elaboration work. Repair invalid proofs first.
To formalize a document, open its PDF, TeX, Markdown, plain text, or other readable source, choose Formalize, and describe the statement or argument to translate. Use Select context or @ to add other sources. You do not need to select an existing Lean file: Lemex can create one for the formalization. Source documents stay unchanged, and Lean output still receives independent verification. The standard worker can extract PDF text. If extraction is unavailable on an older worker or loses essential mathematics, provide the relevant passage or TeX source. Scanned pages may need OCR.
When you formalize an open or attached PDF or LaTeX file, Lemex also links the statements it can match to the resulting Lean declarations. In review-first mode, choose Apply changes to make the links visible. For a formalization you already have, open the PDF, LaTeX source, or Lean file, choose Paper links → Find links with Lemex, then send the prepared message.
In a PDF, hover or focus a margin arrow to preview the Lean destination. Select the arrow to jump there. In an uploaded PDF, markers appear when the viewer finds a unique match for the excerpt on its page. Use PDF zoom to enlarge the page while keeping its links. The Paper links panel also provides page jumps for scans and passages without a text match. On a narrow screen, Paper links opens a dialog that closes when you follow a link. LaTeX links can follow a \label when it moves within the file. Formalize stores its links in leanflow.paper-links.json. Informalize links its TeX statements using source comments such as % Lean: Main.lean#sum_first_odd_eq_sq.
Open the small info marker or Paper links to read a formalization note. Lemex adds one when it identifies a material difference, such as a corrected definition or an added hypothesis. The note explains what the paper says, what Lean uses, and what changed about the result. In Informalize, Lemex checks relevant notes against the saved sources and explains substantive differences alongside the affected statements in the draft.
Ask & Search primarily helps with Lean, but also welcomes general questions, writing, planning, and open-ended tasks. Ask it to create or edit project text files and organize, rename, or delete non-Lean notes and documents. Ask Lemex to rename or delete Lean sources when needed, or use the file browser. Questions and explanations leave files unchanged. Live edits are on by default: Lemex saves requested edits as it works. To inspect the diff before saving, turn off Options → Edit files live before sending, then choose Apply changes after reviewing. This choice is saved separately from the other modes. Stop the run before undoing its edits. Lemex can use the workspace shell, Python, and other installed command-line tools in either editing mode. Lean source edits still receive independent Lean verification; ordinary conversation and non-Lean file tasks do not.
Ask Lemex to fix project configuration when needed, including registering a new Lean module in lakefile.toml. Requested configuration edits receive build checks. Existing Lean versions and dependency revisions are preserved unless you ask to change them. Installed dependency sources and credentials stay protected.
In live editing, configuration edits save together after checks finish; in review-first mode, choose Apply changes. After saving configuration changes, use Retry setup to prepare the updated environment.
Add AGENTS.md at the project root to give Lemex project conventions. Lemex loads
it automatically when a new assistant run starts. For work in a subdirectory,
Lemex is instructed to read applicable nested AGENTS.md files first. A nested
file overrides ancestor guidance only for its own directory and descendants.
Dependency instructions do not govern your project. Your explicit requests take
precedence; credential protections and independent proof checks still apply.
New chat starts a fresh conversation, listed after its first message. Use the chat selector to reopen one and its pencil to rename it.
Automatic names and rename suggestions identify the task's theorem, declaration, question, or error when that information is available. Naming keeps the opening request and recent context, including a selected proof's name and statement; a brief follow-up such as "continue" retains the original task. A name you enter yourself takes precedence over automatic naming. To refresh an existing broad name, open its pencil, choose Suggest a name, review the suggestion, then save it.
Check Current file above your message. Its path is supplied automatically when available; you do not need to attach it to a task or update. Missing automatic context is skipped. Explicitly selected files and proof targets must be available. For PDFs, only the path is supplied. PDF contents are not attached.
For models that support vision, the initial message can include up to four saved PNG, JPEG, GIF, or WebP images from the current file and selected context, up to 8 MiB total. Lemex can use its image viewer to inspect additional images, including pages rendered from a scanned PDF. SVG and other image formats need conversion to PNG for visual inspection. A model that does not support images keeps file paths as context and reports that limitation; your selected model and reasoning effort stay unchanged.
Type @ or use Select context to attach extra files. The same menu includes declarations and selected editor lines. Adding context does not save or send your message. Options controls model, reasoning effort, and live edits. Drafts and selections stay with their chats.
Press Enter to send a message or a follow-up during a run. Use Shift+Enter to add a new line. While the @ file picker is open, Enter attaches the selected file first.
Reasoning defaults to high for Ask & Search and Informalize, and max for Proofs, Formalize, and Optimize. If the model does not advertise that level, its advertised default is used; a model with fixed reasoning keeps its provider default. A level you select in Options applies to that model and task mode, so switching modes does not carry an Ask & Search setting into a proof task.
The Model dropdown shows your saved models. Choose Add models… to browse everything available with your API key, select or remove models, then choose Save models. This list is saved to your account across projects, browsers, and sign-ins. Editing it keeps your current model, reasoning effort, and default. Models that your key no longer allows stay marked unavailable until you remove them. You can also edit the list in Assistant settings → Edit saved models.
Kimi K3.1 Pro appears in your saved models by default when your key offers it. On RCP, choose low, high, or max under Reasoning effort. Remove Kimi from Add models… to hide it from the picker.
Use Send update for extra instructions or Stop to interrupt. Updates show whether they were accepted. Runs continue until finished or stopped; send another message afterward to continue.
Open New chat to start independent work while another chat runs, including in the same project. Switch chats to read their output, send an update, or stop their work. When several chats are active, their count and links appear above the conversation. Work on different files when possible. If another chat or a person changes a file a chat is editing, its live updates pause and preserve the saved file; the chat's separate candidate remains available.
LeanFlow checks the parallel request allowance reported by your RCP key. A higher allowance permits simultaneous chats and setup repairs, subject to server capacity. If RCP does not report a usable limit, LeanFlow runs one task per key at a time. This allowance is shared across projects and accounts using that key. A waiting task explains why it is queued, starts automatically, and can be stopped. Automatic chat naming waits behind your work. Different keys remain independent. If the key is also busy in another app, LeanFlow shows the provider's busy/retry message; quota exhaustion asks you to check the RCP key portal.
Scroll up freely; Jump to latest resumes following output. Reasoning appears between replies in separate Show/Hide sections. Long traces scroll inside their own panel, keeping the Show/Hide controls within the message instead of floating over the chat. Files and chat drafts remain available during a run.
Work steps shows file reads, searches, commands, edits, and proof checks where they happen in the conversation. Expand a step for its input and result preview, or open its linked file. Older steps fold away; running steps and the latest issue stay visible. A tool marked Done has finished its call. Intermediate check results come from the tool; the separate Final Lean check reports the server’s proof verification. New runs record these steps; earlier runs retain their technical log under Checks & run details.
Code blocks have a language label, Copy code, and Wrap for long lines. Long blocks can be expanded, and Lean snippets highlight keywords and tactics. Use Copy reply for the whole response. File links open in the editor. Final check results and optimization measurements appear directly below the reply; detailed errors, axioms, usage, and logs are under Checks & run details.
With live edits on, the work status shows whether any files have been updated. Scratch checks do not change your editor; changes appear when Lemex writes to a project file. Saved edits still need final Lean verification. In review-first mode, files update after you accept the candidate changes.
Use View edits to inspect saved changes during a run. If Final checks need attention appears, select Review checks to see why the server did not verify the result.
Edit files live shows saved changes as Lemex works and preserves unsaved editor text. View edits shows the diff and Lean verification; intermediate edits may still contain errors.
After stopping, Undo agent edits restores changes without overwriting conflicting saved work. For review before saving, disable live edits, inspect the candidate, then Apply changes. You can apply requested Lean edits even when their checks fail, including unfinished proof skeletons. Failed or unavailable checks stay visible. Informalize saves its paper after the source and document checks pass. Save your editor changes before applying or undoing.
Type into the wide search box at the top of the workspace and press Enter. Choose LeanExplore for a description or Loogle for a type pattern. General search works without an LLM connection and without opening Lemex. For explanations and assisted searches, open Lemex and choose Ask & Search.
Results show a Type or Signature and available documentation/source links. Check results against your project's versions. Press Escape or close the results panel to dismiss it; focus the search box to reopen your results.
Choose Open locally to view a module from the project's pinned Lean installation or installed library packages. The viewer is read only and leaves your editor's unsaved changes intact. It selects the declaration when its signature matches the local file; otherwise it shows the module without guessing a line from another version. Open source opens the search index's version on the web.
To jump to a declaration from the editor, hold Alt (Option on macOS) and click its name. You can also press F12 or right-click and choose Go to Definition. Project files open in the editor; definitions in Lean's installed library open in the scrollable read-only viewer at the position reported by Lean. Pending edits save when navigating away; a save problem keeps your edits open for review. Use Ctrl+click (Cmd+click on macOS) to add a cursor for editing.
Lean keeps up to three recently visited project sources ready, including the current Lean file. Background sources expire after five minutes, and closing a tab releases its cached work. Unchanged file-list refreshes preserve the cache. Changes to other Lean files invalidate cached work and mark the current goals as potentially out of date. Choose Refresh imports in the goals panel to check again; shared typing does not automatically restart your file. Larger files and library sources may need to be checked again when reopened. Cached editor work does not replace Check Project or Check File. Switching projects releases the cache. Older servers without file revision information still clear the cache when their file lists refresh.
Open Source control in the file sidebar, including when Lean setup needs attention. If the project has no Git history, choose Start version control. This keeps your files and creates a local repository; nothing is uploaded. Active setup, checks, chats and terminals must finish before changing Git history.
In Source control → Changes, save files, review the diff, and enter a commit message. Status labels distinguish staged, unstaged and untracked files. A commit includes all listed eligible saved project files, including both staged and unstaged changes. Use Create branch if you need a new branch. An import with publishing enabled already has a working branch.
Open History to read recent commit messages and copy a commit ID. History is available without configuring a remote or preparing a push. If Git status cannot load, Refresh retries without clearing the commit message.
To download remote changes, open Source control, check Pull from and Pull branch, then choose Pull. Your saved connection is reused. The initial source is the imported repository and base branch, or the local repository's HTTPS origin. Changing the push destination to a fork leaves that pull source intact. After publishing to the same source repository, the pull branch defaults to the published branch. You can change the pull repository and branch before pulling. Save your editor first. If saved edits already match the incoming commit, such as edits an agent just pushed, Pull brings in that commit without creating a duplicate. Commit other local edits first. Pull advances the current branch when the remote history includes its local commits. If histories have diverged, it leaves your files and commits in place and asks you to reconcile them. Finish active runs and close terminals before pulling. Changes to the Lean configuration require Retry setup; pulling does not silently prepare a different environment.
You can also ask Lemex to clone, pull, commit or push. Its Git commands use your saved connection, without pasting a token into chat. When available, Lemex receives the saved checkout's current branch, recent local commits, selected project folder and cached upstream counts. Cached counts do not fetch or confirm the latest remote state. A remote clone may lack local commits that have not been pushed; Lemex must report that limitation rather than discard those commits.
For another private repository, include its HTTPS repository URL in your request or save a connection specifically for that repository. Lemex uses broad host connections for the current project, its saved push destination, and repositories you explicitly name. Repository URLs found in files or commit messages do not grant that access. Prefer provider tokens restricted to the repositories you need; the Git host determines what a token can access.
Lemex works in a separate checkout and brings requested file edits through the normal review or live-edit flow. Pushing that checkout updates the remote; it does not change the saved project's Git history. After the run, use Pull with the published repository and branch to bring that history into Source control. A commit kept only in Lemex's temporary clone disappears when the run ends. To keep a local checkpoint without pushing, use Source control → Changes → Commit saved changes. Each collaborator uses their own Git connections. Disconnecting a connection takes effect on the next credential request, including in an open terminal or running agent.
Choose Publish in the project header, or the Publish tab in Source control. If publishing was disabled during import, choose Enable publishing. The repository and current branch are filled in automatically. Use Change push destination to choose another branch or an existing fork where you have write access.
Choose the branch to push and the repository host. GitHub and GitLab are detected for their public services; select the provider for a self-hosted installation, or Other for ordinary Git pushing. Merge into branch selects the target for a later PR or MR; leave it blank to use the repository's default branch.
Choose Preview push, review the commit, destination and branch, then choose Publish reviewed commit. The matching saved repository token or host connection is used automatically. If needed, open Use a different token to replace it; with no connection, enter a token or open Git connections. Leave Save for this repository selected to reuse the new token for later pulls and pushes, or clear it to use the token once. The server rechecks the reviewed commit and does not force-push. Saved changes must be committed to be included.
You can close Source control during a push and reopen it later. After the push succeeds, its confirmed branch and PR/MR link remain available. Public imports stay shallow; publishing retrieves missing history in a temporary export without copying the dependency cache. Imports made with a repository token include their full history.
After a confirmed GitHub push, choose Open pull request on GitHub. For GitLab, choose Open merge request on GitLab. These links open the provider's request form with the published branch selected. Review the target, title and description, then submit the form there. When pushing to a fork, select the upstream repository in that form to contribute back. Other Git hosts keep their usual branch and review workflow.
Deleted files, folders, projects, and chats go to Trash. Use Restore or the immediate Undo notice. Choose Move to Trash in the confirmation dialog. For projects, files, and folders, LeanFlow automatically stops the project's checks, Lemex runs, terminals, and setup, then waits for its processes to exit before moving the item. Save or discard unsaved edits in the item first. Stop an active chat before deleting it.
In Trash, each item shows its size in MB. Files, folders, and projects show allocated disk space; chats show their stored content size. Shared dependency targets are excluded from project sizes. Click the red X to review the name, project, size, and deletion date. Choose Delete Forever to permanently remove it, or Do Nothing to keep it in Trash. Permanently deleting a project also removes its saved chats and runs.
To empty Trash, choose Delete All, review the item count and total size, then choose Delete Forever. Do Nothing keeps the items. If an item cannot be deleted, the dialog explains why and lets you retry the remaining items. Items added to Trash after the confirmation opened are kept.
Drag separators to resize panels; double-click to reset.
You stay signed in while using LeanFlow. Sign in again after 48 hours without activity. Typing, clicking, and scrolling renew your session; leaving a tab open does not. If sign-in expires, use the recovery dialog with the same access token to keep your edits and drafts. Your invitation token and saved API key are unchanged.
For setup, see Install and run and Hosting. Advanced settings are in Configuration.
Open Failure log in the status bar below the editor. It updates while you work and keeps up to 50 recent summaries of failed requests, shared edits, project setup, Lean checks, editor and terminal connections, Lemex runs, and LaTeX builds. Repeated failures within a minute share an entry with a count. For compiler diagnostics or a run's full error, open the check output, project setup, or chat where it happened.
Choose Copy log to include the timestamps, actions, and failure codes in a report to your administrator or in a bug report. The summary omits API keys, file contents, prompts, and raw output. Reloading the tab or signing out clears the log.