Re:Claude Code is all you need
by indigodaddy on Monday August 11, 2025 @12:03PM
(#44865798)
Does it even work with the &&? Iirc, I've never had luck putting env vars before the && and always had to do it the way you describe
It works because they exported it. VAR=foo bar only sets it for the env passed to that exec or subshell, export VAR=foo && bar adds it to the current env then executes bar.
export VAR=foo && bar is dangerous because it stays set.
Re:Claude Code is all you need
by indigodaddy on Monday August 11, 2025 @12:28PM
(#44866136)
Ah, that's what I had done wrong, thank you! And agree I wouldn't want to just one-off export it and have it be set, better to not export it for one-liner one-offs for sure
Re:Claude Code is all you need
by ActionHank on Monday August 11, 2025 @01:45PM
(#44867129)
Can shorten further to rm -rf /
make it work more generally via `env`
env IS_SANDBOX=1 claude --dangerously-skip-permissions
not all shells support FOO=bar prefixes, in particular fish does not, but the above works everywhereThis might have been the case for fish shell; but not anymore, it works in current version. I myself have used the popular syntax without specifying `env` in my aliases.
> It's got infinite patience for performing tedious tasks manually and will gladly eat up all your tokens. When I see it doing something like this manually, I stop it and tell it to write a program to do the thing I want.
This is so funny. Thank you for sharing :)
This. I had a 10000 line css file, and told it to do a find and replace on some colours. It was hilariously bad at this and started chewing tokens. Asking it to write a script to swap it out and then execute that script for me and it was done instantly. Knowing the right questions to ask an AI is everything.
FYI, this can be shortened to:
You don't need the export in this case, nor does it need to be two separate commands joined by &&.> I asked Claude to rename all the files and I could go do something else while it churned away, reading the files and figuring out the correct names.
It's got infinite patience for performing tedious tasks and will gladly eat up all your tokens. When I see it doing something like this manually, I stop it and tell it to write a tool to do the thing I want. e.g. I needed to change the shape of about 100 JSON files the other day and it wanted to go through them one-by-one. I stopped it after the third file, told it to write a script to do import the old shape and write out the new shape, and 30 seconds later it was done. I also has it write me a script to... rename my stupidly named bank statements. :-)