# defaultShell

> The key that picks Bash or PowerShell for your ! commands.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** defaultShell setting

## Think of it like

It is like telling the desk clerk which tongue you speak.

## Definition

defaultShell is a settings key that picks which shell runs the commands you type after ! in the input box. The values are bash and powershell. The default is bash, or powershell on Windows when Bash is not there. If the shell you name is not there, Claude Code uses the other one.

## Example

Lucy works on Windows and knows PowerShell well. She sets defaultShell to powershell for her ! commands.

## Example code

```json
{
  "defaultShell": "powershell"
}
```

Run your ! commands in PowerShell.

## Why it matters

A command written for one shell often fails in the other.

## Common mistake

Thinking it changes the shell Claude uses for its own tool calls. It is only for the commands you type after !.

## Three principles

- **Your ! commands.** Not Claude's.
- **bash or powershell.** Two values.
- **Falls back.** If missing.

## Related terms

- [Shell](https://learn.benibix.com/term/infrastructure/shell)
- [PowerShell Tool](https://learn.benibix.com/term/ai/powershell-tool)
- [CLAUDE_CODE_SHELL](https://learn.benibix.com/term/ai/claude-code-shell-variable)

---

Source: https://learn.benibix.com/term/ai/default-shell-setting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
