The Code tab

A coding agent with a file explorer, a plan, and a diff before anything is written. This chapter covers the modes, the plan bar, the folder rules, the token limit note and the sign in.

What the Code tab is for

The Code tab is the agent from chapter 5 set up for one job: working inside a software project. It reads the codebase, writes a plan, edits files, runs your commands and tests, and shows you every change before it lands. The sidebar has two tabs at its top, "LU" for chat and "Code" for this; the header of the Code view reads "Coding Agent".

Its landing text says what to do: "Send a coding instruction. The coding agent will read your codebase, write code, and run commands." and, until you pick a project, "No folder picked. The agent works in ~/agent-workspace. Pick a project with "Select folder..." in the file tree panel on the right."

It needs Git. Without it the view shows "Git isn't installed. The coding agent needs it for diffs, commits and history." with an "Install Git" button.

Your first coding run

1 Pick the project folder

In the explorer panel on the right, click "Select folder..." and choose the folder that holds the project. The tree fills with its files ("Refresh" rereads it, "Empty directory" is what an empty folder shows). A folder chip at the top of the view names the folder; its x ("Remove the working directory") has the tooltip "Remove this folder. The agent falls back to (folder) until you pick a new one."

The same folder rules as in Agent mode apply: a drive root, your home folder or a system folder is refused, and only a folder you chose through the picker counts.

2 Choose a mode

The mode menu next to the message box has three entries; start with the first.

3 Describe the change

Say what should be different when the agent is done, and where, in plain words: the file or feature, the behaviour you want, the test that should pass. The agent writes a plan, then works through it step by step. "New" starts a fresh run in the same folder. A plain text file named .lurules in the project root is read on every run and appended to the agent's instructions word for word, so it is the place for project conventions such as "use 2-space indent" or "always run pnpm typecheck after edits". It is capped at 10 kB and only the root of the working folder is checked, not parent folders.

The three modes

ModeDescription in the menuUse it when
Ask permissions"Confirm commands, review edits before they land"Always, until you trust the model on this project.
Bypass permissions"Run without asking. Commands and edits land as they come"A throwaway folder, or a task you have watched the model do before.
Plan mode"Read only. Writes a plan, then waits for approval"You want to see the plan before anything runs.

In Ask permissions mode a command needs your ok before it runs: the dialog says the command "needs your ok" and has "Run" and "No"; "Accept without asking" runs this and every later command in the session without asking. Three settings under Settings, Agent, Coding Agent sit behind this: "Stage file_write changes (review before apply)", "Confirm shell & code commands (prevents prompt-injection from auto-running commands)" and "Code-Review mode (read-only)". In Plan mode the run stops after the plan with a bar reading "plan ready" and the button "Approve and run (Ask)".

The plan bar and the pending changes

While a run is in progress a bar reads "plan 3/8" with the current step. When it ends it says "every step done" or, if the run stopped early, "the run ended here, 5 of 8 steps done, 3 still open". A run that ended early can be continued by sending "continue".

Edits that were staged wait in a panel headed "Pending (N)". Each has "Apply" and "Reject", and "Apply all" and "Reject all" do the whole list. The diff shows what changes before you accept it. Until you apply, the file on disk is untouched. A "Review" badge in the header means "Code-Review mode (read-only)" is on: the agent inspects the codebase but writes no files and runs no commands until you switch it off in Settings.

If the model stops mid step, a note explains why: "The model ran out of tokens in the middle of this step, so it never sent the next tool call." followed by where the plan stands, and "Raise Max Tokens in Settings, or give the model a larger context, then send "continue"." That is a common way a local coding run ends, and the fix is the one the note names.

The folder rules

The folder cannot be changed while something runs. The chip's x explains: "A coding run is in flight. Wait for it to finish or press Stop, then you can change the folder." or "A loop is still running. Stop it first, then you can change the folder."

A folder the model names on its own is refused with "Not an allowed workspace folder (only a folder you chose in LU's folder picker can be a workspace, pick it again to allow it): (path)". Pick it through "Select folder..." and it is allowed.

Signing in for the hosted models

The Code tab runs on the local model you picked, or on a hosted one in Cloud mode. Cloud mode needs the LU Cloud account from chapter 8. Signing in happens under Settings, General, LU Cloud Account with "Sign in"; the account panel offers "GitHub" and "Google" as ways to sign in, opens your browser, and the app shows "Waiting for the browser…" with a "Cancel" button. The browser page then reads "Signed in" and tells you to close the tab and return to the app.

The GitHub sign in is a way to log into the LU account. It does not connect the desktop coding agent to your GitHub repositories; the agent works on the folder you picked, with your own git. The hosted studio in the browser has a separate "Connect GitHub" under its account settings that its own Code agent uses, which the hosted handbook covers.

When it goes wrong

"LU is waiting for a sign-in here, and this request was not it. Close this tab and start the sign-in again from LU." The browser opened the sign in callback address without the right ticket, for example from history. Start the sign in again from the app.

"no loopback port available (17872-17874)" followed by "close the app using them and retry". The sign in listens on one of three local ports and all were taken. Close the program using them, or wait a minute and try again.

"Sign-in was cancelled in the browser." You closed the browser tab or pressed Cancel. Press "Sign in" again.

The plan hangs at one step. Press Stop, read the note under the last step. If it is the token note above, raise Max tokens under Settings, General, Generation or pick a larger context in the dropdown above the message box, then send "continue". If it is a command waiting for your ok, answer the dialog.

"Cut off at the length limit" under an answer means the same thing: Max tokens was reached. Raise it and continue.

The agent edited the wrong files. Reject the pending changes ("Reject all") and repeat the instruction with the file names. Turn "Stage file_write changes (review before apply)" on under Settings, Agent, Coding Agent if it was off, so the next run waits for you again.


Previous chapter: Agent. Next chapter: Create. Back to the handbook overview.