diff --git a/README.md b/README.md index 45f21aa..7aa699c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1873 TILs and counting..._ +_1874 TILs and counting..._ See some of the other learning resources I work on: @@ -172,6 +172,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Monitor Usage Limits From CLI](claude-code/monitor-usage-limits-from-cli.md) - [Open Current Prompt In Default Editor](claude-code/open-current-prompt-in-default-editor.md) - [Resume Specific Session](claude-code/resume-specific-session.md) +- [Set Permission Mode When Starting Session](claude-code/set-permission-mode-when-starting-session.md) - [Stash The Current Prompt To Send Another First](claude-code/stash-the-current-prompt-to-send-another-first.md) ### Clojure diff --git a/claude-code/set-permission-mode-when-starting-session.md b/claude-code/set-permission-mode-when-starting-session.md new file mode 100644 index 0000000..ff480a3 --- /dev/null +++ b/claude-code/set-permission-mode-when-starting-session.md @@ -0,0 +1,29 @@ +# Set Permission Mode When Starting Session + +The way I typically use Claude Code day-to-day is with a couple long-running +sessions for one to two clones of the project. I start a session with `claude` +and then hit `shift+tab` until I've toggled it to _auto_ mode. I do tightly +scoped features and `/clear` the context in between each. + +I get used to being in _auto_ mode, so whenever I start a new `claude` session I +forget to first toggle from _manual_ to _auto_ mode. + +This is where the +[`--permission-mode`](https://code.claude.com/docs/en/permission-modes) flag can +help. I can start a session directly in _auto_ mode like so: + +```bash +❯ claude --permission-mode auto +``` + +Or if I know I want to generate a plan first, I can start it in _plan_ mode. + +```bash +❯ claude --permission-mode plan +``` + +There is also the `--dangerously-skip-permissions` flag which is equivalent to +`--permission-mode bypassPermissions`. I tend to stay away from those unless I'm +working from a sandboxed dev container. + +See `claude --help` for more details.