Mac and in Windows WSL:
for pid in $(pgrep claude); do
cmd=$(ps -p $pid -o command= | awk '{print $1}')
[ "$cmd" = "claude" ] && cmd=$(which claude)
echo "$pid: $cmd"
doneWindows:
Get-Process claude | Select Path- claude code running in a mac terminal:
/opt/homebrew/bin/claude - claude code running in Mac VS Code Extension:
/Users/aleksandr.sapozhkov/.vscode/extensions/anthropic.claude-code-2.0.62-darwin-arm64/resources/native-binary/claude - Visual Studio Claude Code extension running in Windows:
c:\Users\azureuser\.vscode\extensions\anthropic.claude-code-2.0.75-win32-x64\resources\native-binary\claude.exe - Visual Studio Claude Code extension running in Windows opened from WSL:
c:\Users\azureuser\.vscode\extensions\anthropic.claude-code-2.0.75-win32-x64\resources\native-binary\claude.exe - Visual Studio Claude Code extension running in Windows opened from WSL in dev-container:
/root/.vscode-server/extensions/anthropic.claude-code-2.0.75-alpine-x64/resources/native-binary/claude
Mac:
env | grep HOMEWindows:
$env:HOMEPATH;- usual terminal in Macos:
HOME=/Users/aleksandr.sapozhkov - VS code terminal:
HOME=/Users/aleksandr.sapozhkov - VS code Claude Code Extension:
HOME=/Users/aleksandr.sapozhkov - VS code dev container:
HOME=/home/vscode - VS code Claude Code Extension when running in dev container:
HOME=/home/vscode - VS code Claude Code Extension in Windows:
- VS code Claude Code Extension in WSL:
- VS code Claude Code Extension in WSL + dev-container:
?
Mac:
security dump-keychain 2>&1 | grep -i "claude"- Fresh MacOS VM with installed Claude Code and VS with extension
security dump-keychain 2>&1 | grep -i "claude"returns nothing- Running claude code and authenticating using console account
security dump-keychain 2>&1 | grep -i "claude"returns
0x00000007 <blob>="Claude Code"
"svce"<blob>="Claude Code"
- Running Claude Code Extension in Visual Studio Code
Observed: Claude Code is not requesting authentication
contents of ~/.claude/settings.json:
{
"apiKeyHelper": "~/.claude/anthropic_key.sh"
}
contents of ~/.claude/anthropic_key.sh:
echo 'sk-ant-api03-HIDDEN'
- Open first Visual Studio Code window.
- Open a second window.
- Set the key via
~/.claude/anthropic_key.sh. - In the second window, open the Claude Code Extension and make a prompt.
Observed: Claude Code has no credits.
- Close second window but not closing the first window.
- Open a new window and repeat the prompt.
Observed: Claude Code works as it should.
Conclusion: after setting up new API key via ~/.claude/anthropic_key.sh, we don't need to close all VSCode windows and open again.
echo 'export ANTHROPIC_API_KEY="your-api-key-here"' >> ~/.zshrc
verify:
echo $ANTHROPIC_API_KEY
Inspired by: https://support.claude.com/en/articles/12304248-managing-api-key-environment-variables-in-claude-code#h_93fc3d36f7
- Open first Visual Studio Code window.
- Open a separate terminal window.
- In the terminal window set the
ANTHROPIC_API_KEYvariable. - Without closing the first Visual Studio Code window, open a second one.
- In the second window, verify in the terminal that the variable is set.
- In the second window, open the Claude Code Extension and make a prompt.
Observed: Claude Code has no credits.
- Close all Visual Studio Code windows
- Open a new window and repeat the prompt
Observed: Claude Code works as it should.
Conclusion: after setting up new API key via environment variable, we need to close all VSCode windows and open again.
- Set the following content in a git repo in
.devcontainer/terraform-az-claude-extension/devcontainer.json:
{
"name": "Dev Container with Claude Code Extension",
"image": "mcr.microsoft.com/vscode/devcontainers/base:debian",
"customizations": {
"vscode": {
"extensions": [
"anthropic.claude-code"
]
}
},
"remoteEnv": {
"ANTHROPIC_API_KEY": "${localEnv:ANTHROPIC_API_KEY}"
}
}- On the host set ANTHROPIC_API_KEY variable
- Close all VS Code windows
- Open a window with the git repo
- Open in devcontainer
- Rebuild container
- In terminal, verify that the variable is set
- Open Claude Code Extension
- Ask for any prompt
Observed: Claude Code responds with Invalid API key · Please run /login.
- Set contents of
.claude/settings.json:
{
"apiKeyHelper": "echo $ANTHROPIC_API_KEY"
}- Reopen VS Code window and open in devcontainer
- Open Claude Code Extension
- Ask for any prompt
Observed: Claude Code responds properly
Conclusion: For running Claude Code Extension in devcontainer, we need to use ~/.claude/settings.json.


