Skip to content

Claude Code

Copy page

By default, Claude Code prompts for permission before running commands. There are several ways to handle this in worktrees:

To keep permission prompts but share granted permissions across worktrees:

files:
symlink:
- .claude/settings.local.json

Workrex uses .workrex.yaml, ~/.config/workrex/config.yaml, and WORKREX_* environment variables. See Configuration.

Add this to your global config (~/.config/workrex/config.yaml) or project’s .workrex.yaml. Since this file contains user-specific permissions, also add it to .gitignore:

.claude/settings.local.json

To skip prompts entirely, define a named agent with the flag:

~/.config/workrex/config.yaml
agents:
claude: "claude --dangerously-skip-permissions"

This shadows the built-in claude name so all worktrees that workrex creates use the flag automatically, without affecting claude outside of workrex.

You can also use a separate name and reference it per-project:

~/.config/workrex/config.yaml
agents:
cc-yolo: "claude --dangerously-skip-permissions"
# .workrex.yaml (in projects that need it)
agent: cc-yolo

Sometimes you want to continue a Claude conversation inside a worktree. Since worktrees are technically separate project directories, Claude Code treats them as different projects, so you cannot directly resume a conversation that started in another worktree (or the main tree).

claude-history solves this with its cross-project fork feature. Use --global mode to search conversations across all projects, then fork the one you want:

Terminal window
claude-history --global

Select a conversation and press Ctrl+F to fork it. When the conversation belongs to a different project than your current directory, claude-history automatically copies the session files into the current project and resumes there. The forked conversation then lives in the worktree as if it started there.

Multiple Claude configurations (work/personal)

Section titled “Multiple Claude configurations (work/personal)”

If you use separate Claude configurations for work and personal projects, define named agents in your global config:

~/.config/workrex/config.yaml
agents:
cc-work: "env CLAUDE_CONFIG_DIR=~/.claude-work claude"
cc-personal: "env CLAUDE_CONFIG_DIR=~/.claude-personal claude"

Then set the agent per project:

# work project .workrex.yaml
agent: cc-work

Or use it directly: workrex add feature -a cc-work.

You can also use CLAUDE_CONFIG_DIR with direnv to switch configurations per directory. This affects claude everywhere, not just workrex:

.envrc
export CLAUDE_CONFIG_DIR=~/.claude-work