AI Assistant's edit_file Functionality Limited

Thanks for reporting a bug you have found in Cursor!
Please add the following info to help us diagnose your issue:

File Attachment Requirements Limiting AI Assistant’s edit_file Functionality

Description

The AI assistant’s edit_file tool is currently limited by a requirement for files to be “manually attached” to the conversation. This creates unnecessary friction in the workflow and forces fallback to terminal commands requiring manual approval.

Current Behavior

  1. edit_file tool works for creating new files
  2. edit_file fails silently when trying to modify existing files
  3. Error message indicates files need to be “manually attached to the conversation”
  4. Forces fallback to terminal commands with require_user_approval

Expected Behavior

Files in the workspace should automatically be available for the AI assistant to edit using the edit_file tool, while maintaining appropriate security boundaries.

Steps to Reproduce

  1. Create a new file using edit_file - works successfully
  2. Try to modify the same file using edit_file - fails silently
  3. Read file shows message: “File is not in the list of files that have been manually attached to the conversation”

Impact

  • Reduces efficiency of AI assistant interactions
  • Creates inconsistent behavior across chat contexts
  • Forces use of less secure terminal commands
  • Requires more user intervention

Suggested Solution

Implement automatic file attachment for:

  1. Files created in the workspace
  2. Files opened in the editor
  3. Files modified through any workspace tool

This would maintain security (files still within workspace) while improving workflow efficiency.

Environment

  • OS: macOS 24.3.0
  • Shell: /bin/zsh

:white_check_mark: Check the forum to ensure the issue hasn’t been reported already
:lady_beetle: Provide a clear description of the bug
:arrows_counterclockwise: Explain how to reproduce the bug (if known)
:camera: Attach screenshots or recordings (e.g., .jpg, .png, .mp4).
:computer: Tell us your operating system and your Cursor version (e.g., Windows, 0.x.x).
:no_entry_sign: Tell us if the issue stops you from using Cursor.

This should work - try starting a fresh Composer session (Cmd/Ctrl + Shift + P, then “Composer: New Session”) as it might be the AI getting confused with tool calls