LatentCodeGet started
Quickstart
Install LatentCode, connect it to your gateway, and have it make and verify a change in your project.
Before you begin
- A LatentStack account and an API key. Your key starts with
ls-; copy it, or generate one, under API Key on your Account page. - macOS, Linux or Windows, and a terminal.
- A project to work on. A git repository is best: undo and diffs use git.
1. Install
curl -fsSL https://latentstack.dev/install.sh | bashThe installer puts latentcode in ~/.latentcode/bin, adds it to your PATH, and points it at this gateway. Open a new terminal and check it:
latentcode --versionSee Install for other options.
2. Connect
Save your API key. LatentCode checks it against the gateway and imports the models your tier allows:
latentcode config set api-key ls-your-key✓ API key saved → ~/.config/latentcode/latentcode.jsonc
✓ Imported 24 model(s) (tier: standard)If you skip this, the TUI asks for the gateway URL and key the first time you start it, in a Connect LatentRouter dialog. Check the connection at any time:
latentcode config/v1:latentcode config set base-url https://latentstack.dev/v13. Start a session
cd ~/src/my-project && latentcodeThe TUI opens with a prompt at the bottom. The line under it shows the agent (Build), the model, and how much context is left. Press ctrl+x m to pick a different model.
Start by asking about the code. Nothing is changed while it answers questions:
> Give me an overview of this project: what it does, how it's laid out, and how to run the tests.4. Make a change
- 1Plan it
Press tab to switch to the Plan agent, which can read but not edit. Describe the change:
> Add input validation to the signup handler: reject empty emails and passwords under 8 characters, with a clear error message.It investigates and replies with a plan. Ask follow-up questions until you're happy with it.
- 2Build it
Press tab to go back to Build and say
go ahead. The agent edits the files and runs your tests. Each edit appears in the conversation as a diff, and the sidebar (ctrl+x b) lists every modified file. - 3Answer any approval requests
If it needs to do something outside the defaults, such as install a package or touch a
.envfile, it stops and asks. Choose Yes, allow once, allow it for the rest of the session, or No and tell it what to do instead. See Permissions. - 4Review the result
Type
/diffto open the diff viewer on your working tree: n/p move between files, ]/[ between changes, q closes it. For a second opinion, run/review: reviewers check your uncommitted changes and report problems. - 5Keep it, or undo it
Commit as usual, or ask the agent to. If you don't like the change,
/undo(ctrl+x u) removes your last message and restores the files it changed./redobrings it back.
5. Teach it your project
Run /init. LatentCode studies the repository and writes an AGENTS.md at its root with your build commands, conventions and structure. Every session reads it, so commit it for your team. See Rules.
Next steps
- Common workflows: fixing bugs, writing tests, reviewing pull requests.
- The TUI: file references, shell commands, images and sessions.
- Goals and loops: let it keep working until a condition is met.
- latentcode run: use it from scripts and CI.