Lesson 20
Environment and Status Line
AI-generated
Environment and Status Line
Set environment variables that control Claude Code behavior
Customize the status line with /statusline
Change themes with /theme
Configure keybindings for your workflow
Know which settings persist and which are session-only
Claude Code runs with defaults that work for most people. But as you use it more, you will want customization. Maybe you want to see context usage at a glance. Maybe you prefer a different model. Maybe certain shortcuts do not work in your terminal.
This lesson covers environment variables, status line customization, themes, and keybindings. These are the tools for making Claude Code feel like yours.
Environment variables configure Claude Code before it starts. Set them in your shell profile (.bashrc, .zshrc, etc.) or for individual sessions.
Common variables:
CLAUDE_MODEL - Set the default model:
MAX_THINKING_TOKENS - Limit thinking token budget:
CLAUDE_CODE_EFFORT_LEVEL - Set default effort level:
Options: low, medium, high
CLAUDE_CODE_USE_BEDROCK - Use Amazon Bedrock:
Where to set them:
For all sessions, add to your shell profile:
For one session, set before running Claude Code:
The status line at the bottom of your screen shows useful information. Customize it with /statusline:
Auto-configure from shell:
Running /statusline without arguments auto-configures based on your shell prompt. It picks sensible defaults.
Describe what you want:
Claude configures the status line to show those elements.
Common elements:
Current model
Context usage (percentage or tokens)
Working directory
Git branch
Uncommitted file count
Session name
Visual indicators:
The status line can show progress bars for context usage, making it easy to see at a glance when you are running low.
Themes change the colors in Claude Code:
This opens a theme picker with options:
Dark themes: For dark terminal backgrounds
Light themes: For light terminal backgrounds
Colorblind-accessible: Daltonized color schemes
ANSI themes: Use your terminal's color palette
Pick what looks good and is readable for you. The theme persists across sessions.
Prompt bar color:
For a quick visual cue without changing the whole theme:
Available: red, blue, green, yellow, purple, orange, pink, cyan, default
This is session-only. Use different colors for different projects.
If default shortcuts conflict with your terminal or you prefer different bindings:
This opens your keybindings configuration file. The format is JSON:
Common customizations:
Change the submit key (default: Enter)
Add chord bindings (multiple keys in sequence)
Rebind shortcuts that conflict with your terminal
Most users find defaults work well. Customize only if you have specific conflicts.
Vim mode:
If you prefer Vim keybindings for input:
Then select Editor mode > Vim
Vim mode gives you modal editing, navigation commands, and text objects in the input field.
Some terminals need configuration for Claude Code shortcuts to work:
This configures keybindings for Shift+Enter and other shortcuts. Only appears in terminals that need it (VS Code integrated terminal, Alacritty, Warp, etc.).
Persistent (saved to settings.json):
Theme
Default model
Permission rules
Status line configuration
Keybindings
Editor mode (normal/Vim)
Session-only (reset on exit):
Prompt bar color (/color)
Fast mode toggle
Effort level (unless set in config)
Current permission mode
If you want something to persist, check if there is a setting in /config rather than just using the session command.
Settings are stored in JSON files:
~/.claude/settings.json - User settings (all projects)
./claude/settings.json - Project settings (this project)
You can edit these directly:
Or use /config for a friendlier interface.
Environment variables configure Claude Code before startup
/statusline customizes the information shown at the bottom
/theme changes colors; /color changes just the prompt bar
/keybindings lets you customize keyboard shortcuts
Some settings persist across sessions, others are session-only
Settings live in ~/.claude/settings.json and ./.claude/settings.json
Customize your Claude Code setup:
Run /statusline to auto-configure from your shell.
Run /theme and pick a different theme.
Run /color green to change your prompt bar.
Run /config and explore the settings interface.
Find the Editor mode setting and look at the options.
Exit Claude Code and start a new session.
Notice which settings persisted (theme) and which reset (color).
This exercise shows how to make Claude Code feel like your own.
https://code.claude.com/docs/en/env-vars - Environment variables reference
https://code.claude.com/docs/en/statusline - Status line customization
https://code.claude.com/docs/en/keybindings - Keybinding configuration