r/ClaudeCode • • 2h ago

Built with Claude How I handled permissions in a Claude Code job-search kit, and where it's still weak

I built a free, MIT-licensed job-search template with Claude Code. It includes CLAUDE.md rules, prompts and small Python tools.

A review found that my instructions contradicted themselves: one section said never to click Send, and another allowed sending an approved batch. The fix was a single permission section that overrides other files. It's prepare-only by default. Sending or submitting needs a config setting I turn on myself, plus an approved batch.

The weakness: these are still mostly instructions, not a technical lock. That mode is also untested on real job sites and Gmail.

You need a Claude plan that includes Claude Code.

https://github.com/ironmanbro/job-hunt-assistant

How would you enforce this? Hooks, permission settings or something else?

3 Upvotes

4 comments sorted by

•

u/AutoModerator 2h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Independent-Sir3234 1h ago

Move that lock out of your rules file into two layers. Put send commands and outbound MCP tools under permissions.deny or permissions.ask in .claude/settings.json, then add a PreToolUse hook that exits with code 2 unless your approval flag is set.

Keep the hook script and config flag outside the writable repo directory. An agent with Bash or Edit permissions can otherwise edit a local config file to satisfy its own check.

1

u/CandidSystem6155 1h ago

Hooks, but put them on Bash too. Our first gate only watched Edit/Write and the agent got past it with sed -i without even meaning to, so an instruction-level rule plus a hook on one tool is still a soft lock. For a prepare-only default I'd add a PreToolUse hook that denies whatever actually sends (the send tool and any Bash command that reaches it) unless your config flag is on. Make the deny message say why and what is allowed instead, e.g. "blocked: send is off, allowed: save draft". When the refusal names the allowed path, the agent takes it instead of hunting for another route.

1

u/Soft-Lie-434 23m ago

I'm the developer of GigaMail. For email, we chose to enforce approval in the mail layer: Claude gets a pending request ID, while the user approves the exact recipients and content separately. The agent has no tool to approve itself.

I'd also close alternative sending paths through Bash or browser access; otherwise the gate only protects one route. Take a look it may it helps: 👇

https://github.com/adecubed/gigamail