From 5bbd757b45e161c9777c30dc3e5a95e9fe1048d0 Mon Sep 17 00:00:00 2001 From: ajmallesh Date: Wed, 19 Nov 2025 10:28:44 -0800 Subject: [PATCH] fix: resolve Docker build failure and clarify env var configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove .env file with incorrect CLAUDE_CODE_MAX_TOKENS variable - Remove .env copy from Dockerfile that was causing build to fail - Update README to distinguish local (export) vs Docker (-e) env var usage - Add CLAUDE_CODE_MAX_OUTPUT_TOKENS to all Docker run examples The correct variable is CLAUDE_CODE_MAX_OUTPUT_TOKENS (not CLAUDE_CODE_MAX_TOKENS) and should be passed at runtime via -e flag for Docker or export for local runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .env | 5 ----- Dockerfile | 1 - README.md | 12 +++++++++--- 3 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index fbfc976..0000000 --- a/.env +++ /dev/null @@ -1,5 +0,0 @@ -# CLAUDE_CODE_MAX_TOKENS controls the maximum token limit for Claude Code sessions -# This is used by the Claude Agent SDK to set the context window size for AI analysis -# Higher values allow for more comprehensive code analysis but consume more tokens -# Default: 64000 tokens (sufficient for most penetration testing tasks) -CLAUDE_CODE_MAX_TOKENS=64000 diff --git a/Dockerfile b/Dockerfile index c0d7b8f..a870073 100644 --- a/Dockerfile +++ b/Dockerfile @@ -109,7 +109,6 @@ WORKDIR /app # Copy package.json and package-lock.json first for better caching COPY package*.json ./ -COPY .env ./.env # Install Node.js dependencies as root RUN npm ci --only=production && \ diff --git a/README.md b/README.md index 2684e66..bbb5869 100644 --- a/README.md +++ b/README.md @@ -107,15 +107,19 @@ Shannon is available in two editions: You need either a **Claude Code OAuth token** or an **Anthropic API key** to run Shannon. Get your token from the [Anthropic Console](https://console.anthropic.com) and pass it to Docker via the `-e` flag. -### Environment Configuration (Optional) +### Environment Configuration (Recommended) -To prevent Claude Code from hitting token limits during long report generation, set the max output tokens before running Shannon: +To prevent Claude Code from hitting token limits during long report generation, set the max output tokens environment variable: +**For local runs:** ```bash export CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000 ``` -This is especially useful for extensive penetration testing reports or when analyzing large codebases. +**For Docker runs:** +```bash +-e CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000 +``` ### Quick Start with Docker @@ -164,6 +168,7 @@ docker run --rm -it \ --cap-add=NET_RAW \ --cap-add=NET_ADMIN \ -e CLAUDE_CODE_OAUTH_TOKEN="$CLAUDE_CODE_OAUTH_TOKEN" \ + -e CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000 \ -v "$(pwd)/repos:/app/repos" \ -v "$(pwd)/configs:/app/configs" \ shannon:latest \ @@ -180,6 +185,7 @@ docker run --rm -it \ --cap-add=NET_RAW \ --cap-add=NET_ADMIN \ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \ + -e CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000 \ -v "$(pwd)/repos:/app/repos" \ -v "$(pwd)/configs:/app/configs" \ shannon:latest \