Add support for passing into allowedTools from the CLI

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 5 comments · opened Feb 25, 2025 · closed Mar 13, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Using claude -p can't edit files.

claude -p "update the readme file with information about the project"

I need your permission to edit the README.md file. Should I proceed with adding the project hierarchy information to the README?

View original on GitHub ↗

5 Comments

bcherny collaborator · 1 year ago

What's your use case -- is there a reason you're using -p instead of just claude "update the readme file with information about the project", which would have interactively prompted you for permissions?

edmar · 1 year ago

to use this in a script to run this at specific times/events. For example updating docs after PR merges.

bcherny collaborator · 1 year ago

Gotcha. Fix coming soon.

bcherny collaborator · 1 year ago

As of 0.2.40, you can now do:

$ claude -p "update the readme file with information about the project" --allowedTools Edit(README.md)
github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.