diff --git a/aider/commands.py b/aider/commands.py index 13f267a12cc..ab5f121a84f 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -756,6 +756,7 @@ def cmd_add(self, args): if self.io.confirm_ask(f"No files matched '{word}'. Do you want to create {fname}?"): try: + fname.parent.mkdir(parents=True, exist_ok=True) fname.touch() all_matched_files.add(str(fname)) except OSError as e: