
Cursor Tutorial: Complete Guide to the AI Code Editor in 2026
Install Cursor on macOS, Windows, or Linux, then learn Tab, inline edit, Agent and Plan modes, rules, MCP, privacy, pricing, and what developers in Iran need to know.
Read MoreA practical Prime Agent guide: installing on macOS and Linux, signing in to a model provider, AGENTS.md, subagents, background work, MCP, and connecting a model on your own server.

Prime Agent is Prime Intellect's open-source agent for programming and research, designed for long-running work. It runs in the terminal, and in your project folder it reads and writes files and runs commands. What sets it apart from familiar agents is that the model does not get a list of separate tools; it gets exactly one: a Python environment that persists between turns. In that environment the model writes code to read files, run commands, keep large results in variables and split work between subagents.
This guide starts from zero: requirements and the account you need, installing, a first session, the project instruction file, safety, the everyday commands, subagents, background work, connecting outside tools, and running it unattended. Every command and name was checked on 28 September 2026 against the official Prime Agent repository and the launch article on the Prime Intellect blog. The project is new and changes quickly, so if a command behaves differently, check the linked documentation page.
Official Prime Agent launch artwork
Official Prime Intellect artwork. The numbers in the launch article describe those benchmarks, not a guarantee for your project and model.
Most coding agents give the model several separate tools: one to read files, one to edit, one to run commands. In Prime Agent the model only has the ipython tool: a persistent Python environment whose variables survive between turns. Everything, from reading and editing files to running project commands and managing working memory, happens through Python code. In practice, the model can keep a large error log or the file list of a big repository in a variable, search it, and read only the relevant slice instead of copying all of it into the conversation.
The project's two main ideas are:
rlm.spawn(...). Each subagent has its own session, does independent work, and sends its result back to the main agent as a message or writes it to a file./refine command reviews the session's trajectory and can add small, evidence-backed lessons to supplemental instructions, memory or skill descriptions. According to the documentation, the base system prompt is never rewritten, and every change is recorded as a snapshot you can roll back to.Prime Agent suits long jobs: examining a large repository, multi-step research, running model evaluations, or work that must continue after the terminal closes. For a short one-file fix, simpler tools such as Claude Code, Codex or OpenCode usually get there faster. The project is released under the MIT licence and is built on the open-source pi tool.
According to the quickstart and the providers page:
The official install command installs the latest stable release:
curl --proto '=https' --proto-redir '=https' -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh
The --proto options make sure the download and any redirect happen over HTTPS only. To try the latest beta built from the main branch, -s -- beta is added to the end of the same command. Both commands fetch published release artifacts and install the prime-agent command. Before running a script piped straight into a shell, read it.
The documentation also has a second route for running from source, which needs Node.js 22.8.0 or later:
git clone https://github.com/PrimeIntellect-ai/prime-agent
cd prime-agent
npm ci
./prime-agent.sh
After installing, open a new terminal window and check the install:
prime-agent --version
prime-agent status
prime-agent doctor
The first command prints the version, the second shows the state of the background services, and the third finds problems with them. prime-agent doctor --fix also repairs them; run it without --fix first to see what it wants to change. To update, run prime-agent update.
Go to your project folder and start Prime Agent:
cd /path/to/project
prime-agent
Inside the program, type /login and pick a provider. If you have an API key, you can put it in an environment variable before starting, for example ANTHROPIC_API_KEY. Keys and sign-in tokens are stored in ~/.prime/agent/auth.json, which only your own user can read. The documentation also offers a way to avoid keeping a key as plain text: a key value in that file can be a command starting with ! that reads the key from the system keychain or a password manager.
Official Prime Agent terminal interface
Official view of the terminal interface from the Prime Agent launch article.
At the start, only ask questions and change nothing yet. A few good first requests:
Prime Agent works in the folder it was started from and can change the files there. Before the first real change, make sure the project is under git and git status shows no unsaved changes; better still, create a separate copy or a clean working branch with git worktree for the agent. Typing @ in the editor attaches a file to your request. !npm run lint runs a command and passes its output to the model, and !! does the same without sending the output to the model. Sessions are saved automatically under ~/.prime/agent/sessions/; prime-agent -c continues the most recent session and prime-agent -r opens the session list.
Prime Agent reads instruction files at the start of every session. According to the usage page, they are loaded from three places:
~/.prime/agent/AGENTS.md for your personal instructions across all projects;In the current folder and the folders above it, an AGENTS.md or CLAUDE.md file is read; so if the project already has instructions for another tool, Prime Agent uses them too. A short example:
# Project instructions
- Run npm run check after every code change
- Do not run production migrations locally
- Never edit generated files under src/generated/; run npm run generate
- Persian UI strings live in locales/fa.json; keep Persian digits
- Done means: checks pass and the git diff has been reviewed
After changing this file, restart the program or run /reload. The --no-context-files option turns off reading these files. If you want to replace the base system prompt entirely, a SYSTEM.md file in the project's .prime/agent/ or in ~/.prime/agent/ does that, and APPEND_SYSTEM.md only adds to it. Remember that instructions are guidance, not a lock; the model usually follows them, but they do not reliably stop any command. Never put passwords, tokens or API keys in this file.
Know the most important practical point of this section up front: in the documentation we checked, Prime Agent has no permission mode like the tools that ask you before editing a file or running a command. According to the RLM programming model page, the agent's Python environment runs model-generated code and project commands with your user account's permissions. The separate background processes exist for stability and recovery, and the documentation says plainly that they are not a security sandbox.
Official Prime Agent architecture diagram
Official architecture diagram. Separate processes help work continue and recover, but they do not stop malicious code.
So you have to take control from outside, in these ways:
--no-extensions, --no-skills and --no-context-files options turn off loading extensions, skills and instruction files, and --no-tools disables all tools.permission-gate.ts to block dangerous commands, protected-paths.ts to prevent writes to specific paths, and dirty-repo-guard.ts to warn about a repository with unsaved changes.Extensions, skills and packages themselves also run with your account's full permissions. Install them only from sources whose code you have read. Any instruction the agent reads in a ticket, a document, an error log or a web page may be malicious; an instruction being read does not make it authorised. For a deeper discussion, see AI tool permission security.
Inside the program, any message starting with / is a command. Outside it, a few command-line commands manage your agents. All of these appear on the usage page:
| Command | Use |
|---|---|
/login and /logout | Manage sign-in and keys |
/model | Change the model |
/effort | Set the model's reasoning level |
/new | Start a new session |
/resume | Continue an earlier session |
/tree and /fork | Jump to an earlier point in the session, or start a new session from it |
/compact | Summarise the conversation to free working memory |
/usage | See token, cost and working-memory usage, broken down by subagent |
/refine | Refine or roll back the supplemental instructions |
/reload | Reload instructions, skills and extensions |
prime-agent agents | See running and saved agents |
prime-agent attach <agent> | Reconnect to an agent working in the background |
prime-agent stop <agent> | Stop one agent |
prime-agent shutdown | Stop every agent and background service |
prime-agent model list | List available models |
When a conversation gets long and answers get worse, /compact or a fresh start with /new usually beats carrying on. After the conversation is summarised, restate the important constraints; a summary can drop details.
With an agent that can spread work across several subagents, a precise request matters even more. Say what the job is, which parts are only read and which may change, what must not be touched, and what signal counts as done. Put these two side by side:
The second request splits the work between subagents and keeps the line between reading and writing clear. Because Prime Agent has no separate planning mode by default, and the repository only ships an example extension for one, you have to write that line into the request itself. For bigger tasks, this order works:
git diff, just as you would a new colleague's code./tree and /fork as ways to move around the conversation history, not to restore files. Then make the request more precise.Use subagents only for genuinely independent work. If several subagents write to the same files at once, they spoil each other's work; either they only read, or each gets its own working branch. Subagents also cost money and time, and /usage shows each one's share.
Official Prime Agent agents view
Official view for managing agents and persistent sessions.
Prime Agent sessions run in background processes, so closing the terminal does not stop the agent; it only detaches you from it. According to the long-running and background agents page, there are four features for long work:
/goal keeps a goal active across turns until it is completed, paused or cleared; for example /goal --budget 200000 Complete the repository migration with a token cap. /goal status, /goal pause and /goal clear manage its state./heartbeat every 10m Check the deployment and report meaningful changes sends a recurring instruction to the session every ten minutes.prime-agent schedule add worker "in 30m" -- "Check the benchmark result" once, and prime-agent schedule add worker "0 9 * * 1-5" -- "Review open work" at 9 a.m. on every weekday, send a prompt to an agent named worker./autonomous on --gate "npm run check" --gate-retries 2 keeps the agent going without you until the check command passes or a limit is reached.The default autonomous limits are three automatic continuations, twelve responses, 80,000 tokens and thirty minutes. If you name no limit, these defaults apply; but if you set only some limits, the rest become unlimited. Take the documentation's key point seriously: reaching a limit does not mean success, and a passing check command proves only what that command actually checks. If you make every limit unlimited and give no check command, the agent has no automatic stopping point. Stop work you no longer need with prime-agent stop <agent>.
Prime Agent does not turn MCP servers into new tools for the model. According to the MCP integrations page, every service is reached through one Python module called mcp. /plugins or /mcp opens a screen where you search for a service such as Linear or Notion and connect it by signing in through the browser. Credentials stay on your own machine in auth.json, and the agent does not show a service as "connected" until a real handshake with the server succeeds. Once connected, the model uses it like this:
# Discover the server's tools first, then call one
tools = await mcp.list_tools("linear")
result = await mcp.call_tool("linear", "list_issues", {"team": "Engineering"})
Skills are packages of instructions and helper code for a specific task. According to the skills page, they load from ~/.prime/agent/skills/ and the project's .prime/agent/skills/, and are invoked with /skill:name. Three skills ship with the program: prime-intellect for working with that company's products, skill-creator for building new skills, and websearch for web search through the Serper service. Packages bundle extensions, skills and templates, and install with a command such as prime-agent package install git:github.com/user/repo@v1. The documentation says plainly that packages run with full system access; read their code before installing and install a specific version. We cover the secure architecture for these connections in MCP integration architecture.
Once a task has worked a few times interactively, you can run it from a script or a CI pipeline. The -p option runs the request, prints the answer and exits:
# One-off question
prime-agent -p "Summarize this codebase"
# Pipe text in
cat README.md | prime-agent -p "Summarize this text"
# Bounded unattended run that must pass the project check
prime-agent -p \
--autonomous \
--autonomous-gate "npm run check" \
--autonomous-max-continuations 3 \
--autonomous-max-turns 12 \
--autonomous-max-tokens 80000 \
--autonomous-timeout-ms 1800000 \
"Fix the failing check and report the verified result."
To connect to other programs, --mode json prints every session event as JSON lines and --mode rpc provides communication over standard input and output. --no-session does not save the session, and --offline only turns off network operations at startup, such as the update check; it does not make the model offline. In an unattended run nobody is there to stop the work, so run it inside a container, give it no keys or production access, and review the output before merging.
If you would rather keep your code and prompts off cloud services, or want cost and model choice in your own hands, Prime Agent can connect to a model on your own server. According to the custom models page, for Ollama, LM Studio or vLLM it is enough to write something like this in ~/.prime/agent/models.json:
{
"providers": {
"ollama": {
"baseUrl": "http://localhost:11434/v1",
"api": "openai-completions",
"apiKey": "ollama",
"models": [
{ "id": "llama3.1:8b" },
{ "id": "qwen2.5-coder:7b" }
]
}
}
}
The apiKey value is required but Ollama ignores it. If your server does not understand the developer role or the reasoning_effort option, the documentation says to set supportsDeveloperRole and supportsReasoningEffort to false in the compat section. The file is re-read every time you open /model. A model you run on your own server should be tested on real work with subagents too, not just on one short question. To choose a model, see Qwen3.8, GLM-5.2 and DeepSeek-V4 for coding.
An agent that works for hours in the background and spawns subagents needs more care in a team. Before you give it to every developer, settle these points:
AGENTS.md in git with the build and test commands and forbidden actions;/usage;If you want to roll out coding and research agents for your organisation's team, on the model you choose, with an isolated runtime and clear rules for cost and review, talk to us: call +98 901 555 5651 or message us on WhatsApp. You can also read about the service on the AI and coding-agent training for teams page.
Every command and setting in this guide was checked on that date against these official pages:

Install Cursor on macOS, Windows, or Linux, then learn Tab, inline edit, Agent and Plan modes, rules, MCP, privacy, pricing, and what developers in Iran need to know.
Read More
A practical GitHub Copilot CLI guide: installing on macOS, Linux and Windows, instruction files, tool permissions, plan and autopilot modes, MCP, scripted use, and connecting your own model.
Read More
A practical guide to Google's Antigravity CLI: installing on macOS, Linux and Windows, AGENTS.md, permissions and the sandbox, daily commands, MCP, and headless runs.
Read MoreIf you want the agents and automation in this guide working for your engineering team or business processes, start with a small pilot you can measure.