Skip to content

Commit c688a59

Browse files
committed
feat(config): add full config ref, unify model aliasing, improve env/vol parsing
- Add `.claude-yolo.full` and simplify example - Refactor env/volume parsing and model aliasing - Add MAX_THINKING_TOKENS and proxy env support
1 parent e078f53 commit c688a59

8 files changed

Lines changed: 587 additions & 312 deletions

File tree

.claude-yolo.example

Lines changed: 14 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,24 @@
1-
# Claude YOLO - Sensible Configuration Example
1+
# Claude YOLO - Essential Configuration
22
#
3-
# This file provides practical defaults for common development workflows.
4-
# Copy to .claude-yolo (shared) or .claude-yolo.local (gitignored) to use.
3+
# Copy to:
4+
# - $XDG_CONFIG_HOME/claude-yolo/.claude-yolo (global, follows XDG spec)
5+
# - ~/.claude-yolo (legacy global location)
6+
# - .claude-yolo (project-specific)
7+
# - .claude-yolo.local (local overrides, gitignored)
58
#
6-
# Config files are loaded in order:
7-
# 1. ~/.claude-yolo (global defaults)
8-
# 2. .claude-yolo (project shared)
9-
# 3. .claude-yolo.local (project local overrides)
10-
#
11-
# CLI arguments always override config file settings.
12-
# Note: Auth mode and model settings are managed via CLI flags, not config files.
13-
14-
# ========================================
15-
# Git and Development Configuration
16-
# ========================================
9+
# Loading order: XDG global → legacy global → project → local
1710

18-
# Mount SSH keys for git operations (read-only)
11+
# Git integration (most common need)
1912
VOLUME=~/.ssh:/home/claude/.ssh:ro
20-
21-
# Mount git configuration
2213
VOLUME=~/.gitconfig:/home/claude/.gitconfig:ro
23-
VOLUME=~/.config/git:/home/claude/.config/git:ro
24-
25-
# ========================================
26-
# Claude-specific Environment Variables
27-
# ========================================
2814

29-
# Maintain project working directory context
15+
# Sensible Claude behavior
3016
ENV=CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=true
31-
32-
# Disable telemetry for privacy
3317
ENV=DISABLE_TELEMETRY=1
3418

35-
# ========================================
36-
# Common Development Volume Mounts
37-
# ========================================
38-
39-
# Mount shared development tools and scripts
40-
# VOLUME=~/tools:/home/claude/tools:ro
41-
# VOLUME=~/scripts:/home/claude/scripts:ro
42-
43-
# Mount project documentation and references
44-
# VOLUME=$(pwd)/docs:/home/claude/project-docs:ro
45-
# VOLUME=$(pwd)/references:/home/claude/references:ro
46-
# VOLUME=$(pwd)/examples:/home/claude/examples:ro
47-
48-
# Mount additional development directories
49-
# VOLUME=~/workspace:/home/claude/workspace:ro
50-
# VOLUME=~/templates:/home/claude/templates:ro
51-
# VOLUME=~/dotfiles:/home/claude/dotfiles:ro
52-
53-
# Mount cache directories for faster builds
54-
# VOLUME=~/.cache/pip:/home/claude/.cache/pip
55-
# VOLUME=~/.npm:/home/claude/.npm:ro
56-
# VOLUME=~/.cargo:/home/claude/.cargo:ro
57-
58-
# ========================================
59-
# Development Environment Variables
60-
# ========================================
61-
62-
# Common development settings
63-
ENV=NODE_ENV=development
64-
ENV=LOG_LEVEL=info
65-
66-
# Environment variables with fallback defaults
67-
# ENV=GITHUB_TOKEN=${GITHUB_TOKEN:-}
68-
# ENV=NPM_TOKEN=${NPM_TOKEN:-}
69-
# ENV=API_KEY=${API_KEY:-}
70-
# ENV=DEBUG=${DEBUG:-}
71-
# ENV=CACHE_DIR=${CACHE_DIR:-/tmp/cache}
72-
73-
# ========================================
74-
# Additional Volume Mount Examples
75-
# ========================================
76-
77-
# Development database storage
78-
# VOLUME=~/dev-data:/home/claude/dev-data
79-
80-
# Local package/dependency caches (read-only for safety)
81-
# VOLUME=~/.m2:/home/claude/.m2:ro
82-
# VOLUME=~/.gradle:/home/claude/.gradle:ro
83-
# VOLUME=~/.composer:/home/claude/.composer:ro
19+
# Mount Extra Voulmes for Claude Code References
20+
# VOLUME=/path/to/some-docs:$(pwd)/references/some-docs:ro
21+
# VOLUME=/path/to/some-script.sh:/home/claude/.local/bin/some-script.sh:ro
8422

85-
# Docker-in-Docker support (requires CCYOLO_DOCKER_SOCKET=true)
86-
# VOLUME=/var/run/docker.sock:/var/run/docker.sock
23+
# Environment variables from host
24+
# ENV=${GH_TOKEN}

.claude-yolo.full

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Claude YOLO - Complete Configuration Reference
2+
#
3+
# ALL available configuration options for claude-yolo
4+
# Copy sections to your config files as needed:
5+
# - $XDG_CONFIG_HOME/claude-yolo/.claude-yolo (global)
6+
# - ~/.claude-yolo (legacy global)
7+
# - .claude-yolo (project)
8+
# - .claude-yolo.local (local overrides)
9+
10+
# =====================================
11+
# Core Variables
12+
# =====================================
13+
14+
# Authentication method (overridden by CLI flags)
15+
AUTH_MODE=claude # claude|oat|api-key|bedrock|vertex
16+
17+
# Model selection (when using API auth)
18+
ANTHROPIC_MODEL=sonnet-4 # Model alias or full name
19+
20+
# Custom config directory for authentication
21+
CONFIG_DIR=~/.claude-custom # Directory path (creates if missing)
22+
23+
# Enable debug tracing
24+
USE_TRACE=true # true|false|1|0
25+
TRACE=true # Alias for USE_TRACE
26+
27+
# Verbose output
28+
VERBOSE=true # true|false|1|0
29+
30+
# Force YOLO mode (Docker execution)
31+
USE_DOCKER=true # true|false|1|0
32+
YOLO=true # Alias for USE_DOCKER
33+
34+
# Continue previous session
35+
CONTINUE=true # true|false|1|0 (adds --continue flag)
36+
37+
# Use host networking in Docker
38+
HOST_NET=true # true|false|1|0
39+
40+
# =====================================
41+
# Environment Variables
42+
# =====================================
43+
44+
# Claude-specific settings
45+
ENV=CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=true
46+
ENV=DISABLE_TELEMETRY=1
47+
ENV=CLAUDE_TIMEOUT=300
48+
49+
# API limits and behavior
50+
ENV=MAX_TOKENS=8192
51+
ENV=ANTHROPIC_MAX_RETRIES=3
52+
ENV=ANTHROPIC_TIMEOUT=60
53+
54+
# AWS Bedrock settings (when using --bedrock)
55+
ENV=AWS_REGION=us-west-2
56+
ENV=AWS_PROFILE=default
57+
58+
# Google Vertex AI settings (when using --vertex)
59+
ENV=GOOGLE_CLOUD_PROJECT=my-project
60+
ENV=GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
61+
62+
# Development environment
63+
ENV=NODE_ENV=development
64+
ENV=PYTHON_ENV=development
65+
ENV=DEBUG=*
66+
ENV=LOG_LEVEL=debug
67+
68+
# Pass through host environment variables
69+
ENV=${GITHUB_TOKEN}
70+
ENV=${NPM_TOKEN}
71+
ENV=${DOCKER_HOST}
72+
ENV=${DATABASE_URL}
73+
ENV=${API_KEY}
74+
ENV=${SECRET_KEY}
75+
76+
# Environment variables with defaults
77+
ENV=CACHE_DIR=${CACHE_DIR:-/tmp/cache}
78+
ENV=BUILD_ENV=${BUILD_ENV:-development}
79+
ENV=PORT=${PORT:-3000}
80+
81+
# =====================================
82+
# Volume Mounts
83+
# =====================================
84+
85+
# Git and SSH (essential for most projects)
86+
VOLUME=~/.ssh:/home/claude/.ssh:ro
87+
VOLUME=~/.gitconfig:/home/claude/.gitconfig:ro
88+
VOLUME=~/.config/git:/home/claude/.config/git:ro
89+
90+
# Authentication and credentials
91+
VOLUME=~/.aws:/root/.aws:ro
92+
VOLUME=~/.config/gcloud:/root/.config/gcloud:ro
93+
VOLUME=~/.docker:/home/claude/.docker:ro
94+
95+
# Development tools and configurations
96+
VOLUME=~/.vimrc:/home/claude/.vimrc:ro
97+
VOLUME=~/.tmux.conf:/home/claude/.tmux.conf:ro
98+
VOLUME=~/.zshrc:/home/claude/.zshrc:ro
99+
VOLUME=~/.bashrc:/home/claude/.bashrc:ro
100+
101+
# Language-specific package managers (read-only for safety)
102+
VOLUME=~/.npm:/home/claude/.npm:ro
103+
VOLUME=~/.yarn:/home/claude/.yarn:ro
104+
VOLUME=~/.cache/pip:/home/claude/.cache/pip
105+
VOLUME=~/.cache/yarn:/home/claude/.cache/yarn
106+
VOLUME=~/.cargo:/home/claude/.cargo:ro
107+
VOLUME=~/.rustup:/home/claude/.rustup:ro
108+
VOLUME=~/.m2:/home/claude/.m2:ro
109+
VOLUME=~/.gradle:/home/claude/.gradle:ro
110+
VOLUME=~/.composer:/home/claude/.composer:ro
111+
VOLUME=~/.gem:/home/claude/.gem:ro
112+
113+
# Project-specific mounts
114+
VOLUME=$(pwd)/docs:/workspace/docs:ro
115+
VOLUME=$(pwd)/references:/workspace/references:ro
116+
VOLUME=$(pwd)/scripts:/workspace/scripts:ro
117+
VOLUME=$(pwd)/tools:/workspace/tools:ro
118+
VOLUME=$(pwd)/templates:/workspace/templates:ro
119+
120+
# Shared development resources
121+
VOLUME=~/workspace:/home/claude/workspace:ro
122+
VOLUME=~/tools:/home/claude/tools:ro
123+
VOLUME=~/scripts:/home/claude/scripts:ro
124+
VOLUME=~/dotfiles:/home/claude/dotfiles:ro
125+
126+
# Development data and databases
127+
VOLUME=~/dev-data:/home/claude/dev-data
128+
VOLUME=~/tmp:/home/claude/tmp
129+
130+
# Docker-in-Docker (requires careful consideration)
131+
VOLUME=/var/run/docker.sock:/var/run/docker.sock
132+
133+
# Build and cache directories
134+
VOLUME=~/.cache:/home/claude/.cache
135+
VOLUME=~/build-cache:/home/claude/build-cache
136+
137+
# Logs and output directories
138+
VOLUME=~/logs:/home/claude/logs
139+
VOLUME=~/output:/home/claude/output
140+
141+
# =====================================
142+
# Security Notes
143+
# =====================================
144+
#
145+
# VOLUME paths support:
146+
# - ~ (home directory expansion)
147+
# - $(pwd) (current working directory)
148+
# - $PWD (current working directory)
149+
# - Absolute paths only
150+
#
151+
# ENV values support:
152+
# - ${VAR:-default} (environment expansion with defaults)
153+
# - Direct values
154+
# - Host environment pass-through (ENV=VARNAME)
155+
#
156+
# Security restrictions:
157+
# - No command substitution except $(pwd)
158+
# - No backticks allowed
159+
# - No path traversal (..) in CONFIG_DIR
160+
# - Variable names must be [A-Z][A-Z0-9_]*
161+
#
162+
# =====================================

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2323
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \
2424
apt-get update && \
2525
apt-get install -y --no-install-recommends \
26-
ca-certificates curl wget git gnupg lsb-release locales sudo \
26+
ca-certificates curl wget git git-lfs gnupg lsb-release locales sudo \
2727
software-properties-common build-essential pkg-config libssl-dev \
2828
unzip zip bzip2 xz-utils tini gosu less man-db \
2929
python3-dev libffi-dev \
3030
jq ripgrep lsof tree make gcc g++ \
3131
openssh-client rsync \
3232
shellcheck bat fd-find silversearcher-ag \
3333
vim \
34-
git procps psmisc zsh && \
34+
procps psmisc zsh && \
3535
add-apt-repository ppa:deadsnakes/ppa && \
3636
apt-get update && \
3737
apt-get install -y --no-install-recommends \
@@ -108,6 +108,7 @@ RUN --mount=type=cache,target=/tmp/delta-cache,sharing=locked \
108108
mv delta-0.18.2-${DELTA_ARCH}-unknown-linux-gnu/delta /usr/local/bin/ && \
109109
rm -rf delta-0.18.2-${DELTA_ARCH}-unknown-linux-gnu*
110110

111+
111112
ENV NPM_CONFIG_FETCH_RETRIES=5 \
112113
NPM_CONFIG_FETCH_RETRY_FACTOR=2 \
113114
NPM_CONFIG_FETCH_RETRY_MINTIMEOUT=10000
@@ -139,6 +140,10 @@ RUN npm config set prefix "$CLAUDE_HOME/.npm-global" && \
139140
npm install -g @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION} @mariozechner/claude-trace && \
140141
npm cache clean --force
141142

143+
# Install Go tools for Atlassian integration (Confluence/Jira/Bitbucket)
144+
RUN go install github.com/lroolle/atlas-cli/cmd/atl@main && \
145+
sudo mv $HOME/go/bin/atl /usr/local/bin/
146+
142147
RUN git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh "$CLAUDE_HOME/.oh-my-zsh" && \
143148
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions "$CLAUDE_HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" && \
144149
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git "$CLAUDE_HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
@@ -148,7 +153,7 @@ RUN echo 'export ZSH="$HOME/.oh-my-zsh"' > "$CLAUDE_HOME/.zshrc" && \
148153
echo 'ZSH_THEME="robbyrussell"' >> "$CLAUDE_HOME/.zshrc" && \
149154
echo 'plugins=(git docker python golang node npm aws zsh-autosuggestions zsh-syntax-highlighting)' >> "$CLAUDE_HOME/.zshrc" && \
150155
echo 'source $ZSH/oh-my-zsh.sh' >> "$CLAUDE_HOME/.zshrc" && \
151-
echo 'export PATH=$HOME/.local/bin:$HOME/.npm-global/bin:/usr/local/go/bin:$PATH' >> "$CLAUDE_HOME/.zshrc"
156+
echo 'export PATH=$HOME/.local/bin:$HOME/.npm-global/bin:$HOME/go/bin:/usr/local/go/bin:$PATH' >> "$CLAUDE_HOME/.zshrc"
152157

153158
USER root
154159

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,35 @@ claude-yolo
128128

129129
**Note**: This avoids mounting `~/.config/gh/` which fails due to secure keyring storage in modern GitHub CLI versions.
130130

131+
## Configuration Files
132+
133+
Claude YOLO supports configuration files to persist your volume mounts, environment variables, and settings. Following the XDG Base Directory specification:
134+
135+
```bash
136+
# Configuration files are loaded in order (later files override earlier):
137+
1. $XDG_CONFIG_HOME/claude-yolo/.claude-yolo # Global config (default: ~/.config/claude-yolo/.claude-yolo)
138+
2. ~/.claude-yolo # Legacy global location
139+
3. .claude-yolo # Project-specific config
140+
4. .claude-yolo.local # Local overrides (gitignored)
141+
```
142+
143+
Example `.claude-yolo` file:
144+
```bash
145+
# Git integration
146+
VOLUME=~/.ssh:/home/claude/.ssh:ro
147+
VOLUME=~/.gitconfig:/home/claude/.gitconfig:ro
148+
149+
# Environment settings
150+
ENV=NODE_ENV=development
151+
ENV=DEBUG=myapp:*
152+
153+
# Claude settings
154+
ANTHROPIC_MODEL=sonnet-4
155+
USE_TRACE=true
156+
```
157+
158+
See `.claude-yolo.example` and `.claude-yolo.full` for more examples.
159+
131160
## Custom Volume Mounting
132161

133162
You can mount additional configuration files or directories using the `-v` flag:
@@ -198,9 +227,8 @@ make build
198227

199228
```bash
200229
make CLAUDE_CODE_VERSION=1.0.45 build # Specific version
201-
make CLAUDE_CODE_VERSION=latest build # Latest version
230+
make CLAUDE_CODE_VERSION=latest build # Latest version
202231
```
203-
Default: 1.0.44
204232

205233
## Inspired by
206234

0 commit comments

Comments
 (0)