Tab and Cmd+K work on single files. Composer works across your entire codebase — it can create new files, modify existing ones, and implement features end-to-end with one instruction.
A complete feature built with Composer: a user authentication system with login/logout endpoints, a session model, and middleware — all generated across multiple files from a single description.
Cursor has three AI interaction modes. Knowing which to use saves time and frustration.
Tab Completion Use for: typing code (passive, always on) Good at: completing patterns, next edit prediction Cmd+K (Inline Edit) Use for: modifying selected code Good at: targeted transformations (add error handling, refactor, add types, write tests for this function) Chat (Cmd+L) Use for: questions, understanding, debugging Good at: explaining code, diagnosing bugs, getting advice Composer (Cmd+Shift+I) Use for: multi-file feature implementation Good at: "build X feature," "add Y capability to the project" Think of it as: you describe the feature, Composer writes the code across all necessary files
Composer works best when you give it: the goal, the relevant context, and the constraints. Vague prompts produce code you'll spend more time fixing than if you'd written it yourself.
# Weak — too vague "Add authentication" # Strong — specific constraints and context "Add JWT-based authentication to this FastAPI app. Create: - POST /auth/login: accepts email + password, returns JWT token - POST /auth/logout: invalidates the token - GET /auth/me: returns current user info (requires valid token) - A User model in database.py with: id, email, hashed_password - A verify_token dependency for protected routes Use python-jose for JWT, passlib for password hashing. Token expiry: 24 hours. Don't modify existing endpoints."
The constraints ("don't modify existing endpoints") are as important as the requirements. Composer will try to help with everything it thinks is related — be explicit about boundaries.
Open Composer with Cmd+Shift+I. Use this prompt on the FastAPI project from earlier in the course:
Add a user management system to this FastAPI app. Create: 1. models.py: User model (id, email, hashed_password, created_at) 2. auth.py: password hashing with bcrypt, JWT token creation/verify 3. routes/users.py: POST /users (register), POST /auth/login, GET /users/me (protected) Requirements: - Use existing database.py for SQLAlchemy session - Use python-jose for JWT, passlib[bcrypt] for passwords - Return 409 if email already exists - Don't change main.py (just tell me what to add to it) Existing files: @main.py @database.py
Composer will generate a diff showing every file it wants to create or modify. Review each change before accepting. If a file looks wrong, you can edit the prompt and regenerate just that file.
Review everything. Composer produces working code surprisingly often — but "working" means "runs without errors," not "does exactly what you meant." Read every file it generates. This takes 10 minutes and prevents 2 hours of debugging later.
Before moving on, make sure you can answer these without looking: