惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
博客园 - Franky
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
Last Week in AI
Last Week in AI
腾讯CDC
F
Full Disclosure
T
Tailwind CSS Blog
量子位
N
Netflix TechBlog - Medium
Stack Overflow Blog
Stack Overflow Blog
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
SecWiki News
SecWiki News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
宝玉的分享
宝玉的分享
S
Schneier on Security
D
DataBreaches.Net
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
Google Online Security Blog
Google Online Security Blog
IT之家
IT之家
H
Hacker News: Front Page
T
Tor Project blog
H
Help Net Security
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
Help Net Security
Help Net Security
V2EX - 技术
V2EX - 技术
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
AI
AI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Agentic Coding with Cursor
Attilio Caro · 2026-04-24 · via DEV Community

Cursor is an AI-assisted IDE with AI features baked-in, such as agent-based coding assistance, predictive autocomplete, and MCP support. It is a fork of Visual Studio Code, bringing a familiar environment with AI functionalities built directly in the editor.

It can quickly speed up your development process, allowing you to discuss your codebase with the agent in natural language, request modifications, plan architectural changes, schedule repetitive multi-step tasks and so on.

Let’s look at how these capabilities fit into day-to-day development, what Cursor changes compared to a standard editor setup, and how to start using its AI features effectively.

Working with Agents

The main interface in Cursor is the Chat window, where you can prompt the coding agents.

Cursor Chat Window

By default, the Chat will be in Agent mode, so the agent will directly go ahead and write code as you write prompts.

You can switch mode by using the dropdown on the bottom left.

Chat Modes

When you want to make larger changes, such as defining the architecture of your project, or a larger refactor, switch to Plan Mode. This lets the agent create a plan, analysing the codebase and asking questions, before it goes ahead and actually writes code.

If you just want to discuss your codebase with no intention to make changes to it, you can switch to Ask mode.

Finally, Debug Mode allows you to focus on bugfixing, by letting the agent analyse your log files. You first describe the bug, and the Agent will create a few hypotheses as to why it might be happening. It then adds relevant log lines in the codebase to test those, and asks you to reproduce the bug, while it checks the logs in real time. It then validates those hypotheses and attempts to generate a fix.

Cursor shows its reasoning while the agent is working. If you see something that does not make sense, or it’s not what you intended, you can stop it and send another prompt to steer it in the right direction. After the agent makes changes, you can choose to Keep them, Undo, or Review them.

You can also drag images into the chat window, to provide examples of what you are looking for, design ideas and sketches, or even screenshots and visual bugs in your application. In my experience, Cursor can reliably make sense of them with relatively little context.

In the Cursor Settings, under Agents > Context, you can define whether Cursor should be able to search the web and fetch content remotely.

Cursor Web settings

In some cases, Cursor will need to run CLI commands, such as curl or head, to fetch files or manipulate directories. The agent will then stop and wait for you to approve it. You can choose to whitelist that command directly from the chat, or you can do it beforehand from Cursor Settings > Auto-Run > Command Allowlist.

CLI Allowlist

You can duplicate a chat, for example if you want to fork it and try different approaches, by pressing the … button at the bottom of the chat and selecting Fork Chat. This tends to use a high number of tokens, again because every prompt will carry over the whole chat as context, so consider whether it’s better to just create a new chat and provide just the context you require. Alternatively, you can rollback a conversation by pressing the arrow icon on an earlier prompt.

You can review and resume past chats from the Agents window, on the left. Cursor stores chat transcripts in the ~/.cursor/projects//agent-transcripts/ folder.

Models and Token Consumption

When working with agents, you have the option to select which model you’d like to use to run inference and generate code. Each model will offer a different balance between accuracy, speed, context window size, and pricing.

By default, Cursor sets the Model to Auto, which means it will pick a model best suited for your task. You can override that by unselecting Auto, then picking a specific model from the list. Cursor offers its own model, called Composer 2, but you can select other models such as Claude Sonnet/Opus or GPT.

Model Selection

Go to Settings > Cursor Settings > Models to see what models are available and enabled. From there, you can also set up API keys for each provider.

Each model will have a different pricing structure. You can check each model pricing here.

In order to save tokens, you can switch between models depending on the task complexity. For example, you can use a more powerful model to plan out the work, then pass the output to a cheaper model to write the code.

Whenever you make a request to the agent, you will consume tokens. You can go to https://cursor.com/dashboard/usage to see how many tokens you consumed on each day, and other API billing information.

Context

The context is where your agent stores information regarding the current session, including details about your codebase, the chat history, skills descriptions, rules and so on. Think of it as a cache.

As the chat goes on, the context window keeps filling up. Different models will have different context window capacity. You can see how much it’s currently used up on the bottom right of the chat window.

Context Usage

The results you get from the agent will start to deteriorate as the context gets full. Token usage will also increase, as the agent needs to process a larger set of information during the chat. For this reason, it’s recommended to keep chats brief, and start a new one whenever you move to a different feature and the previous context is no longer needed.

If you prefer to keep the same chat going, you can use the /summarize command to let Cursor compact the current conversation, reducing the size of its context.

If you need some specific information to always be available in the Context between chats, you can use a rule for it, as I will explain shortly.

Commands

Commands are essentially saved prompts. They are a good fit for repeatable tasks that don’t need additional context.

Commands are normally invoked manually, while Skills are autonomously initiated by the agent. In the chat window, you can type @ and select a command. For example, you can use @branch to let Cursor review all changes in the current branch against the main branch.

You can define custom commands by creating a .md file in the .cursor/commands folder. For example, here is a command I created to validate a list of sheets references:

Check all the Google sheets listed in the sheetsConfig file, and validate that they exist, are publicly accessible, and are in the correct format.

Rules

Rules provide additional, reusable context to the agent prior to every interaction. They are useful to define team conventions and coding style for example. This saves you time as you don’t need to provide this information every time you start chatting with the agent.

You can create a rule by going to Cursor Settings > Rules, Skills, Subagents > Rules, selecting New and choosing which type of rule you want to add. Project Rules are meant to be stored in version control and used by everyone working in the project, while User Rules are meant only for your workspace and session.

You then write a title, the rule body, and specify whether the rule should always apply, or just when the agent is working on specific files.

For example, here is a rule I created to ensure the agent creates reactive visual element layouts:

Rule Setup

When you are done, the new rule will be stored in the .cursor/rules folder.

Skills

Skills provide specialised capabilities to the agent, including domain specific knowledge and documentation, scripts, and assets. Skills in Cursor follow the open standard, so you can port your skills from and to other AI tooling such as Claude Code, acquire them from the marketplace, and so on.

When a new chat starts, the agent checks the list of skills just so it is aware of what is available, without actually loading the whole content into its context. Then, during the conversation, if it determines that a skill might be a good solution to a particular problem, it loads it up into the context and runs it. You also have the option to explicitly run a skill by using the / command, similarly to Commands.

You can define new skills by adding them into the .cursor/skills/ folder, with the name of the skill as the folder name, a SKILL.md describing the skill, and optionally additional reference, scripts and asset files. For example, here’s how a skill directory to upload files to AWS S3 looks like.

Skill Setup

And here’s how the actual skill looks like:

---
name: upload-to-s3
description: "Deploy provided assets to a S3 bucket"
disable-model-invocation: false
---

# Upload to S3

Deploy assets to a S3 bucket using the provided scripts.

## Usage

Run the S3 upload script: `scripts/upload-to-s3.sh <bucketname>`

## Pre-upload Validation

Before deploying, run the validation script to ensure you have access to the bucket: `scripts/validate-s3-bucket-access.sh <bucketname>`

Enter fullscreen mode Exit fullscreen mode

You can use the disable-model-invocation parameter to define whether the skill can be invoked by the agent directly. If that is set to true, the skill will only run when invoked manually using the / command.

Hooks

Hooks allow you to run automated checks when certain events occur, such as when the agent is done editing your code, a new session is created, or after a shell command is executed. They are useful for example to ensure no secrets, credentials, or PII have been added to the project.

You can define hooks in a .cursor/hooks.json, either within your project or in your home directory (for global hooks).

Hooks can either run commands, defined in shell scripts, or prompts. Here is an example where we check for secrets whenever a file is edited using a shell script, and ask the agent to check if the project still adheres to our styling guideline when a subagent session ends.

{
  "version": 1,
  "hooks": {
    "afterFileEdit": [
      {
        "command": "./hooks/check-secrets.sh"
      }
    ],
    "subagentStop": [
      {
        "type": "prompt",
        "prompt": "Ensure the new code adheres to the project styling guidelines",
        "timeout": 20
      }
    ] 
  }
}

Enter fullscreen mode Exit fullscreen mode

For more complex scenarios, you can have hooks execute Typescript code.

Subagents

Subagents are launched from the main agent to run specialised tasks. They start with an empty context and receive a prompt from the main agent.

They allow you to run specialised workloads using fewer tokens by using a specialised model that is focused on that individual task.

Cursor comes with three subagents built-in - Explore to analyse your codebase, Bash to run CLI commands, and Browser to fetch and retrieve results from the internet.

You can create custom subagents by adding a markdown file in the .cursor/agents/ folder. You can also request the agent to create one for you directly.

Each subagent contains a header with some metadata, then an actual prompt, as shown below:

---
name: physics-performance-auditor
description: Used when integrating Physics game logic. Ensures usage does not introduce performance issues.
model: inherit
readonly: false
is_background: true
---

You are a senior physics programmer auditing code for performance.

When invoked:
1. Ensure Physics logic is correct
2. Ensure it does not introduce CPU bottlenecks
3. Ensure it does not use old or deprecated ApiS

Report up to 10 findings, sorted by severity.

Enter fullscreen mode Exit fullscreen mode

The is_background field defines whether the sub-agent runs in the Foreground, so the main agent will wait for it to complete its task, or in the Background, where the main agent will carry on while the sub-agent does its work in parallel.

You can define whether the subagent should be able to make modifications to the project by setting the readonly flag. If that is true, it will just present its findings in the chat window.