AI-101

Lesson 20

Environment and Status Line

AI Confidence: 90%

AI-generated

Environment and Status Line

Learning Objectives

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

Introduction

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

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:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

MAX_THINKING_TOKENS - Limit thinking token budget:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

CLAUDE_CODE_EFFORT_LEVEL - Set default effort level:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Options: low, medium, high

CLAUDE_CODE_USE_BEDROCK - Use Amazon Bedrock:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Where to set them:

For all sessions, add to your shell profile:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

For one session, set before running Claude Code:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop
Customizing the Status Line

The status line at the bottom of your screen shows useful information. Customize it with /statusline:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Auto-configure from shell:

Running /statusline without arguments auto-configures based on your shell prompt. It picks sensible defaults.

Describe what you want:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

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.

Changing Themes

Themes change the colors in Claude Code:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

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:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Available: red, blue, green, yellow, purple, orange, pink, cyan, default

This is session-only. Use different colors for different projects.

Configuring Keybindings

If default shortcuts conflict with your terminal or you prefer different bindings:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

This opens your keybindings configuration file. The format is JSON:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

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:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Then select Editor mode > Vim

Vim mode gives you modal editing, navigation commands, and text objects in the input field.

Terminal Setup

Some terminals need configuration for Claude Code shortcuts to work:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

This configures keybindings for Shift+Enter and other shortcuts. Only appears in terminals that need it (VS Code integrated terminal, Alacritty, Warp, etc.).

Settings That Persist

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 Files

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:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Or use /config for a friendlier interface.

Key Takeaways

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

Try It Yourself

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.

Sources

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