From 8d8958ff79ec21ce1b2a1802c6eb759d467bc5ae Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 7 Jan 2026 16:55:40 -0400 Subject: [PATCH] feat: Save new discussions in discussions/ subdirectory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When creating a discussion without an explicit output path, files are now saved to discussions/ subdirectory instead of current directory. The directory is created automatically if it doesn't exist. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/discussions/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/discussions/cli.py b/src/discussions/cli.py index a7c81c5..064aafc 100644 --- a/src/discussions/cli.py +++ b/src/discussions/cli.py @@ -27,7 +27,10 @@ def cmd_new(args) -> int: else: slug = args.title.lower().replace(" ", "-") slug = "".join(c for c in slug if c.isalnum() or c == "-") - path = Path(f"{slug}.discussion.md") + path = Path("discussions") / f"{slug}.discussion.md" + + # Ensure parent directory exists + path.parent.mkdir(parents=True, exist_ok=True) if path.exists() and not args.force: print(f"Error: {path} already exists. Use --force to overwrite.")