Permissions are an important topic when working with Claude Code.
So I have to get back to those because we already saw that Claude
Code asks for permissions from time to time.
For example, it asks for permissions before it starts
files. At least it does that if you send your prompt in
the normal default mode you get out of the box.
So for example, if I were to send this prompt in a new session
without any other changes, also no changes in my
settings, then after evaluating my prompt,
Claude will ask me for permission to edit this page TSX
file, also by showing me the changes it wants to
So as before, I can choose yes to grant this permission
asked again if it wants to edit another file, or choose the
second option, or hit shift tab if I want to
permanently grant this permission.
And with escape, I can cancel this edit
actually, and I could send up follow-up messages to
Of course, it's quite likely that you want to allow Claude Code to
edit your files and you don't want to wait for it to ask you for
permission because you want to go grab a coffee right away.
You can therefore switch the mode from the default mode by
hitting shift tab to switch to this accept
edits mode here, and that does just what the name implies.
It will automatically accept file edits inside of your project.
Claude Code still can't access anything else on your system.
We're talking about files in your project.
So if I run the same prompt in this mode, it will do the same
research, come to the same conclusion probably,
file without asking me first. As you see here, I did not have
to grant it permissions. However, it's important to understand
that even in this mode, it still is not allowed to do everything.
It's just allowed to edit your code files.
But what if I ask it to create a new git commit
about these changes it made because I'm too lazy to type out the git commit
message myself? As you will see, it uses the bash tool
here a couple of times to check the current status and
find out what happened in the past and what changed so that it can craft a
proper commit message. But then when it wants to run
git add, which of course is a command that changes something,
and also then git commit to commit that
snapshot, it does ask for permission again.
Because by default, Claude Code is configured to not be allowed to
do everything, even in this except edits mode,
editing a file in this project. Instead here we're creating a git commit.
And the same would be true if it, for example, wanted to create a
new folder or do anything else that's not just editing a code
file. So in that case, you still have to make a choice, and you
can either allow this one time or in general tell it
to not ask again for git add and git commit commands, which
means it will still come back to you if it wants to use some other command
that changes something like git restore or other
bash commands. But for these commands, it won't ask again.
And here I'll just accept this this one time because I want to get asked again in
the future, let's say. So it's important to understand how it
and that even this except edits mode does not allow everything.
But let's say you really want to be able to move away from your machine and let
Claude Code do its thing without it ever asking for any
permissions. If that is what you want, you can start a new Claude
session by adding the --dangerously
skip permissions flag. And that does
just what it sounds like. It skips all
permission requests. It will always grant those
permissions Claude Code wants. And it's
dangerous because of course you then got no control over
what it does. It still can't access your hard
drive outside of your project, but it can erase your
git history, erase files that can't be brought
back in this project. It could write a script that
then is able to do something outside of your project.
If it writes a bash script that erases your hard drive and it
executes that in your project, then this should work and should
destroy your machine. Obviously that's not necessarily super
likely to happen, but it could happen.
And that is why you should use this flag with care.
But you can of course use it. You then get a warning what this
does, and you can then accept that you are aware of that.
And then I could send a prompt like this where I ask it to edit something
and also commit the changes, and then I could leave and come
back once it's done and it will never ask for any permissions.
So as you see, it edited the file without asking for
it created that commit.