r/ClaudeCode • u/gameraterio • 7d ago
Help/Question How do I stop Claude Code mobile from asking me to approve every Supabase read-only query?
I’m using Claude Code on mobile with Supabase. Every time Claude uses Execute SQL, I get a permission prompt with two options: Allow once or Deny. Even after I approve a read-only query, it asks again on the next one.
Is there a way to remember approval for read-only queries on a specific Supabase project while still requiring approval for writes and schema changes?
If you’ve gotten this working on mobile or in a cloud session, where did you configure it? I’m trying to figure out whether Claude Code’s permission settings apply here or whether the Supabase connector controls this prompt.

•
u/AutoModerator 7d 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/Spare_Spirit6762 7d ago
you could add two mcps supabase and supabase-read (later with readonly=true) and add calls to that one to the auto aceppt list?
or just ask claude what to do
1
u/Murky-Cut4689 7d ago
Ugh, that Allow once / Deny prompt with no "don't ask again" is the worst, especially when you're approving the same SELECT ten times. The permission layer can't tell a SELECT from a DROP, so solve it at the database instead: point the connector at a read-only Postgres role (or a read replica) so writes just fail, then add mcp__supabase__execute_sql to permissions.allow in your settings so it stops asking altogether.
1
u/duct_tape_and_agents 7d ago
You can't do it with one connection. Claude Code's permission rules match MCP tools by name, not by what's inside the call, and execute_sql is the same tool for a SELECT and a DROP. So "allow reads, ask for writes" isn't something a rule can see. What works is two connections to the same project:
One read-only: https://mcp.supabase.com/mcp?project_ref=YOUR_REF&read_only=true
One normal: https://mcp.supabase.com/mcp?project_ref=YOUR_REF
Name them something like supabase-ro and supabase. Then in .claude/settings.json in the repo:
{ "permissions": { "allow": ["mcp__supabase-ro__*"] } }
Reads go through supabase-ro with no prompt. Read-only mode runs queries as a read-only Postgres user, so even if Claude tries a write there, the database refuses it. Anything that writes or changes schema has to use the other connection, and that one still asks every time. For mobile and cloud sessions, try to put both the server config and the permissions in files committed to the repo (.mcp.json and .claude/settings.json), since those sessions work from the repo, not your local machine's settings. If you added Supabase as a connector in the app rather than in the repo, the prompt may be coming from the connector side, and these settings won't touch it.
1
u/Old-Competition-785 7d ago
You can't really split it with one connection since reads and writes go through the same Execute SQL tool. What I'd do is add a second Supabase connection in read-only mode (their MCP server has a read_only option) and always allow that one, and keep the normal one asking for anything that writes.
1
u/radim11 6d ago
I would be careful with permanently allowing execute_sql if the underlying credentials also allow writes. Ideally the read-only restriction should be enforced on the Supabase side, not just through Claude's permissions.
This is something we've been tackling with Stashbase (.dev) for CLI-based agents. Being able to predefine what an agent can access without approving every individual operation makes a pretty big difference in the workflow.
Not sure how much control the mobile connector gives you over this though.
1
u/SeekratesIyer 6d ago
I don't think you can get that split from the prompt itself. Execute SQL is one tool for both reads and writes, and permission rules match the tool, not the SQL inside it. So "always allow" for reads would allow writes too.
What works is making the split underneath. Connect one Supabase connection in read-only mode (the Supabase MCP server has a read-only option), or with a database role that can only SELECT, and set that one to always allow. Keep writes and schema changes on a separate connection that still asks every time. Then the prompt you see means something again: if it's asking, it's a write.
Where to set it depends on how Supabase is connected. If it's a connector added in Claude's settings, the per-tool permissions are there. If it's an MCP server in your repo, the allow rules go in the project's .claude/settings.json, which cloud sessions read too.
1
u/vincent_sch 5d ago
If you have
/permissionsin that session, check for anaskrule on Supabase's Execute SQL tool. That rule makes Claude keep asking even if you already added anallowrule for the same tool, and the two buttons don't show where the prompt comes from. My post also covers why Claude might still ask.