/add
Adds one or more files to the chat so Aider can edit them or use them as detailed context.
/add adds files to the current chat session. Aider can only edit files that are in the chat. If a new file that doesn't exist yet is given to /add, Aider remembers the filename and writes to it later instead of accidentally changing an existing file. Besides the added files, Aider also uses a map of the whole git repo, so it's aware of code outside the chat too.
π¬ AS A SHORT VIDEO
Adds one or more files to the chat so Aider can edit them or use them as detailed context.
π THE SAME TASK (βADD FILE/FOLDER TO CONTEXTβ) ON OTHER PLATFORMS
β WHEN TO USE IT?
Make a file editable
/add payment.py β add the file to the chat before asking Aider to change it
Safely create a new file
/add utils/newfile.py before asking Aider to write a new helper function there β this way the change lands in the new file instead of an existing one
β WHEN NOT TO?
Adding many files just in case
Too much irrelevant code in the chat distracts the LLM; the docs recommend adding only the files actually needed.
Better: Add only the 1-2 truly relevant files and let the automatic repo map cover the rest
Only wanting to show a file as reference, not edit it
/add makes files directly editable β unnecessary if the file should only serve as context.
Better: Use /read-only to add the file for reference only
SOURCES
- Aider Docs β In-chat commands β aider.chat
- Aider Docs β Tips β aider.chat
MORE COMMANDS Β· Aider