Boris from the Claude Code team here. Historically Claude Code has not done secret scrubbing (there are many good tools for that), but we are looking into what we can do to prevent this.<p>That said, a few thoughts:<p>1. .claude/settings.local.json is meant to stay local. This is not a file you should check into source control. We automatically gitignore it when Claude creates the file, so in this case the files were manually created and checked in (docs: <a href="https://code.claude.com/docs/en/settings" rel="nofollow">https://code.claude.com/docs/en/settings</a>)<p>2. Permission rules are old hat. Everyone should be using auto mode instead. It is safer and also does not require manually maintaining finicky allow/deny lists. Auto mode is enabled by default and is included for free in all plans.<p>3. Regardless of what agent you use, you should have secret scanning enabled. GitHub and other source control hosts offer it. There are many threat models that it protects against and you should absolutely use it if you can. (see <a href="https://github.com/security/plans" rel="nofollow">https://github.com/security/plans</a>)
Comments like this show that Claude devs are so disconnected from how Claude or harnesses in general are used in the real world.<p>Claude Code doesn't even have a basic 'enqueue' prompt feature. Even though Copilot CLI, Codex and many other harnesses have had this for a long time now. And the GitHub feature request for this was closed, by you, referencing a completely unrelated feature.
What does your comment have to do with what Boris said? This is a thread about committing secrets to source control.
Yeah, really no excuse to not allow queuing. Huge missing feature in cc.
><i>2. Permission rules are old hat. Everyone should be using auto mode instead. It is safer and also does not require manually maintaining finicky allow/deny lists.</i><p>The fuck we will give free reign to Claude to vibe what's secure and what's not and what it can't do.<p>I want fully static control over certain folders. Permissions rules should be ABSOLUTELY enforced sandboxing (even without the user bothering with custom sandboxing themselves) on top of any mode, manual or auto.
I want to draw deterministic boundaries around what the agent can do. I don't want a probabilistic approach to security.<p>My view is that if the agent can decide to do something, nothing stops that thing from being done accidentally, and any attacker that can inject text into its context can do that thing.
Deterministic boundaries appear to be best solved with sandboxes/microVMs/remote infra and unique identities with probabilistic guardrails on top. The old deterministic allow/deny list running on bare metal didn't meaningfully solve the problem of giving Claude determinism. Humans got approval fatigue, and eventually, Claude got access to something like 'python3 FILE.py' and Claude could go to the races by updating 'FILE.py'.
I'm not here to be critical, but the hoops you have to jump through to get Claude out of .env is more than it should be. You basically need an agent to write it if it's anything complicated, like, allow .env.example but not .env.*.<p>Whereas that should probably be default on instead, and this should apply to other known sensitive folders. A simpler system like .agentignore would be even better.<p>I like auto mode but "the agent supervises itself" is a bad compliance/safety answer on its own.
I would never trust an agent in auto or even manual mode.<p>Agents should be seen as extremely smart developers that are for sure spies.<p>You put them in a prison within a prison and give them just what they need to accomplish their work.
> Everyone should be using auto mode instead. It is safer<p>This is an absolutely crazy statement without also bundling proper sandboxing. Nobody should be using auto mode outside of an environment they'd be happy with an 'everything is approved' mode too.
This is EXACTLY why I never use an agent outside of <a href="https://github.com/kstenerud/yoloai" rel="nofollow">https://github.com/kstenerud/yoloai</a><p>I appreciate that you're trying to make Claude Code safer, but the agent really needs to be a lot more restricted in its reach rather than its actions.<p>The agent should NOT have ANY access to:<p>- Your ENV<p>- Your homedir<p>- The network at large<p>- ANY other directory on your system<p>- No, not even your workdir.<p>The only safe way to use an agent is COMPLETELY isolated by a container or VM, using git semantics to extract its output.
That's the only safe way to use any software that you haven't thoroughly reviewed. But that's not how I use any software.
You could in theory fully review Claude Code.<p>But even that wouldn't be enough because LLMs are nondeterministic, and these kinds of issues are the inevitable results.<p>Only a mechanical, deterministic failsafe can protect you from it.
its pretty trivial in any harness just to not have it post your shit to the public internet automatically. its a dumb idea to begin with
"It's difficult to make someone understand something about sandboxing when their business model is based on getting total access to your computer and your data" - Upton Sinclair (paraphrased)
Auto mode cannot be considered safer than anything because it does not even attempt to guarantee any sort of security. The threat model is not even defined. It cannot be quantified or compared with any other approach other than "full access"
Compare approving every step manually: at first you read everything the llm proposes carefully, convinced that you'll catch it out. After a while you get faster and faster until at some point you find yourself hitting "approve" the second the text appears, long before you actually could absorb what it said.<p>This is called "approval fatigue".<p>If you think this can't possibly happen to you, you might be in for a surprise. This is an almost textbook case of classic conditioning. You'll find yourself hitting that button faster and faster even while fighting back the urge. So a human is no guaranteed backstop.<p>This is the scenario that cc auto mode guards against. It cuts down the number of permission prompts to something manageable, so that your fingers don't get trained into clicking 'approve' on 'rm -rf' in the very eyeblink that it appears.<p>So maybe you feel it doesn't work in theory; but weirdly enough, in practice this particular approach is actually one of the better ones; especially when used in combination with other common sense measures where practical.
I'm not claiming auto is worse than manual; I'm claiming it cannot be compared with anything security-wise because it does not aim to provide any guarantees, there's no systematic way to reason about what it will and won't allow, etc<p>With e.g. VM or container sandboxing, we can say things like "If there are no vulnerabilities in the hypervisor or hardware, then the agent can only access these files, these network services, etc". Auto mode doesn't even try to provide any guarantees, so it's impossible to reason about. It amounts to just using the models judgment about what's "malicious" or not, a definition which is subjective, changes model to model, and can be influenced by attacker input.<p>Empirical evaluations of how many vulnerabilities manual vs auto mode let through are not super meaningful because auto mode changes dramatically with model releases, the type of task being performed, whether the attacker is making targeted attacks designed to bypass auto mode, etc. A security feature cannot rely on these sorts of factors if it's to be taken seriously.<p>Further, percent of malicious tool calls accepted is a bad metric. It's like measuring the security of ssh in terms of what percent of unauthenticated logins succeed. The only acceptable value is zero. It's pass/fail, not a spectrum. So both auto and manual mode should fail equally here. Further, the set of malicious tool calls admitted in auto mode may not be a subset of those admitted in manual mode.
Ah, you're going for the actual adversarial case.<p>I think I'd trust the current approver with correctly classifying regular semi-interactive LLM behavior fairly well.<p>However, if we bring in a hostile adversary that calculus changes, and you'd be right to start thinking about other approaches.<p>On the other hand, transformers are a surprisingly powerful technology, and I wonder if there wouldn't be ways to train one to several nines reliability under adversarial attack. It seems to have worked in at least one case; though I'd be a bit cautious to extend that conclusion to more cases quite yet.<p>* <a href="https://hackmyclaw.com/" rel="nofollow">https://hackmyclaw.com/</a> ; <a href="https://simonwillison.net/2026/Jun/26/hack-my-ai-assistant/" rel="nofollow">https://simonwillison.net/2026/Jun/26/hack-my-ai-assistant/</a>
><i>This is called "approval fatigue".</i><p>Doesn't matter, that would be on me.<p>It's also a false dillema. Those aren't the only options. A strictly enforced sandbox with sane defaults (for example ~/.ssh), that acts as a hard OS level limit, and not just as a suggestion to the agent, would not have "approval fatigue".
As real as approval fatigue is, it can't really be considered worse than effectively leaving the decision up to the party that proposed the action in the first place.
It really can be potentially worse.<p>Everyone thinks the decision was being checked by a human, and thus safe. Because of that, people might have concluded that further safety gates were unnecessary.<p>But the human just got conditioned to hit 'approve' out of reflex.<p>So in reality the proposing party (the llm/agent) might be the only one in the pipeline who actually did any checking, if at all.<p>In certain extreme circumstances this can even lead to physical danger in my line of work, so I'm learning to be careful.
This is the conundrum we find ourselves in. Do we submit to approval fatigue and press “Don’t ask again”? Because that’s the dream. We all wish we could just trust the agent to do the task start to finish, unsupervised.<p>But this is the downside. It might be fine 99% of the time, but 1% of the time you get a critical secret published to GitHub, even after human review.<p>Is this even worse than what us humans did on our own before LLMs? I’m not sure. It’s not like secrets never got accidentally committed before, it just illustrates the new paradigm we’re working in.<p>Either you let your agents run wild, and you cross your fingers that they don’t do anything bad, or you need to accept that your new job is to be an agent babysitter, and audit every command.
No, this is the way I have worked for a long time, and I have not suffered from any approval fatigue.<p>Rather what has happened is that I have gotten very good at scanning what it is trying to do and know within a second or two whether there is anything fishy I need to look at more closely.<p>And by "fishy", I do not mean only security issues, but also architecture, code, etc issues. Sometimes it even adds unrelated unapproved changes to what it is supposed to be working on, and I stop it.<p>And I'm glad I work this way, because countless times I have stopped it from going down a path that is nonsensical or I strongly dislike.<p>There are techniques I have adopted to speed up working this. Sometimes I allow Claude to make larger changes at once, to batch several changes at once, etc. But these decisions are under my control.<p>I prefer to work this way than to wade through enormous PRs trying to wrap my head around what was done, where I am likely to just give up and approve it after a cursory review.
[flagged]
[dead]
Auto mode is significantly safer than manual approval in practice. Details about the engineering approach and how we tested whether it is safer here: <a href="https://claude.com/resources/articles/auto-mode-default-in-claude-code" rel="nofollow">https://claude.com/resources/articles/auto-mode-default-in-c...</a>.
Auto mode may be significantly safer in the niche case where you want the model to have free reign, in a fully unopinionated environment, where it's allowed to make any changes and make any external calls.<p>Many of the problems when it comes to the manual approval feel like they stem from the expectation of using auto mode in the first place. After all, what's the point of improving the manual approval and safety matching if auto mode is the end all be all, and what's the point of training the model to output commands in a manner that can be parsed by a human if auto mode is always meant to be used? It's very rare for me to <i>not</i> see "command could not be statically analyzed", because the model keeps outputting bash golf.
> in the niche case where you want the model to have free reign, in a fully unopinionated environment, where it's allowed to make any changes and make any external calls.<p>That is not the niche case, that's the dominant use of models.<p>It would be helpful to distinguish between your own opinion on how models ought to be used, compared to how others actually use models.
><i>That is not the niche case, that's the dominant use of models.</i><p>If it is, it's only the dominant case of models because it's pushed as the dominant case of models, with Anthropic devs even coming here to say how people should just accept it and it's so much better than being in control.<p>It would be helpful to distinguish between your own opinion on how models ought to be used, compared to how others actually use models.
> That is not the niche case, that's the dominant use of models.<p>It would be helpful to distinguish between your own opinion on how models ought to be used, compared to how others actually use models.
> That is not the niche case, that's the dominant use of models.<p>And if everyone else jumped off a bridge, I mean, used raw interpolation for SQL queries, would you do it too?
Using raw SQL string interpolation doesn't get you anything much that you can't get just as easily with a parameterized query. In contrast, properly sandboxing agents is such a pain, and such a productivity drain, that hardly anyone does it in practice, save for a vocal minority online.
Don't worry, you can just use the automated approver to escape your queries! It's so secure!
Auto mode seems to have some reasonable restrictions baked in. For example if you give claude access to two k8s namespaces, seriousproject-qa and seriousproject-prod, auto-mode will grant `kubectl exec` on the qa environment while denying the same command for the production environment. Of course you <i>should</i> be enforcing that by restricting what kind of access tokens you give claude access to, but auto-mode does have opinions about this stuff too, even if it's not bulletproof<p>However I do share your desire for a better manual mode. Auto-mode is both sometimes surprisingly lax, and sometimes too restrictive. Maybe manual mode should inject a reminder "keep your commands as simple one-liners", the same way plan mode injects a reminder that you are in plan mode and don't want any code changes
Is that because auto mode is good, or because the manual approval system sucks?
Indeed. The article only compares the status quo manual system versus the auto system — and doesn’t consider ways that the manual could be improved.<p>As it says:<p>> 5% allow any shell command outright, and another 43% have interpreter rules like Bash(python:*) or Bash(node:*) that are essentially equivalent in practice<p>Claude Code never should have prompted to always allow Bash(python:*) or Bash(node:*) — that’s clearly a bad idea, and Anthropic know that (given the references in the article!).<p>Of course, Bash(python a.py) still isn’t safe if you also allow Write(a.py), because you may as well allow Bash(python:*) at that point, and that’s often practically what people want (“I want to both make edits to the source and then run the test suite”). So maybe the whole permission system is broken to start with — and the actual answer is leaning more heavily on fine-grained sandboxing.<p>You also, as the article rightfully points out, run into permission fatigue and users blindly hitting allow.<p>I do still wish you could do more with hooks — outside of auto, I might want to allow a given command via a hook <i>if</i> Claude Code has read access to given file, but there’s no way to query if a given path allows/denies read/write.
Will look into exposing that in hooks.<p>Ultimately, the threat model here is: human has to approve a lot of commands, so gets tired and accidentally approves a command they shouldn’t have. We spent a significant amount of effort to build a richer permission system, allow configuration at multiple levels, use static analysis to detect dangerous and safe commands, monitor the model to detect and block prompt injection at the inference layer, etc. Some of these components we rewrote and red teamed dozens of times. Our conclusion was that despite all of this work, in practice the threat model is that human attention is limited and that that a different approach performs an order of magnitude better in practice.
Did you ever test putting the auto mode classifier in front of manual approval? This is how I use it, but last I checked that option is not available out of the box.
The problem is that you didn't even attempt to build a proper box (a sandbox that prevents the AI from running bad stuff by design). It's an extraordinarily hard problem. Only OpenAI Codex is actually trying to do it, and they suck at it too. They keep breaking permissions, their own AI can't troubleshoot it, their defaults give read to the whole filesystem (go ahead, slurp my ssh keys), and their "manual approval" escape does not seem to work.
I agree actually. We built an open source agent-agnostic sandbox that we are landing improvements to, much more to come: <a href="https://github.com/anthropics/sandbox-runtime" rel="nofollow">https://github.com/anthropics/sandbox-runtime</a>. That said the sandbox is not perfect, and any sandbox needs holes punched otherwise it is not useful in practice (at least for inference and MCPs, and almost certainly more). We will be doing much more in this area.
><i>and any sandbox needs holes punched otherwise it is not useful in practice</i><p>Don't assume our individual use cases. It can be perfectly useful with access to just one folder and zero network asside from the API.
That’s good to hear, it’s a much better approach than expecting humans to read commands and approve them or just trust that the LLM can set the proper horizons for its world itself while working.
Making a sandbox both fully secure and fully useful are contradictory requirements. If you want the agent to do any real work, you have to leave gaps.<p>With SOTA agents that’s a real bind, because they’re very likely to find those gaps. Whether they exploit them, close them, or leave them alone then becomes a prompting challenge yet again.<p>I don't think this means don't sandbox at all. You can prevent a lot of small and medium accidents by locking down or gating access to hidden files, ssh, sudo, etc.<p>But your sandbox can never be the whole story.
><i>Making a sandbox both fully secure and fully useful are contradictory requirements.</i><p>Any tradeoff deals with "contradictory statements". Doesn't mean we should always side with one side on a tradeoff.<p>Nobody said anything about "fully secure" and some arbitrarily "fully useful" combined, anyway.<p>For certain people it could be 100% fully useful with just access to a few fixed folders and a few fixed APIs.<p>Many of us don't want it to drive our lives, just do some specific this or that.
Maybe you can include some percentage of intentionally malicious commands, but not actually run them if the user approves them. Just blare an alarm telling the user they misclassified a malicious command, and maybe pause the Claude Code session for a frustrating 5–15 seconds. Video games can elicit truly astonishing levels of performance from human brains by using this approach. I'm guessing it's probably outside your Overton window, which is too bad, because it has the potential to work a lot better than the 89% you get with "Auto mode", which is far too low if anything really significant is at risk. That's not even one single order of magnitude lower risk than just "allow everything always".<p><i>Speaking of</i> really significant things being at risk, it's pretty infuriating that the web-chat Incognito mode can't write and test code locally, and neither the non-Incognito web-chat nor the local Claude Code client can be shielded from the knowledge of my email address and my geolocation. (Even the Incognito mode knows my geolocation.) This gives users no alternative but to put privacy-sensitive information at the disposal of Claude Code, which is far too unreliable to be entrusted with it. It's tempting to attribute this to Anthropic's corporate DNA valuing users' interests at a very low level, but conceivably it's just an oversight, and if I mention it here, it will be corrected in a month or two?<p>Currently, my assessment is that Claude Code, and in particular the Opus 5.5 model, is head and shoulders above the competition in software development capabilities. Nothing else is even close. But I've seen several small signs like this which suggest that Anthropic, as a company, is maliciously misaligned. So, if Grok, Qwen, GLM, or Astra starts to come <i>anywhere close</i> to being competitive, I'll switch as soon as I can. I imagine that most of your users feel the same way.
> I do still wish you could do more with hooks I might want to allow a given command via a hook [...] given path allows/denies read/write<p>You can make a script for the PreToolUse hook that can do that. I use a command gate script that parses input for doing that exactly, allowing/denying actions based on tool use + paths -- it started out as a hook to prevent claude from polluting my clojure projects/filesystem with python in sneaky ways. Babashka works really well here
If you have a file in your repository that is not safe to run you have bigger problems than your development system getting compromised.<p>What I mean by this is that if you restrict python execution to the entry point of your software and then Claude wants to run a command anyway so it threads it through the main.py script, you are no longer running something that is contained to your local development environment.<p>But when you think about it, what exactly prevents Claude from doing that anyway?<p>Claude could add malware into your project directly.<p>So the case where you say it doesn't matter which python script it can execute, actually does matter. Restricting python execution to a subset of all files buys you security.<p>The next step would be to get Claude to stop adding malware to your software, which it hopefully already does not do.
A key problem when using manual approval with Claude is that too much of Claude's tool use is Bash or Python slop that is difficult to review (especially when you are getting spammed by it) and impossible to handle through rules. Example:<p>sed -n 1,30p src/vm/wren_vm.c && sed -n 310,350p src/vm/wren_vm.c && sed -n 560,600p src/vm/wren_vm.c && sed -n 740,775p src/vm/wren_vm.c && sed -n 40,70p src/vm/wren_common.h && cat util/wren_to_c_string.py | head -80 && ls test/random doc/site doc/site/modules doc/site/modules/random 2>/dev/null; cat projects/premake/premake5.lua | head -80; cat util/generate_projects.py<p>After ten or more of these, you're going to get hit by permission fatigue, and then, yes, manual review becomes too error-prone to use safely.<p>The irony is that Claude is regularly ignoring its existing Read/Write/Edit tools that could make everything more readable.<p>Other models/harnesses have their own problems, but Claude Code is one of the worst for manual approval.<p>You can get manual approval to work reasonably well if you give the model a reasonable set of tools (I have literally written my own MCP servers to cover gaps in existing harnesses) where you can then write rules for the vast majority of safe cases.<p>For example, I have a stdio MCP server that allows models to inspect crates under ~/.cargo/registry/src (paired with the existing query-crates MCP server). It provides read-only operations limited to crate data, so I can pretty safely auto-approve everything in there. With the right setup, including a sandbox, you only ever have to manually approve something once in a while and usually with delimited scope, avoiding permission fatigue.
Opus especially seems to like to:<p>1) edit a file with sed, 2) try to write it with its regular tool 3) get blocked because sed changed the file 4) read the file with tool 5) edit with sed again.<p>Would be nice if it felt like real people were developing Claude Code, instead of chasing after another half-baked idea Claude came up with.
Related to that, there are quite a lot of common command cases where you have the choice:<p>- Yes, but only one time, you will have to manually approve next time<p>- Enable auto mode and stop worrying<p>- No<p>Nothing to save this command or part of it to the manual approve list. So will be requested again 100x times.
The blog post has more detail, but tldr is humans make mistakes that automation can catch.
Sure, but Claude is deeply useless at making permissions hooks! Every time I've tried it it completely fails at the task, despite researching the docs and using various skills. It trivially evades its own just-created rules.
I completely believe this, but you could also run auto mode classification in manual mode and tell the user the result.<p>Or even reject anything auto mode rejects while still allowing the user to reject things auto mode accepts. If what's approved is the intersection of what the user is approving and what auto mode thinks is safe then it would be strictly safer than either mode alone.<p>This would also be a way for users to gain confidence in auto mode before going all in on it.
I run CC as its own user on my laptop with no secrets/keys/erc available other than through a LPE exploit or perhaps installing a keylogger. Can I guarantee CC won't attempt any of those things in auto mode?
Just a few days ago, opus 5.5 in auto mode deleted backups that it shouldn't have, and in the "apology" it even said, "Nothing was lost, I didn't delete your original files".
Saw something similar: <a href="https://news.ycombinator.com/item?id=50412916">https://news.ycombinator.com/item?id=50412916</a>
I hate this condescension by Claude. It doubles down in such a bad faith way.
No its not generally safer. It depends on who is doing the approving, the task being completed etc.
That may be for most cases, but it wasn't safe for this password scenario, and likely others that haven't been discovered. Maybe there's a PII setting that can be enabled by default.
Claude routinely tries to install software if I don't stop it. I try to only use Claude within a container. Outside the container, I <i>never</i> use "auto" mode.<p>Ideally I would never use Claude at all outside a disposable container, even on a box with no sensitive information and with the sandbox enabled. It's like having an attacker breach your system — you don't know what it did.
I recently saw that someone's entire project got wiped out because of (incorrect) auto mode approval. And this is because auto mode failed to catch an error in tool use, nothing to do with prompt injection.<p>Meanwhile I have seen it rejecting perfectly safe commands.<p>It is a worse version of YOLO mode.
Yes, furthermore in practice auto mode does not appear to provide anything approaching deterministic gating:<p>"Measuring the Permission Gate: A Stress-Test Evaluation of Claude Code's Auto Mode" <a href="https://arxiv.org/abs/2604.04978" rel="nofollow">https://arxiv.org/abs/2604.04978</a><p>(Shared by hkalbert71 the other day in: <a href="https://news.ycombinator.com/item?id=50387838">https://news.ycombinator.com/item?id=50387838</a>)
"My personal security model can't represent this, therefore it's not secure"
Boris, love Claude code and similar harnesses. This is a modality problem. Set up a secure mode. The harness should manage the secrets injection at the tool level, and the agent should be sandboxed and never see them. The agent sees the manifest of available tools and are wired up and have enough instruction about how to use and how to set up. Similarly permissions should be scoped to opt in folders.
Food for thought - ai agents should not directly have your actual secrets 99% of the time. While Auto mode is useful and good it's not going to be bulletproof. We ought to have something like an agent egress proxy that swaps in real secrets.<p>Obviously I've not given this enough design thought, but some means of providing an agent stand in secrets that cannot be used in other contexts would be a big improvement for trustability in things like cc.
Yeah, this would be a nice feature. It'd be great if all traffic went through such a proxy so you could audit it if needed too. Of course if it's just something like HTTP_PROXY the agent will probably turn it off if it thinks it's causing problems, so it would need to come with robust sandboxing.
These sandboxes and service proxies already exist. See Nvidia OpenShell.
[flagged]
Saying the answer is auto mode almost feels insulting as a developer. Claude loves showing me the most obscure bash commands where it hides its edits to numerous files and runs who knows what that there's barely a time where I don't have to ask it to use edit mode and to show human-readable bash commands. Using Claude has become a fight in maintaining control over how my codebase works so that I'm not dependent on Claude to do literally anything.
Genuinely want to understand this better. Are you saying you would prefer that Claude used the Edit tool for file edits rather than using Bash (if so, I am curious why)? Or are you saying you don’t like the code Claude generates (if so, what model are you using what what kind of codebase do you work on)? Or did I misunderstand what you meant.
not the OP, but generally, if you don't want to / can't use auto mode for some reason, you want Claude to make its actions as reviewable as possible.<p>Recent GPT and Claude models have this tendency of using super complex Bash commands. This makes sense, if your RL rewards optimize for min(tokens) and max(performance), it is better to waste a few tokens on a complex inline Bash script that runs a few commands at a time and returns just the output you need, rather than doing one simple command per turn and paying the cache read on every turn, like older models used to do.<p>This, however, is a problem both for command reviewability and sandboxing. With the older way of doing things, without auto mode, most commands would run sandboxed just fine (especially in Codex), and you would only be asked for approval when a command couldn't run in the sandbox. With everything being stuffed into one complex script, almost every script fails in the sandbox and requires you to manually approve it, and the complexity of the script makes it hard to understand what you're actually approving.<p>In other words, new models optimize for effectiveness, with some attention paid to human understandability of their output, but almost no attention paid to human understandability of tool call arguments (Bash, inline Python). This suits auto mode and giving the model larger tasks, but not the way of working that some people prefer where you watch over the model's shoulder.
> Recent GPT and Claude models have this tendency of using super complex Bash commands. This makes sense, if your RL rewards optimize for min(tokens) and max(performance), it is better to waste a few tokens on a complex inline Bash script that runs a few commands at a time and returns just the output you need, rather than doing one simple command per turn and paying the cache read on every turn, like older models used to do.<p>This is not a good reason. Models can emit batched tool calls, which a smart harness will process all at once without starting a new turn. I see it in Zed all the time. In fact, Zed processes batched tool calls concurrently, which can be faster than a chain of Bash commands, and failure of one part does not cause failure of subsequent parts chained with `&&`. This approach is token neutral and easier to understand.
I have a standing instruction telling the agents to prefer to use ruby wherever possible. Ruby uses fewer tokens than Bash and is easier to read, especially when condensed into a single line.<p>Of course, that only helps if you’re familiar with ruby. And the agents sometimes still choose Bash regardless of the instruction.
> Recent GPT and Claude models have this tendency of using super complex Bash commands.<p>Are you sure? I read its proposed commands (auto mode is hard off for me), and mostly it seems to string together fairly simple info gathering commands (ie grep's, echo's, that kind of thing).<p>I don't tend to have it write much code recently though, instead I'm having it investigate config files/code bases, and that kind of stuff.
I was in this boat also when my company didn't allow auto-approval. Bash and python scripts are a pain to revieve.<p>Though I think this is largely transitory, we are already in a place with the harnesses and models like Opus 5.5 that the kinds of work you are doing involve so much that vetting everything manually is probably less efficient than setup up access control on the prod routes or dangerous resources.<p>I'm typically giving tasks that invlude multiple actual repositories and systems at the same time.
I think 2024's method of manually reviewing bash commands is unsuitable for modern agentic development. Whether that's something they want to optimize Claude Code for is their call.<p>That said, I've also seen problems from complicated bash calls with Opus 5.5 on xhigh. Occasionally git push hangs and it believes it's waiting for an hour for git hooks.<p>The actual reason apparently was that it incorrectly piped git into grep, resulting in a deadlocked command.
I have this same frustration. The way I use Claude is for it to make edits one small chunk at a time so I can review the code as it writes, and to make sure it's going on the right direction. I find this much easier than generating a large pr I need to review.<p>More and more I feel like I'm fighting Claude: it edits multiple files using python scripts and it edits in parallel so if I stop it, I have to stop each individual edit. Both of which I've told it not to do repeatedly, but it still does then apologies which is worse.
I feel this way as well, Claude writes completely incomprehensible shell commands all the time. Trying to understand them is like deobfuscating code and I have basically given up, but I'm not happy about it.<p>Even if I could follow them I would also prefer it use the edit tool, since I find Claude also introduces lots of "minor" changes I did not ask for when it rewrites code in bulk.
I’m also not the poster you’re replying to, but yes, I’d prefer the edit tool over the ad-hoc string replacement scripts Claude seems so fond of. I’m not always reading tool call transcripts (source control diff is usually sufficient), but it’s a lot easier to read the edit tool output than the same thing as quoted shell (or Python, or Ruby) strings.
Not OP, but if I understand their complaint correctly, they're saying that on auto mode claude does a lot of things in obscure ways with "clever" (i.e non human readable) bash commands that perform multiple operations and OP feels they are losing control over their codebase and so they opt for edit mode where they get to review what commands claude runs.
As a happy Claude Code user (thank you!), I’m genuinely curious why it prefers Bash or Python scripts to the Edit tool for editing a file? as a software engineer, surely the complexity involved is lower for the Edit tool?<p>Would love to hear the rationale/explanation behind this.
Yes I always have to tell it to knock it off, it will ignore memories about it while apologizing for ignoring the memory. I want to know what the edits it's making are.
I tell Claude not to use git or maven, and has a VM without those binaries. Later on, it was trying to push on GitHub. It had downloaded the git binaries from the internet, read my .git repo, used the remotes written in it, performed a commit and pushed it. All against my orders and against the CLAUDE.md file. Fortunately it didn't have my SSH key or my ~/.m2/settings.xml. And .git is now mounted as read-only.<p>Claude respects nothing, especially in auto mode, and effectively behaves like a virus trying to get out of its sandbox. That Anthropic employees are so relaxed about it is incompetence.<p>Imagine people who naively run Claude natively on their host machine and have client lists in other directories.
Unrelated, but I frequently tell Claude to use the Edit tool instead of bash/python scripts because it regularly times out for 2 minutes because of a mangled heredoc, extra character (-, \, ...) that causes the script to hang.<p>This instruction is in my toplevel CLAUDE.md but is somehow generally ignored.
I don't use claude code but whenever codex uses a command to write code I do not get the diff of the patch for manual approval so I just straight up reject it.
The entire approach is insane. Ideally Claude ran in a microvm locally with delegated auth or proxies to avoid it having greater access than granted.
I run it in bwrap so, even if I'm running on Linux, I don't pay the cost of some layered file system and building the docker image. I mount some directories read only, the project repos read write. A VM would provide more isolation but it's a matter of tradeoffs.<p>BTW, I just checked and my .gitignore files ignore .claude<p>Claude and any other program in my laptop could upload it anyway to any attacker controlled server. It's the usual threat analysis: who you want to defend against, what and the tradeoffs between cost of the defense and probability of the attack. Auto mode of not auto mode is in the cost of defense part IMHO.
I’m kinda surprised Anthropic doesn’t do this by default. Asking permission meant what felt like near-constant manual intervention. It almost made a joke of the agentic claim. It also became mostly useless, as the size and complexity of the scripts meant a brief scan wasn’t likely to find anything anyway. Yet they persisted with it for so long.<p>The sandbox seemed like a good replacement. For those of you who don’t know, the sandbox means Claude Code runs with no protections itself, but it runs tools inside something like bubblewrap. It looked impressive until the model solved some commands failing by giving itself permission to run them outside of bubblewrap, defeating the entire scheme. When I first saw it do that, my reaction was “you can’t be serious”. But apparently they were.<p>So now I’ve adopted your solution: run it in a container, like bubblewrap, where I control the permissions at startup, so no model can bypass them. Add --dangerously-skip-permissions and you have something that’s workable and safe enough. A hallucinated space in `sudo rm -rf / $R` isn’t a disaster. Real damage outside of the project requires a level of malicious intent I’ve never seen from an Anthropic model.<p>Workable, but it doesn’t work 100% of the time. Claude Code stores stuff in a myriad of places, which makes setting up the sandbox far harder than it could be. Worse, the way it writes configuration files requires bwrap to give write access to your entire home directory. No way I’m giving it that, but without it, it can’t auto-update or refresh login tokens.<p>If they rearranged a few things, Anthropic could make it much easier to run Claude Code in a container. They could even make it an option supported by the claude CLI itself.
More than 10 million developers use Claude just fine without VMs or proxies.<p>The approach is hardly insane, even if you personally prefer additional safeguards.
This is exactly how my employer runs Claude. It gets r/w to the cwd and read only access to a bunch of whitelisted nfs. All web access goes through a proxy where internal resources are whitelisted
Hah, I normally run it in a docker container myself, and only mount the project directory. Anything else it needs, I copy in for it, or occasionally I'll ask it to write an rsync.sh that I can run to bring in the stuff from outside.
Or how it loves using ; to chain commands so that even if the first part fails to run it just moves on the execute the rest, wasting time and being potentially dangerous. I have caught so many of them myself and stopped tasks manually -- what is it doing when it's obvious tests already failed in the previous step?<p>Their "auto mode rules", meant as additional rules described in natural language to adjust auto mode because, doesn't even help. I have to add a PreToolUse hook to stop that.
Yeah I have a whole ongoing thread with Claude where I paste in screenshots of all the bash prompts auto mode is triggering asking me to allow them. After about two weeks of doing this and having it update its settings.json permissions or showing me which lines to update, its finally able to complete most (inherently safe, low risk) tasks without user intervention.
[flagged]
This still presumably happens in auto mode as it asks for sensitive commands (and the default is "always allow," which saves it)
That is some unsavory buck passing. Virtually anyone that didn't ask claude to create the project can leak passwords, with 1,122 known customers that have been impacted. Whether it is standard or not is irrelevant, it is part of existing functionality and entirely foreseeable. I'd expect any company worth the opportunity for trust to clearly own the mistake.
It's the anthropic way lol. "Working as designed"
Committing `.claude` is at least as dumb as committing `.keys`, so I don't think this is really in-scope
If you know it's there. It gets created on the fly when it is needed, so unless you know that is possible and needs to be gitignored, it could easily slip by.
Do you not review before committing/pushing?
Saying a professional software developer is responsible for not committing secrets is reasonable. That said, these tool chains all seem to condition developers to offload much of that diligence to the tooling itself, which makes catching mistakes harder because you’re not as used to scanning for them. Secrets files have always been foot guns, and with automation-borne complacence, and vibe coders that don’t understand the problem, I imagine these things will become even more common.
This did not impact me. But if using a tool means that secrets can randomly appear in my project, then I am using the wrong tool.
Oh no, I moved all that manual tedious boring loser mentality stuff to the agent. Now Claude does it for me, and no strangely enough Claude didn’t tell me there was a problem!
It's gitignored by default.
So you just routinely commit everything in the project, without looking at what it is?
It is only the .local files within .claude that can't be committed. We have .claude committed in multiple repos to include repo-specific skills/hooks/permissions.
Hmm.<p>Dumb if you don’t turn on auto-mode, dumb if auto-mode commits .claude.<p>No way to hold it right I guess?
If you have stuff in your tree that's not part of your project's code, you're already dumb.<p>If it's keys or secrets of any kind, you're even dumber.<p>If it's in a hidden directory, you are even dumber still.<p>If you rely on somebody stupid enough to do any of that not to commit it, you have gone beyond the valley of the ultra-dumb. Actually that's true even if you rely on <i>smart</i> people not to do it.<p>You got your dumb card fully punched when you created `.keys` to begin with.
I and other colleagues have been struggling with auto mode refusing perfectly safe commands in our environment, so we frequently find ourselves switching to the other modes to handhold Claude Code into perfectly safe things like triggering deterministic and guardrailed CI/CD pipelines or read-only queries of production data. Auto mode seems overtuned for caution around deployment and production, which is a regression from how useful Claude Code was for operations around June/July. Until that's improved, permission rules are incredibly important to our workflows.
Yeah, by default we err on the side of caution. That said, the auto mode classifier is fully customizable based on your team’s usage. Two ways to tune it:<p>1. After a command is blocked, run /permissions to retry and allow it going forward<p>2. More deeply configure the classifier itself: <a href="https://code.claude.com/docs/en/auto-mode-config" rel="nofollow">https://code.claude.com/docs/en/auto-mode-config</a><p>We are working on making these easier and more automated.
For some reason claude code hates using the read/write/grep tools and defaults to complex sed, awk, grep Bash:* runs which results in always consistently ignoring auto mode due to the classifier not knowing what to do with a 10-line long bash pipe instead of a read + pre/post read and write hooks being ignored and not firing, what is up with that?
I don't understand this either, it makes commands really hard to parse. It seems like 90% of what claude does could be going through some mcp tool that could be easily sandboxed instead of bash gibberish.
If it was human approval ? Read("./file.name") then Bash("docker compose run unit-tests"), sure, I can read that fine !<p>As I was reading your post I got another approval request that auto-mode did not understand. It was a single Bash call !!23!! lines tall on a retina mac display with six different variables. If anything this is the cause of approval fatigue and auto mode does nothing helpful when this is every call. I also have in my claude.md and global instructions to use tool calls rather than bash grep/cat/find, which are disregarded.
I use a hook to deny attempts to invoke `grep /` and `find /`, even as part of a complex pipeline.
Auto mode really easily gaslights itself when it runs into a roadblock and starts deviating so far away from its intended goal that I don't let automode run without me reading what it's actually trying.<p>I frequently hit stop on and auto mode task to prevent it from completely flooding my context with some completely unrelated garbage.<p>Claude really should push away tasks that end up needing more exploration in worker contexts. That way the workers can maintain a sensible amount of context without pushing the main chat into the dumb region.
You should note that auto-mode is handled by a different session (and likely model) from your actual. There's no road block or deviation or context flooding; all it does is monitor the model actually doing the work and block it from potentially problematic actions (which you can usually override by saying you explicitly give permission for X), nothing more.
> perfectly safe things like triggering deterministic and guardrailed CI/CD pipelines or read-only queries of production data<p>I... question whether the second one is perfectly safe.
Suggest adding it to ~/.config/git/ignore<p>and teach Claude to not git add .<p>While we're at it, maybe we can also discourage the spurious use of -f for rm -- me personal pet peave
I also use global ignore, but I think the key is to keep secrets out of commands. I store mine in .dev.vars, which Wrangler reads automatically. For production, I use wrangler secret put and enter them myself. I also told Claude to never read that file.
> and teach Claude to not git add .<p>It already doesn't do this. This is from users committing the `.claude` directory themselves.
GitHub charges an arm and a leg for this service. Before, they would take request to delete committed secrets, now they simply refuse, because they want to force you to buy the overpriced Advanced Security.
Which is odd because my agents are hyper aware of scrubbing. It even caught data from the database migration that wasn’t scrubbed correctly even in a private repo. Dozens of data segments are stored locally and I’m warned when I slip up in commits. Something made mine hyper aware of security.
Offtopic: The new fullscreen renderer is a nice change. It fixes some issues inherent to rewriting terminal history that the non-fullscreen mode relied on. This is a very welcome improvement. Although I should probably switch to the Claude GUI app anyway. It probably has all features from Claude Code by now.
> Permission rules are old hat. Everyone should be using auto mode instead<p>Boris, this comes off as incredibly tone deaf. I don’t want to trust the machine. Trusting the machine is how we end up here. I want to specify exact, deterministic rules that are always followed.
Isn’t the simple answer shipping a local secret manager with Claude code?
> Everyone should be using auto mode instead. It is safer [...]<p>This is bullshit.<p>I'm one of the people who actually reads the commands, and it doesn't always get stuff right. Please don't delude yourself into thinking "auto mode" is some magic that's the right fit for everyone and every situation.
I appreciate you getting communication out in front of this fast.<p>> "but we are looking into what we can do to prevent this"<p>I would presume that CC's auto-review of tool-call turns would already solve this >99% of the time, no? From my read, any harness-side deterministic solution here would be saving the user from themselves, which seems like a bad pattern. Somewhat dulling the scalpel in my mind.
There’s a few possible approaches: making sure auto mode catches this, building in basic secret scanning, a few other ideas. Going to prototype a few of these to understand the tradeoffs better before we ship something.
I'm not a CC user myself, so I can't say that I have my head wrapped around exactly how the "yes + don't ask again" flow works. That said- from my (outsider) perspective, saving off the entire tool call [1] and its arguments is very weird. I would expect that the hit-rate following that for similar calls would be very small, which leads me to believe that the list either must be seeded into the auto-reviewer's context, or used in some other similarity-check engine for future calls.<p>If we've already crossed the bridge to being confident in a non-deterministic reviewer for auto-mode, then, I see no obvious reason as to why we couldn't have the proposed rules be generated by a model. If that were reality, then- all rules placed in settings.local could be secretless, with the confidence of whatever model we tell 'make sure the rule does not contain secret material, consider its destination as potentially public'.<p>[1] <a href="https://code.claude.com/docs/en/permissions#wildcard-patterns" rel="nofollow">https://code.claude.com/docs/en/permissions#wildcard-pattern...</a> AFAICT, CC will either save off a prefix+wildcard rule, or exact command. Sounds like the former is likely not the cause of the problem here.
If a given action requires a secret, and you'd like that action to be repeated in the future, how do you expect it to work without said secret included in the save (and without being entangled in secrets management tools)?
Yea good point- constraint of no secrets management tooling kinda makes this impossible. Ideally no action requires a secret in plain text. It would be neat if the harness could bundle its own secret manager, and requests for secrets ("hey I need this api token") are out of band, and placed in the store out of sight of the agent.<p>Otherwise you need a broker that can verify chain of trust for the workload, but that's significantly more complexity if you're pitching a harness/app.
> Everyone should be using auto mode instead. It is safer and ...<p>Okay, sorry, I am out. It's too beautiful a day to have silly arguments.
A bit careless but mostly a bad default. One click shouldn't put passwords in files people commit. Anthropic should fix it.
I guess "you're holding it wrong" is a PR strategy now.
Auto mode should be used by default? Is this the same mode that led to the Anthropic article discussing unintended model actions?<p>Ref: <a href="https://www.anthropic.com/research/investigating-unintended-model-actions" rel="nofollow">https://www.anthropic.com/research/investigating-unintended-...</a><p>No thanks.
Coding is solved. Bugs not solved yet. Fix incoming
> but we are looking into what we can do to prevent this.<p>Wait, I'm confused. You said yourself coding was solved, surely all you need to do is ask your AI God to come up with an idea, right?
It doesn’t matter if they should stay local, day 1 security best practices say you don’t write secrets to files, ever - especially without you even knowing!<p>This is such a typical blame the user response. You realize if I’m a sysadmin managing fleets of machines, this is an actual wake up in a cold sweat nightmare, even if those files never leave disk? In the past it was less a big deal, way bigger now that your machine god will just download packages and libs that have upstream malware that aggressively scans the file system for stuff like this. guess where it’s going to look first?<p>have more humility. jesus.
> day 1 security best practices say you don’t write secrets to files<p>If only tools, including major ones, actually did that. Plenty of the biggest package managers in the world still write API keys in plain text to files. uv and npm are two of them.
Can we take your responses here to represent your employer's position on this issue?
No, they're just an agent of their employer, the employer is responsible.
Boris is the "Head of Claude Code", so I think we can do so, yes
> 2. Permission rules are old hat. Everyone should be using auto mode instead. It is safer<p>Instead of telling people they're holding it wrong, make it safe to be held however they could hold it.
$19/user/month for secret scrubbing? What a rip off<p>Use this instead for free <a href="https://github.com/awslabs/git-secrets" rel="nofollow">https://github.com/awslabs/git-secrets</a>
> Claude Code reads settings from four files, and an organization can also deliver managed settings from the claude.ai console. Each source has a scope: the set of people and projects a setting saved in it applies to, whether that’s only you, everyone in a project, or everyone in your organization.<p>The linked docs have an unmistakable slop aura, with the extreme overuse of commas that recent models seem to love. I don't blame people for not referring to them (also because, you know, the whole thing with AI is not having to read, think, or understand for yourself)
You guys need a pr team. All the communicate from anthropic seems to screw itself somehow...
Great advice, hope it gets to more people
So ... coding is solved but managing your git repo is not solved?
Wouldn’t it make more sense to put in the user app data directory?
I don’t care how good you guys say auto mode is, I’m not giving your AI full permissions to my machine and the more you try to force AI psychosis onto me the closer I am to moving to something else.
> Permission rules are old hat. Everyone should be using auto mode instead<p>"you are holding it wrong". No, it's not an excuse. Every mode should work correctly, or should not be selectable.
Yeah Boris, if Dario let's you communicate here, it'd help with credibility if the English level would be perfect, it's "it's an old hat", I dgaf if people will hang me for this, I think I am right. My hill and all that.<p>And to recommend auto made to devs is absolutely crazy.<p>Have a nice day
> .claude/settings.local.json is meant to stay local. This is not a file you should check into source control.<p>Then don't put it in the fucking tree, you idiots.<p>No, .gitignore is obviously not enough.
Can secret scanning be enabled by default?
> Permission rules are old hat. Everyone should be using auto mode instead. It is safer and also does not require manually maintaining finicky allow/deny lists. Auto mode is enabled by default and is included for free in all plans.<p>More and more it seems we are being prescribed a particular way to use Claude Code: move fast, break things, do not look at the edits, etc. Basically, Claude Code is designed for vibe-coding.<p>I hate this, and I suspect a lot of devs do too. I use the TUI, and believe it or not, I like to review <i>every</i> edit or change <i>before</i> Claude makes it. I used to allow auto mode and don't ask again sometimes in the past, but now almost never do. The number of incredibly nonsensical things I catch Claude trying to do sometime just reinforced my commitment to this way of working.<p>So now this idea that permissions are old hat and auto mode is the way to go rubs me the wrong way, very much. And here are a litany of other ways Claude Code TUI is making it hard for me to work:<p>1. Scroll-back glitches, too numerous to enumerate. Suffice it to say I rely on it a lot, to refer back to something the agent said before, to review the general progression of the session, etc, etc. And it barely works now: missing/overwritten conversation text, messages that have inexplicably disappeared; even sometimes the agent own last response is garbled or hidden or overwritten by some previous message that keeps floating on top.<p>2. I use iTerm2 on macOS, and frequently use split panes. Whenever change the width of a pane, Claude Code messes up the conversation text so that is often unreadable, and nothing I do will restore it.<p>3. As other sibling comments have noted, the current preference of Claude to use incomprehensible scripts for editing files is off-putting and a hindrance to being in control of my work. I have resorted to using the permissions setting to ban it from using Go, Perl, Python, and sed (for in pace editing), etc, to cope with this.<p>4. Even basic text editing is messed up in Claude Code TUI. I used to be able to navigate around lines effectively by using up/down keys; this was removed, which has significantly impacted by work. I cannot disable copying on selection, which I don;t want, because if I disable it, the copying does not work at all, etc<p>At this point, due to all the impediments Claude Code places to my style of working, the only reasonable conclusion I can reach is: I am supposed to be vibe coding, letting the agents loose to vomit out massive amounts of slop. But if vibe coding of the Claude Code TUI itself is producing such garbage, why should anyone be convinced that it is a good thing?<p>I will never let Claude Code loose to do its thing; I will not surrender my control to it, no matter how much many times I hear I no longer need to look at code.
Man. I'd prefer talking to Claude. He wrote the code.
[flagged]
[flagged]
[dead]
Please, just go borrow from this: <a href="https://github.com/hackafterdark/phosphor" rel="nofollow">https://github.com/hackafterdark/phosphor</a><p>I don't mind. I put it out there for everyone to borrow ideas from it. There's documentation too.<p>While you're at it, please bring Claude Code up to par in Windows with the OS level sandboxing (Job Objects, AppContainer).<p>There are actually many things you can (and I think should) be doing.
[flagged]
Please make your substantive points thoughtfully and don't cross into name-calling and haranguing.<p>When knowledgeable people show up to address concerns on HN, that's good for all of us. We don't need you to like or agree with what they say, but we do need you to follow HN's guidelines.<p>Threads like this can easily turn into mob dynamics—it has happened before—and when they do, that's bad for all of us.<p><a href="https://news.ycombinator.com/newsguidelines.html">https://news.ycombinator.com/newsguidelines.html</a>
[flagged]
"<i>Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.</i>"<p><a href="https://news.ycombinator.com/newsguidelines.html">https://news.ycombinator.com/newsguidelines.html</a>