LaCorTeX
DocsThe agent

Asking for a change

How to phrase a request so the diff comes back the size you wanted.

7 min readUpdated 23 November 2026

The agent is not a chat window that happens to sit beside your editor. It reads your project and edits specific files, then hands you a diff of everything it touched, to keep or to put back. That review step is the whole design: you are the one who decides what your paper says.

1Open the agent

Press ⌘ J. The chat input sits at the bottom of the editor pane rather than in a separate window, so a conversation about your manuscript happens beside the manuscript.

2What it can see

Not your whole project, and not by default. The agent asks for what it needs, one call at a time, and each call is visible in the transcript as it happens:

  • list_files, for what is in the project.
  • read_file and read_file_lines, for a whole file, or a range when a range is enough.
  • search_in_files, to find a phrase, a label or a command across the project, optionally filtered to .tex or .bib.
  • search_arxiv and insert_citation, covered in Searching arXiv.
  • apply_edit, to change one file. This is the only tool that writes anything, and every write it makes is tracked for review.
What leaves your machine
Only what a given call needs. Compilation is local and sends nothing; the editor sends nothing on its own. An agent turn carries the slice of context that turn asked for, to an endpoint required to retain none of it. If no such endpoint exists for the model you picked, the turn fails rather than falling back to one that would keep your work.

3Phrasing a request

The single biggest lever on diff quality is naming the scope. The agent will happily rewrite a section when you meant a sentence, and the fix is not a better model. It is a more specific sentence from you.

✓  Tighten the second paragraph of §3.2. Keep the citations.✓  In main.tex, change every \citep to \citet in the related work.✓  Add a lemma before Theorem 2 stating that the bound is tight.✗  Improve the paper.✗  Fix my writing.
Name the file, the section, and what must not change.
  • Say what to preserve. "Keep the citations", "do not touch the notation", "leave the equation numbering alone" all work, and they are cheaper than rejecting a diff and starting again.
  • One thing at a time. Three requests in one message produce one large diff that is harder to review than three small ones.
  • Point at the text. Quoting the sentence you mean removes the search step and the ambiguity at once.

4Reviewing the diff

The agent writes as it works rather than queueing everything behind a prompt, so the turn runs to the end without stopping to ask. What it changed is then shown in the file itself: the editor opens a diff against the content from before the turn started, and each block carries its own accept and reject in the gutter. Changed files are marked in the explorer, and the chat panel offers accept and reject for a whole file or for the whole turn.

  • Accept keeps what is there and stops tracking the file. The content does not change; you are only saying you have read it.
  • Reject writes the file back to how it was before the turn. If the agent created the file, rejecting deletes it.
  • ⌘ Z works throughout. An agent edit undoes like anything you typed, and so does a reject.
Review markers do not survive a restart
The edits do; they were written to disk as they landed. What is lost on quitting is the set of markers: which files are still unreviewed, and the one-click way to put them back. Review the turn before you close the app, or lean on ⌘ Z and git.

Rejecting costs nothing and tells the agent nothing. If the diff was close but wrong, say what was wrong rather than rejecting in silence.

5Rewriting in place

For a sentence or a paragraph, you do not need the chat at all. Select the prose (more than a few words, less than a couple of pages) and the rewrite popup appears. Describe the edit and it lands in the same place, reviewable the same way.

No keyboard shortcut yet
Inline rewrite is a selection gesture, not a chord. A dedicated key is reserved for the day it can also generate at the cursor with nothing selected.

6When it goes wrong

  • The diff is too big. Reject it, and re-ask naming a narrower scope. You will spend less time than reviewing it.
  • It edited the wrong file. Name the file explicitly. In a project with intro.tex and introduction.tex, so would you.
  • It keeps going. A turn has an iteration cap, so a loop stops itself rather than running until something else notices.
  • It broke the build. That is recoverable and normal: compile, read the errors, and send them back. Reading compile errors covers the one-click version.
Previous
← Packages and CTAN
Next
Reviewing diffs →