Pane is mostly transparent — your existing shell env passes through unchanged. Pane adds a small set of variables describing the current pane so you can conditionally configure shell init scripts or agent prompts.
Pane-injected variables
| Variable | Value |
|---|---|
PANE_WORKTREE_PATH | Absolute path to the pane’s worktree on disk |
PANE_WORKTREE_BRANCH | The branch the worktree is tracking |
PANE_NAME | The user-facing pane name you set at creation |
PANE_ID | Stable UUID for the pane, consistent across restarts |
These are available immediately in any shell command or script running inside a pane.
Setting env vars per pane
Three common patterns:
1. Shell init script with conditional logic
In ~/.zshrc or ~/.bashrc, branch on PANE_WORKTREE_PATH:
if [[ "$PANE_WORKTREE_PATH" == *"/api-pane"* ]]; then
export ANTHROPIC_API_KEY="sk-ant-api-key..."
fi2. Per-pane .envrc with direnv
Add a .envrc to the worktree root:
export ANTHROPIC_API_KEY="sk-ant-..."
export DATABASE_URL="postgres://localhost/myapp_dev"Run direnv allow once in the pane’s terminal. direnv re-loads the vars whenever you enter the directory. Install direnv from direnv.net .
3. Per-pane .env with dotenv-cli
# .env in worktree root
ANTHROPIC_API_KEY=sk-ant-...
DATABASE_URL=postgres://localhost/myapp_devPrefix commands with dotenv --:
dotenv -- claudeInstall with npm install -g dotenv-cli.
Provider keys
Pane does not store provider API keys. Agents read keys directly from your shell environment. See AI providers for the full list of ANTHROPIC_API_KEY, OPENAI_API_KEY, and other provider-specific variables.
Avoiding collision in parallel panes
Two panes can run the same agent with different provider keys simultaneously:
Each pane’s shell is a separate process. Env vars set in one shell do not leak into another. Both agents run concurrently against their own keys with no interference.
Related
- AI providers — provider-specific env var names and docs links
- MCP servers — passing credentials to MCP servers
- Security & permissions — what Pane does and does not transmit off-device