Skip to content

Commit 1bc5c51

Browse files
lroolleclaude
andcommitted
feat: clean startup message redesign for better UX
- Reduce startup output from 65+ lines to ~10 lines of essential info - Add color-coded headers with version, auth status, and trace status - Implement transparent volume listing with descriptive tags - Add conditional environment display based on authentication mode - Create consistent branding between local and Docker modes - Add prominent bypass mode warnings for security awareness - Make docker-entrypoint.sh verbose output conditional on VERBOSE flag 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 45d8f6a commit 1bc5c51

7 files changed

Lines changed: 484 additions & 122 deletions

File tree

.github/ISSUE_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Description
2+
Brief description of the issue or feature request.
3+
4+
## Type
5+
- [ ] Bug fix
6+
- [ ] New feature
7+
- [ ] Enhancement
8+
- [ ] Documentation
9+
10+
## Details
11+
Detailed description of the problem and proposed solution.
12+
13+
## Related Files
14+
List of files that need to be modified.
15+
16+
## Test Plan
17+
How to verify the fix works.

.github/workflows/release.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "Tag to release"
11+
required: true
12+
type: string
13+
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: ${{ github.repository }}
17+
18+
jobs:
19+
shellcheck:
20+
name: Shell Linting
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Run ShellCheck
27+
uses: ludeeus/action-shellcheck@master
28+
with:
29+
scandir: "."
30+
format: gcc
31+
severity: warning
32+
33+
build-and-push:
34+
name: Build and Push Docker Image
35+
runs-on: ubuntu-latest
36+
needs: shellcheck
37+
permissions:
38+
contents: read
39+
packages: write
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
- name: Set up QEMU
45+
uses: docker/setup-qemu-action@v3
46+
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
50+
- name: Log in to Container Registry
51+
uses: docker/login-action@v3
52+
with:
53+
registry: ${{ env.REGISTRY }}
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Extract metadata
58+
id: meta
59+
uses: docker/metadata-action@v5
60+
with:
61+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
62+
tags: |
63+
type=ref,event=tag
64+
type=raw,value=latest,enable={{is_default_branch}}
65+
66+
- name: Build and push Docker image
67+
uses: docker/build-push-action@v5
68+
with:
69+
context: .
70+
platforms: linux/amd64,linux/arm64
71+
push: true
72+
tags: ${{ steps.meta.outputs.tags }}
73+
labels: ${{ steps.meta.outputs.labels }}
74+
cache-from: type=gha
75+
cache-to: type=gha,mode=max
76+
77+
release:
78+
name: Create GitHub Release
79+
runs-on: ubuntu-latest
80+
needs: build-and-push
81+
permissions:
82+
contents: write
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 0
88+
89+
- name: Get version from tag
90+
id: version
91+
run: |
92+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
93+
echo "version=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
94+
else
95+
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
96+
fi
97+
98+
- name: Update version in claude.sh
99+
run: |
100+
VERSION="${{ steps.version.outputs.version }}"
101+
# Remove 'v' prefix if present
102+
VERSION=${VERSION#v}
103+
sed -i "s/^VERSION=.*/VERSION=\"$VERSION\"/" claude.sh
104+
git config --local user.email "action@github.com"
105+
git config --local user.name "GitHub Action"
106+
git add claude.sh
107+
git commit -m "Update version to $VERSION" || echo "No changes to commit"
108+
109+
- name: Generate release notes
110+
id: release_notes
111+
run: |
112+
# Get the previous tag
113+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
114+
115+
# Generate release notes
116+
if [ -n "$PREVIOUS_TAG" ]; then
117+
echo "## Changes since $PREVIOUS_TAG" > release_notes.md
118+
echo "" >> release_notes.md
119+
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD >> release_notes.md
120+
else
121+
echo "## Initial Release" > release_notes.md
122+
echo "" >> release_notes.md
123+
echo "First release of Claude Code YOLO - Docker wrapper for Claude CLI with safe YOLO mode." >> release_notes.md
124+
fi
125+
126+
echo "" >> release_notes.md
127+
echo "## Docker Images" >> release_notes.md
128+
echo "" >> release_notes.md
129+
echo "- \`ghcr.io/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}\`" >> release_notes.md
130+
echo "- \`ghcr.io/${{ env.IMAGE_NAME }}:latest\`" >> release_notes.md
131+
echo "" >> release_notes.md
132+
echo "## Supported Architectures" >> release_notes.md
133+
echo "" >> release_notes.md
134+
echo "- linux/amd64" >> release_notes.md
135+
echo "- linux/arm64" >> release_notes.md
136+
137+
- name: Create Release
138+
uses: softprops/action-gh-release@v1
139+
with:
140+
tag_name: ${{ steps.version.outputs.version }}
141+
name: Release ${{ steps.version.outputs.version }}
142+
body_path: release_notes.md
143+
generate_release_notes: true
144+
append_body: true
145+
env:
146+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- Unified logging system for improved UX
12+
- Clean output by default showing only authentication method
13+
- Verbose mode displays model selection, proxy configuration, and debug info
14+
1015
### Fixed
1116
- Argument parsing infinite loop in claude-yolo for --inspect and --ps options
1217
- Duplicate argument handling causing inconsistent behavior with mixed options
@@ -16,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1621
### Changed
1722
- Consolidated all claude-yolo argument parsing through single parse_args() function
1823
- Enhanced claude-trace argument injection for proper --dangerously-skip-permissions placement
24+
- Improved logging organization
25+
- Updated documentation with logging capabilities and examples
1926

2027
## [0.1.0] - 2025-06-21
2128

@@ -51,4 +58,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5158
- Directory access limited to current working directory
5259
- Non-root execution inside container
5360
- Docker socket mounting disabled by default
54-
- Warning system for dangerous directories (home, system directories)
61+
- Warning system for dangerous directories (home, system directories)

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ npm install -g @mariozechner/claude-trace
129129
# Enable tracing in local mode
130130
./claude.sh --trace .
131131

132-
# Enable tracing in YOLO mode
132+
# Enable tracing in YOLO mode
133133
./claude.sh --yolo --trace .
134134

135135
# Bedrock with tracing

DEV-LOGS.md

Lines changed: 153 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,18 @@
55

66
## Issue Analysis: 2025-06-22
77

8-
### [enhancement-completed] Script simplification and trace syntax fixes
8+
### [enhancement-completed] Script simplification
99

1010
**Problems Fixed**:
1111

12-
1. **Inconsistent claude-trace syntax**: Fixed local mode missing "claude" command
13-
- Local: `claude-trace --run-with claude .` (was missing "claude")
14-
- Docker: `claude-trace --run-with .` → properly transforms to `--run-with claude --dangerously-skip-permissions .`
15-
16-
2. **USE_NONROOT complexity eliminated**: Removed 50+ lines of unnecessary code
12+
1. **USE_NONROOT complexity eliminated**: Removed 50+ lines of unnecessary code
1713
- Always run as claude user (was already default behavior)
1814
- Removed dead root mode code path from docker-entrypoint.sh
1915
- Simplified UID/GID mapping logic
2016

2117
**Results**:
2218
- ✅ Consistent trace syntax between local and Docker modes
2319
- ✅ 50+ lines removed from docker-entrypoint.sh
24-
- ✅ Cleaner, more maintainable codebase
2520
- ✅ Always run as claude user for security and simplicity
2621

2722
**Status**: ✅ **COMPLETED**
@@ -30,11 +25,161 @@
3025

3126
## Issue Analysis: 2025-06-22
3227

28+
### [bug-fixed] Incorrect Claude CLI usage with redundant '.' directory argument
29+
30+
**Problem**: Throughout the codebase, Claude CLI was being used incorrectly with '.' as a directory argument.
31+
32+
**Root Cause**: Claude CLI doesn't take a directory argument. According to `claude --help`, Claude:
33+
- Starts an interactive session by default
34+
- Automatically works in the current working directory
35+
- Takes `[prompt]` as an optional argument, not a directory path
36+
37+
**Issues Fixed**:
38+
- `claude .``claude` (the '.' was being passed as a prompt, not a directory)
39+
- `claude-yolo .``claude-yolo` (no directory argument needed)
40+
- All help text examples showing incorrect usage patterns
41+
42+
**Files Updated**:
43+
- **claude.sh**: Fixed 11 examples in help text
44+
- **claude-yolo**: Fixed 4 examples in help text
45+
- **All documentation**: Will need updating (README.md, CLAUDE.md, install.sh)
46+
47+
**Impact**: This explains why `--trace .` was showing version info instead of starting interactive mode - the '.' was being interpreted as a prompt argument to Claude.
48+
49+
**Status**: ✅ **COMPLETED** - Help text fixed, documentation needs updating
50+
51+
## Issue Analysis: 2025-06-22
52+
53+
### [enhancement-completed] Improved docker-entrypoint.sh environment detection
54+
55+
**Problem**: docker-entrypoint.sh incorrectly classified Dockerfile-installed files as "user-mounted" and provided poor environment information.
56+
57+
**Issues Fixed**:
58+
1. **Incorrect file classification**: `.oh-my-zsh`, `.zshrc`, `.local`, etc. marked as "user-mounted" when installed by Dockerfile
59+
2. **Poor environment detection**: Basic tool versions without context or organization
60+
3. **Verbose logging noise**: All container-installed files logged as if user-mounted
61+
4. **Missing tool information**: No detection of AWS CLI, GitHub CLI, Docker, etc. installed in container
62+
63+
**Solution Implemented**:
64+
- **Smart file classification**: Distinguish Dockerfile-installed vs user-mounted files
65+
- **Enhanced environment detection**: Show all development tools from Dockerfile (Python, Node.js, Go, Rust, AWS CLI, GitHub CLI, Docker)
66+
- **Organized verbose output**: Categorized sections for Tools, Authentication, Configuration
67+
- **Appropriate logging levels**: Container-installed files use `log_verbose`, user-mounted use `log_entrypoint`
68+
69+
**Technical Implementation**:
70+
- Updated file classification in `/root/*` handling with explicit categories
71+
- Enhanced `show_environment_info()` with structured tool detection
72+
- Added authentication status detection (AWS, GCloud, GitHub tokens)
73+
- Improved verbose logging organization with clear sections
74+
75+
**Results**:
76+
-**Accurate classification**: Container vs user-mounted files properly identified
77+
-**Comprehensive tool info**: All Dockerfile-installed tools detected and versioned
78+
-**Clean verbose output**: Organized sections with relevant information
79+
-**Reduced noise**: Container-installed files no longer logged as "user-mounted"
80+
81+
**Status**: ✅ **COMPLETED**
82+
83+
---
84+
85+
## Issue Analysis: 2025-06-22
86+
87+
### [enhancement-completed] Unified logging system implementation
88+
89+
**Problem**: Inconsistent logging patterns scattered throughout claude.sh and docker-entrypoint.sh with mixed approaches to verbosity control.
90+
91+
**Issues Fixed**:
92+
1. **Inconsistent patterns**: Mix of `[ "$QUIET" != true ] && echo`, `[ "$VERBOSE" = true ] && echo`, direct echo
93+
2. **Duplicate logic**: Repeated verbosity checks throughout both scripts
94+
3. **Poor maintainability**: No centralized logging functions
95+
4. **Inconsistent stderr usage**: Some logs to stdout, others to stderr
96+
97+
**Solution Implemented**:
98+
- **Unified logging functions**: `log_info()`, `log_verbose()`, `log_error()`, `log_warn()`
99+
- **Specialized functions**: `log_auth()`, `log_model()`, `log_proxy()`, `log_entrypoint()`
100+
- **Consistent stderr routing**: All logs go to stderr, keeping stdout clean
101+
- **Centralized flag handling**: Single point of verbosity control per script
102+
103+
**Technical Implementation**:
104+
- Added 6 core logging functions to both scripts
105+
- Migrated 33+ logging patterns in claude.sh to unified system
106+
- Migrated 20+ logging patterns in docker-entrypoint.sh with argument-based detection
107+
- Updated documentation across README.md, CLAUDE.md, CHANGELOG.md
108+
- Maintained backward compatibility
109+
110+
**Results**:
111+
-**Consistent API**: All logging through standardized functions
112+
-**Clean migration**: Drop-in replacements for existing patterns
113+
-**Proper flag handling**: Centralized QUIET/VERBOSE logic
114+
-**Maintainable code**: Eliminated duplicate logging logic
115+
-**Enhanced UX**: Clean, controllable output at all verbosity levels
116+
117+
**Status**: ✅ **COMPLETED**
118+
119+
---
120+
121+
## Issue Analysis: 2025-06-22
122+
123+
### [enhancement-completed] Clean up version and startup message verbosity
124+
125+
**Problem**: Current --version and startup messages are excessively verbose, poor UX.
126+
127+
**Issues Fixed**:
128+
1. **--version chaos**: Shows full container startup + environment info + linking messages
129+
2. **Startup noise**: 30+ lines of environment info, entrypoint messages, linking details
130+
3. **Poor expectations**: Users expect clean, fast version info
131+
132+
**Solution Implemented**:
133+
- **--version**: Clean local version only ("Claude Code YOLO v0.2.0")
134+
- **--version --verbose**: Extended info including Claude CLI version via container check
135+
- **Startup**: Two-line summary with key info:
136+
```
137+
Claude Code YOLO v0.2.0 | Auth: OAuth | Working: /path/to/project
138+
Container: claude-code-yolo-myproject-12345
139+
```
140+
- **Flags**: Added --quiet and --verbose for user control over output verbosity
141+
142+
**Technical Implementation**:
143+
- Two-pass argument parsing: collect --verbose/--quiet flags first
144+
- Conditional message display based on verbosity flags
145+
- Docker entrypoint checks for --quiet/--verbose in arguments
146+
- Clean auth method display mapping (claude → OAuth)
147+
148+
**Results**:
149+
-**--version**: Single line output (was 30+ lines)
150+
-**--version --verbose**: Extended info when needed
151+
-**Startup**: Two-line summary (was verbose environment dump)
152+
-**Control flags**: --quiet and --verbose work in both local and Docker modes
153+
154+
**Status**: ✅ **COMPLETED**
155+
156+
---
157+
158+
## Issue Analysis: 2025-06-22
159+
160+
### [enhancement-completed] Script simplification and consistency fixes
161+
162+
**Problem**: Inconsistent claude-trace syntax and unnecessary USE_NONROOT complexity.
163+
164+
**Solutions Implemented**:
165+
- Fixed claude.sh:305 claude-trace syntax (removed "claude" argument)
166+
- Removed USE_NONROOT variable and dead root mode code
167+
- Simplified docker-entrypoint.sh by 50+ lines
168+
- Always run as claude user for consistency
169+
170+
**Result**: Cleaner, more maintainable codebase with consistent behavior.
171+
172+
**Status**: ✅ **COMPLETED**
173+
174+
---
175+
176+
## Issue Analysis: 2025-06-22
177+
33178
### [issue-analysis] claude.sh and docker-entrypoint.sh complexity review
34179

35180
**Problems Identified**:
36181

37-
1. **Inconsistent claude-trace syntax**:
182+
1. **Inconsistent claude-trace syntax**:
38183
- claude.sh:305 (local): `--run-with claude .`
39184
- claude.sh:648 (docker): `--run-with .`
40185

0 commit comments

Comments
 (0)