saoudrizwan / claude-dev

Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.
https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev
MIT License
3.56k stars 343 forks source link

Auto Approval for Steps #11

Closed zateslo closed 5 days ago

zateslo commented 1 month ago

This is great, and I am loving the tool! Being able to auto approve the work so we don't have to approve everything each time over and over again would be great. Having a setting where certain files and folders can be accessed, read and edited without approval, and/or setting a limit of $X before asking for approval would help a lot.

saoudrizwan commented 1 month ago

Thank you for the kind words and your suggestions!

Being able to auto approve the work so we don't have to approve everything each time over and over again would be great.

I opted not to do that for the initial release, to highlight how important it is to have a human in the loop when doing things as serious as writing and executing code. But I could add an 'Auto-agree to permission prompts' option with warnings informing you of the potential risks. I'd also need to consider things like enforcing the extension to only be able to work within a designated directory/environment for the task, instead of potentially affecting unintended files i.e. on the desktop. There's a lot to consider, but I'm definitely thinking about how to safely implement this.

Having a setting where certain files and folders can be accessed, read and edited without approval

I'm currently working on making code analysis smarter by looking at your entire git repo and semantic elements within your source code, like symbols and doc comments. Stay tuned!

bzimbelman commented 1 month ago

Another option along these lines might be an auto approval timeout. I.e. I set a timeout for read actions that is 5s, once that time has occurred and no interaction approval is assumed. I could then set the timeout for write type actions to longer as I might want to verify those and for running of commands set it to -1 or 0 or something that says you have to explicitly approve this action before it runs. Just brainstorming.

ofirgeller commented 1 month ago

I would prefer to see "caching" permissions for some time / for same task / vsc session and not a complete disable.

CiberNin commented 1 month ago

Might it help to prompt claude to output a list of commands to be approved as a block?

johnlk commented 1 month ago

Another thought could be to whitelist directories like /src or to blacklist files like *.env, for example. Could take a .gitignore pattern.

Taking that idea future, there could be a claude-dev configuration that uses the vscode settings for extensions. For example: .vscode/settings.json

{
  ...
  "claude-dev": {
     "read_file_allow_list": ["**/src", ...],
   }
}
CiberNin commented 1 month ago

If I understand correctly, every time Claude is asking to read a series of files, we are doing a full round trip for each file that it requests? Does that mean we're wasting tokens on that?

Ravian18 commented 3 weeks ago

@CiberNin not anymore I think since Caching was implemented.

CiberNin commented 3 weeks ago

@CiberNin not anymore I think since Caching was implemented.

Well the wasting of tokens is fixed. But its still annoying to have to have multiple chains of sending to claude and it asking for the next file.

And for handling secrets, it would be nice to have a separate option. You could approve, deny, or deny and say you will never provide access.

jpheimonen commented 2 weeks ago

1 idea: option to write instructions on when auto approval can be done. Then ask Claude if the conditions are met.

bigben3333 commented 2 weeks ago

It would be perfect if it can at least auto approve the reading of files in the project with the possibility to stop it and guide the ai again.