# Elements and Cursor Cursor is an AI code editor from Anysphere, and it is one of the best places to write code with an agent. It is built on the VS Code codebase, so it feels familiar from the first minute, and it brings your VS Code settings, keybindings and extensions across in one step. At its center is Agent, which takes a task and carries it through: it searches the codebase, edits files, runs terminal commands and drives a browser to check visual changes, with a choice of models. Cursor also has a command line agent and agents that run in the cloud. Elements and Cursor make each other better. Agent writes the app in Cursor, and Elements, the integrated app environment, builds, checks and deploys it, so the app runs correctly from the start and keeps running. Errors from type checking, tests, migrations and program analysis all surface within milliseconds of a save, and Elements puts a release live only after the build is clean and every test has passed ([build](/learn/man/build), [deploy](/learn/man/deploy/what-happens)). Elements makes the environment Cursor's agent builds in, not an editor, a model or an agent. Elements works well with agents because it has a manual baked into the binary. Elements is licensed per machine, and nothing Agent does in a project is metered ([pricing](/pricing)). ## Cursor Is Set Up When You Install Elements Installing Elements sets up Cursor with nothing to configure, and reinstalling keeps it current ([VS Code](/learn/man/editors/vscode)). There is nothing to find in a marketplace. In an Elements project, Cursor gets diagnostics, completion, hover, rename, references, go-to-definition and symbol search in TypeScript, Elements HTML templates, `.jsoc` config and CSS ([editors](/learn/man/editors)). The editor runs the same checker as the build, so the squiggle in a file and the error in `elements build -json` are the same error. Outside a project nothing changes, so your other work in Cursor is untouched. ## A New Project Is Ready From the First Task `elements create` makes a project Cursor's agent can build in from its first task ([start](/learn/man/start)). Agent knows what the project already includes, so it builds on the bundler, test runner and migrations that ship with Elements instead of adding its own, and it checks each edit as it goes. ## One Command Reports Every Mistake Agent checks its work by running shell commands in your terminal and reading what comes back. In a typical project that is three tools to call and three output formats to parse: the type checker's, the test runner's and the migration tool's. In an Elements project Agent runs `elements build -json` and reads one structured reply listing every build error with its file, line and column ([build](/learn/man/build)). Those are the same positions Cursor underlines in the editor. A broken migration sits in that list next to a type error and a failing test, since the same build ran all of them. The reply always describes the file Agent just saved, never the code as it was a moment earlier. ## One Project Server for the Editor and the Agent The squiggles and the command answer from the same place: a project server that runs while you work and keeps running between commands. It holds the build graph and build state in memory, so on every save the build state is updated almost instantly, redoing only what the change touched and hot reloading the running app ([build](/learn/man/build)). It builds in milliseconds and answers agents and humans in microseconds. Cursor, your terminal and each agent share that build state ([build](/learn/man/build)). Run several Cursor agents on one project and every one of them builds on the others' latest edits. ## Seeing the App in Cursor Cursor's agent can drive a browser to take screenshots and test an app. `elements start` serves the app, Agent opens it in that browser, and every save hot reloads the page it has open ([start](/learn/man/start)). Everything the app writes, request-time errors included, goes to a log the agent can read ([build](/learn/man/build)). ## Questions ### Does the Elements extension work in Cursor? Yes. Installing Elements sets up Cursor with nothing to configure, and reinstalling keeps it current. In an Elements project, Cursor gets diagnostics, completion, hover, rename and go-to-definition from the same checker the build runs. ### Is Elements a Cursor alternative? No. Cursor is where you and Agent write the code. Elements is the environment that code is checked, built and deployed in: the language server behind the editor, the project server, the test runner, a bundled Postgres database and a deploy command. Elements builds the environment, and Cursor is a superb editor to build in it. ### How does Cursor's agent check its work in an Elements app? It runs elements build -json in the terminal. The reply lists every build error, from type checking to failing tests and migration problems, each with a file, line and column, and the project server has already built the latest save, so it comes back in microseconds.