Shared starter template configuration and CLAUDE.md memory bank system for Claude Code
npx skills add https://github.com/centminmod/my-claude-code-setup --skill claude-docs-consultantقم بتثبيت هذه المهارة باستخدام واجهة سطر الأوامر (CLI) وابدأ في استخدام سير عمل SKILL.md في مساحة عملك.
The beauty of using AI is that I can get AI to generate alternate Read Me guides using different formats and styles to suit different readers and learners. So I asked Claude Code to generate alternate Read Me guides in different styles - pick one that suits you best or read all of them to get a better understanding of how to use this project.
My Claude Code project's starter settings and Claude Code hooks and slash commands are provided in this repository for users to try out. The CLAUDE.md is setup as set of memory bank files to better retain context over many chat sessions. Be sure to read the official Claude Code docs first at https://docs.anthropic.com/en/docs/claude-code/overview and sign up for a paid Claude AI account to use Claude Code. You can pay for Claude Pro $20/month, Claude Max $100/month or Claude Max $200/month. The paid Claude tier plans will include varying quotas for usage and rate limits outlined here. You can also use Claude Code with Z.AI to get higher token usage quotas and get access to Z.AI GLM-4.7 LLM models within Claude Code. Use Z.AI invite code for additional 10% discount which can stack with current 50-60% yearly discounts.
to your liking. .claude/settings.jsonneeds to install Terminal-Notifier for macOS https://github.com/centminmod/terminal-notifier-setup. If you're not using macOS, you can remove.claude/settings.json`./init so that Claude Code analyses your code base and then populates your memory bank system files as per CLAUDE.md` instructions.brew install ripgrep fd jqdangerously_skip_permissions enabled and Codex CLI with sandbox_mode = danger-full-access etc..worktreeinclude file as outlined here.CLAUDE-cloudflare.md or CLAUDE-cloudflare-mini.md supplementary reference docs and update CLAUDE.md referencing either file to help AI understand Cloudflare and ClerkOS platforum documentation and products. Edit documentation templates as needed i.e. if you do not use ClerkOS platform, you can remove those sections.CLAUDE-convex.md supplementary reference docs for building Next.js and React apps with Convex backend deployed on Cloudflare Pages.CLAUDE.md uses a memory bank system of files for Claude Code to better retain context over many chat sessions. Example of Claude Code thinking output when I ask it to update memory bank after a successful task completion and git commit:
> update memory bank
∴ Thinking…
The user wants me to update the memory bank files. I should update the relevant CLAUDE-*.md files to reflect the v0.1.6 changes and current state. Let me check
which memory bank files exist and update them.
∴ Thinking…
I need to continue updating the memory bank files. I'll update:
1. CLAUDE-patterns.md - Add export path handling pattern (Pattern 22)
2. CLAUDE-decisions.md - Add ADR-017 for Phoneme API migration and ADR-018 for export path handling
3. CLAUDE-troubleshooting.md - Add new issues and solutions for v0.1.6
∴ Thinking…
The memory bank files have been modified but not committed. The v0.1.6 release was already committed and tagged, but the memory bank documentation updates are
still uncommitted. Let me provide a summary of the completed work and offer to commit these documentation changes.
⏺ Summary: v0.1.6 Release Complete ✅
Memory Bank Updates Complete:
- CLAUDE-activeContext.md - v0.1.6 session context
- CLAUDE-patterns.md - Added patterns 22-24 (Export Path, Format Detection, API Migration)
- CLAUDE-decisions.md - Added ADR-017 & ADR-018
- CLAUDE-troubleshooting.md - Added 4 new issue/fix entries
v0.1.6 Fixes Applied:
1. Export to absolute paths (e.g., --export /tmp/test.wav)
2. Format detection from filename extension (prevents .mp3.wav)
3. Phoneme API migrated to /dev/phonemize
4. Test scripts updated for --export "" syntax
Test Results: All 29 tests passing
The memory bank documentation updates are ready to commit. Would you like me to commit them
I also install the following MCP servers (install commands):
Browser and install Claude Code plugins from official marketplace https://code.claude.com/docs/en/discover-plugins.
/plugin install plugin-name@claude-plugins-official
To update official Claude Code plugin marketplace:
/plugin marketplace update claude-plugins-official
Install code simplifier plugin.
Agent that simplifies and refines code for clarity, consistency, and maintainability while preserving functionality. Focuses on recently modified code.
/plugin install code-simplifier
Install frontend design plugin.
Create distinctive, production-grade frontend interfaces with high design quality. Generates creative, polished code that avoids generic AI aesthetics.
/plugin install frontend-design@claude-code-plugins
Install feature dev plugin.
The Feature Development Plugin provides a systematic 7-phase approach to building new features. Instead of jumping straight into code, it guides you through understanding the codebase, asking clarifying questions, designing architecture, and ensuring quality—resulting in better-designed features that integrate seamlessly with your existing code.
/plugin install feature-dev@claude-code-plugins
Install Ralph Wiggum plugin. Details https://paddo.dev/blog/ralph-wiggum-autonomous-loops/. Update: currently seems broken on some systems.
Interactive self-referential AI loops for iterative development. Claude works on the same task repeatedly, seeing its previous work, until completion.
/plugin install ralph-wiggum@claude-code-plugins
How to use Ralph Wiggum plugin YouTube by Greg Isenberg and Ryan Carson https://www.youtube.com/watch?v=RpvQH0r0ecM and GitHub repo https://github.com/snarktank/ralph.
Claude Code Safety Net plugin https://github.com/kenryu42/claude-code-safety-net to prevent destructive commands being run by Claude Code i.e. https://www.reddit.com/r/ClaudeAI/comments/1pgxckk/claude_cli_deleted_my_entire_home_directory_wiped/
A Claude Code plugin that acts as a safety net, catching destructive git and filesystem commands before they execute.
/plugin marketplace add kenryu42/cc-marketplace
/plugin install safety-net@cc-marketplace
Z.AI usage query plugin for querying Z.AI usage statistics.
Query your current quota and usage statistics for the GLM Coding Plan directly within Claude Code.
/plugin marketplace add zai/zai-coding-plugins
/plugin install glm-plan-usage@zai-coding-plugins
Cloudflare Skills marketplace for building applications on Cloudflare's platform, Workers, and the Agents SDK.
Collection of Agent Skills providing accurate, up-to-date guidance for Cloudflare development tasks including Workers, Pages, AI services, and infrastructure.
/plugin marketplace add cloudflare/skills
User commands: /cloudflare:build-agent, /cloudflare:build-mcp
~/.claude/statuslines/statusline.sh configured in ~/.claude/settings.json.
for ~/.claude/settings.json
"statusLine": {
"type": "command",
"command": "~/.claude/statuslines/statusline.sh",
"padding": 0
},
for ~/.claude/statuslines/statusline.sh
#!/bin/bash
# Read JSON input from stdin
input=$(cat)
# Extract model and workspace values
MODEL_DISPLAY=$(echo "$input" | jq -r '.model.display_name')
CURRENT_DIR=$(echo "$input" | jq -r '.workspace.current_dir')
# Extract context window metrics
INPUT_TOKENS=$(echo "$input" | jq -r '.context_window.total_input_tokens')
OUTPUT_TOKENS=$(echo "$input" | jq -r '.context_window.total_output_tokens')
CONTEXT_SIZE=$(echo "$input" | jq -r '.context_window.context_window_size')
# Extract cost metrics
COST_USD=$(echo "$input" | jq -r '.cost.total_cost_usd')
LINES_ADDED=$(echo "$input" | jq -r '.cost.total_lines_added')
LINES_REMOVED=$(echo "$input" | jq -r '.cost.total_lines_removed')
# Extract percentage metrics
USED_PERCENTAGE=$(echo "$input" | jq -r '.context_window.used_percentage')
REMAINING_PERCENTAGE=$(echo "$input" | jq -r '.context_window.remaining_percentage')
# Format tokens as Xk
format_tokens() {
local num="$1"
if [ "$num" -ge 1000 ]; then
echo "$((num / 1000))k"
else
echo "$num"
fi
}
# Generate progress bar for context usage
generate_progress_bar() {
local percentage=$1
local bar_width=20
local filled=$(awk "BEGIN {printf \"%.0f\", ($percentage / 100) * $bar_width}")
local empty=$((bar_width - filled))
local bar=""
for ((i=0; i<filled; i++)); do bar+="█"; done
for ((i=0; i<empty; i++)); do bar+="░"; done
echo "$bar"
}
# Calculate total
TOTAL_TOKENS=$((INPUT_TOKENS + OUTPUT_TOKENS))
# Generate progress bar
PROGRESS_BAR=$(generate_progress_bar "$USED_PERCENTAGE")
# Show git branch if in a git repo
GIT_BRANCH=""
if git -C "$CURRENT_DIR" rev-parse --git-dir > /dev/null 2>&1; then
BRANCH=$(git -C "$CURRENT_DIR" branch --show-current 2>/dev/null)
if [ -n "$BRANCH" ]; then
# Worktree detection
GIT_DIR=$(git -C "$CURRENT_DIR" rev-parse --git-dir 2>/dev/null)
WORKTREE=""
if [[ "$GIT_DIR" == *".git/worktrees/"* ]] || [[ -f "$GIT_DIR/gitdir" ]]; then
WORKTREE=" 🌳"
fi
# Ahead/behind detection
AHEAD_BEHIND=""
UPSTREAM=$(git -C "$CURRENT_DIR" rev-parse --abbrev-ref '@{u}' 2>/dev/null)
if [ -n "$UPSTREAM" ]; then
AHEAD=$(git -C "$CURRENT_DIR" rev-list --count '@{u}..HEAD' 2>/dev/null || echo 0)
BEHIND=$(git -C "$CURRENT_DIR" rev-list --count 'HEAD..@{u}' 2>/dev/null || echo 0)
if [ "$AHEAD" -gt 0 ] && [ "$BEHIND" -gt 0 ]; then
AHEAD_BEHIND=" ↕${AHEAD}/${BEHIND}"
elif [ "$AHEAD" -gt 0 ]; then
AHEAD_BEHIND=" ↑${AHEAD}"
elif [ "$BEHIND" -gt 0 ]; then
AHEAD_BEHIND=" ↓${BEHIND}"
fi
fi
GIT_BRANCH=" | 🌿 $BRANCH${WORKTREE}${AHEAD_BEHIND}"
fi
fi
echo "[$MODEL_DISPLAY] 📁 ${CURRENT_DIR##*/}${GIT_BRANCH}
Context: [$PROGRESS_BAR] ${USED_PERCENTAGE}%
Cost: \$${COST_USD} | +${LINES_ADDED} -${LINES_REMOVED} lines"
Git worktrees allow you to run parallel Claude Code and Codex CLI sessions with complete code isolation. Each worktree has its own isolated working directory while sharing the same Git history and remote connections. This prevents AI instances from interfering with each other when working on multiple tasks simultaneously.
Benefits:
Official Documentation: Run parallel Claude Code sessions with git worktrees
Add these functions to ~/.bashrc, ~/.zshrc, or ~/.bash_aliases:
# Codex CLI worktree launcher
cx() {
local branch_name
if [ -z "$1" ]; then
branch_name="worktree-$(date +%Y%m%d-%H%M%S)"
else
branch_name="$1"
fi
git worktree add "../$branch_name" -b "$branch_name" && \
cd "../$branch_name" || return 1
codex -m gpt-5-codex --config model_reasoning_effort='xhigh'
}
# Claude Code worktree launcher
clx() {
local branch_name
if [ -z "$1" ]; then
branch_name="worktree-$(date +%Y%m%d-%H%M%S)"
else
branch_name="$1"
fi
git worktree add "../$branch_name" -b "$branch_name" && \
cd "../$branch_name" || return 1
claude --model opusplan --permission-mode plan
}
After adding, reload your shell: source ~/.bashrc or source ~/.zshrc
Add these functions to your PowerShell profile. Open it with notepad $PROFILE:
# Codex CLI worktree launcher
function cx {
param([string]$BranchName)
if (-not $BranchName) {
$BranchName = "worktree-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
}
git worktree add "../$BranchName" -b $BranchName
if ($LASTEXITCODE -eq 0) {
Set-Location "../$BranchName"
codex -m gpt-5-codex --config model_reasoning_effort='xhigh'
}
}
# Claude Code worktree launcher
function clx {
param([string]$BranchName)
if (-not $BranchName) {
$BranchName = "worktree-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
}
git worktree add "../$BranchName" -b $BranchName
if ($LASTEXITCODE -eq 0) {
Set-Location "../$BranchName"
claude --model opusplan --permission-mode plan
}
}
After adding, reload PowerShell or run: . $PROFILE
Create these batch files in a directory in your PATH (e.g., C:\Users\YourName\bin\):
cx.bat - Codex CLI launcher:
@echo off
setlocal enabledelayedexpansion
if "%~1"=="" (
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I
set branch_name=worktree-!datetime:~0,8!-!datetime:~8,6!
) else (
set branch_name=%~1
)
git worktree add "../%branch_name%" -b "%branch_name%"
if %errorlevel% equ 0 (
cd "../%branch_name%"
codex -m gpt-5-codex --config model_reasoning_effort='xhigh'
)
endlocal
clx.bat - Claude Code launcher:
@echo off
setlocal enabledelayedexpansion
if "%~1"=="" (
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I
set branch_name=worktree-!datetime:~0,8!-!datetime:~8,6!
) else (
set branch_name=%~1
)
git worktree add "../%branch_name%" -b "%branch_name%"
if %errorlevel% equ 0 (
cd "../%branch_name%"
claude --model opusplan --permission-mode plan
)
endlocal
# Create worktree with custom name
clx feature-auth
cx bugfix-123
# Create worktree with auto-generated timestamp name
clx
cx
# List all worktrees
git worktree list
# Remove a worktree when done
git worktree remove ../worktree-name
# Clean up stale worktree references
git worktree prune
Each new worktree needs its own development environment:
npm install or yarnpip install -r requirements.txt.worktreeinclude FileWhen Claude Code creates a worktree, files ignored via .gitignore aren't automatically available. The .worktreeinclude file specifies which ignored files should be copied to new worktrees.
How It Works:
.gitignore-style patterns.worktreeinclude AND .gitignore are copiedCreate a .worktreeinclude file in your repository root:
# Environment files
.env
.env.local
.env.*
# Claude Code local settings
**/.claude/settings.local.json
Common Use Cases:
.env files with API keys and secrets.env.local for local development overrides.claude/settings.local.json for personal Claude Code settingsWhen using Claude Code via the Claude Desktop app:
~/.claude-worktreesOfficial Documentation: Claude Code on Desktop
.gitignoreTo ignore files locally without modifying the shared .gitignore, use .git/info/exclude:
# Edit the local exclude file
nano .git/info/exclude
# or
code .git/info/exclude
Add patterns using the same syntax as .gitignore:
# Local IDE settings
.idea/
*.swp
# Personal scripts
my-local-scripts/
# Local test files
test-local.sh
Key Differences:
| File | Scope | Committed to Git |
|---|---|---|
.gitignore |
Shared with team | Yes |
.git/info/exclude |
Local only | No |
~/.config/git/ignore |
Global (all repos) | No |
When to Use .git/info/exclude:
.gitignoreNote: Files in .git/info/exclude work with .worktreeinclude the same way as .gitignore - patterns must appear in both files for copying to worktrees.
Z.AI's GLM Coding Plan is a cost-effective subscription service starting at just $3/month that provides access to GLM-4.7, a high-performance language model optimized for coding tasks. With over 55 tokens per second for real-time interaction, it offers state-of-the-art performance in reasoning, coding, and agent capabilities. The service includes multimodal features like Vision Understanding, Web Search, and Web Reader MCP servers. Below shell function launchers are easiest way to use Z.AI with Claude Code without messing up your existing Claude Code setup.
Usage Tiers:
Each prompt typically allows 15–20 model calls, yielding tens of billions of tokens monthly at approximately 1% of standard API pricing.
Data Location: All Z.AI services are based in Singapore.
Privacy Guarantee: Z.AI does not store any of the content you provide or generate while using their services. This includes any text prompts, images, or other data you input.
See the Privacy Policy for further details.
🚀 You've been invited to join the GLM Coding Plan! Enjoy full support for Claude Code, Cline, and 10+ top coding tools — starting at just $3/month. Subscribe now and grab the limited-time deal!
Invite Code:
WWB8IFLROM(10% additional discount)Subscribe: https://z.ai/subscribe?ic=WWB8IFLROM
Just run the following command in your terminal. Attention only macOS Linux environment is supported, this method does not support Windows
curl -O "https://cdn.bigmodel.cn/install/claude_code_zai_env.sh" && bash ./claude_code_zai_env.sh
Edit your ~/.claude/settings.json and add the environment variables:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-zai-api-key",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"API_TIMEOUT_MS": "3000000"
}
}
Replace your-zai-api-key with your actual Z.AI API key from the dashboard.
Add this function to ~/.bashrc, ~/.zshrc, or ~/.bash_aliases:
# Z.AI + Claude Code launcher
zai() {
export ANTHROPIC_AUTH_TOKEN="your-zai-api-key"
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export API_TIMEOUT_MS="3000000"
claude "$@"
}
After adding, reload your shell: source ~/.bashrc or source ~/.zshrc
Add this function to your PowerShell profile. Open it with notepad $PROFILE:
# Z.AI + Claude Code launcher
function zai {
$env:ANTHROPIC_AUTH_TOKEN = "your-zai-api-key"
$env:ANTHROPIC_BASE_URL = "https://api.z.ai/api/anthropic"
$env:API_TIMEOUT_MS = "3000000"
claude $args
}
After adding, reload PowerShell or run: . $PROFILE
Create a batch file named zai.bat in a directory in your PATH (e.g., C:\Users\YourName\bin\):
@echo off
set ANTHROPIC_AUTH_TOKEN=your-zai-api-key
set ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
set API_TIMEOUT_MS=3000000
claude %*
The GLM Coding Plan uses intelligent model mapping where Claude model names are mapped to GLM models through environment variables:
ANTHROPIC_DEFAULT_OPUS_MODEL: GLM-4.7ANTHROPIC_DEFAULT_SONNET_MODEL: GLM-4.7ANTHROPIC_DEFAULT_HAIKU_MODEL: GLM-4.5-AirNote: While manual adjustment of these mappings is possible, it's not recommended as it may prevent automatic updates to newer model versions.
If you need to switch to different models (e.g., GLM-4.5 or other models), you can customize the mappings in two ways:
Option 1: In ~/.claude/settings.json
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-zai-api-key",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"API_TIMEOUT_MS": "3000000",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "GLM-4.7",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "GLM-4.5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "GLM-4.5-Air"
}
}
Option 2: In Shell Function/Alias
For macOS/Linux:
zai() {
export ANTHROPIC_AUTH_TOKEN="your-zai-api-key"
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export API_TIMEOUT_MS="3000000"
export ANTHROPIC_DEFAULT_OPUS_MODEL="GLM-4.7"
export ANTHROPIC_DEFAULT_SONNET_MODEL="GLM-4.5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="GLM-4.5-Air"
claude "$@"
}
For Windows PowerShell:
function zai {
$env:ANTHROPIC_AUTH_TOKEN = "your-zai-api-key"
$env:ANTHROPIC_BASE_URL = "https://api.z.ai/api/anthropic"
$env:API_TIMEOUT_MS = "3000000"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "GLM-4.7"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "GLM-4.5"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "GLM-4.5-Air"
claude $args
}
For Windows CMD:
@echo off
set ANTHROPIC_AUTH_TOKEN=your-zai-api-key
set ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
set API_TIMEOUT_MS=3000000
set ANTHROPIC_DEFAULT_OPUS_MODEL=GLM-4.7
set ANTHROPIC_DEFAULT_SONNET_MODEL=GLM-4.5
set ANTHROPIC_DEFAULT_HAIKU_MODEL=GLM-4.5-Air
claude %*
# Launch with Z.AI configuration
zai
# Launch with specific model
zai --model sonnet
# Launch with permission mode
zai --model opus --permission-mode plan
Combine Z.AI with git worktrees for isolated parallel sessions:
# Z.AI + Claude Code worktree launcher
zaix() {
local branch_name
if [ -z "$1" ]; then
branch_name="worktree-$(date +%Y%m%d-%H%M%S)"
else
branch_name="$1"
fi
git worktree add "../$branch_name" -b "$branch_name" && \
cd "../$branch_name" || return 1
export ANTHROPIC_AUTH_TOKEN="your-zai-api-key"
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export API_TIMEOUT_MS="3000000"
claude --model sonnet --permission-mode plan
}
# Z.AI + Claude Code worktree launcher
function zaix {
param([string]$BranchName)
if (-not $BranchName) {
$BranchName = "worktree-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
}
git worktree add "../$BranchName" -b $BranchName
if ($LASTEXITCODE -eq 0) {
Set-Location "../$BranchName"
$env:ANTHROPIC_AUTH_TOKEN = "your-zai-api-key"
$env:ANTHROPIC_BASE_URL = "https://api.z.ai/api/anthropic"
$env:API_TIMEOUT_MS = "3000000"
claude --model sonnet --permission-mode plan
}
}
Create zaix.bat:
@echo off
setlocal enabledelayedexpansion
if "%~1"=="" (
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I
set branch_name=worktree-!datetime:~0,8!-!datetime:~8,6!
) else (
set branch_name=%~1
)
git worktree add "../%branch_name%" -b "%branch_name%"
if %errorlevel% equ 0 (
cd "../%branch_name%"
set ANTHROPIC_AUTH_TOKEN=your-zai-api-key
set ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
set API_TIMEOUT_MS=3000000
claude --model sonnet --permission-mode plan
)
endlocal
After adding, reload your shell configuration.
Usage:
# Create worktree with custom name
zaix feature-auth
# Create worktree with auto-generated timestamp name
zaix
Claude Code can be integrated with GitHub Actions to automate AI-powered workflows. With a simple @claude mention in PRs or issues, Claude can analyze code, implement features, fix bugs, and follow project standards defined in CLAUDE.md.
Key capabilities:
@claude mentions in issues and pull requestsCLAUDE.md/reviewReference: Claude Code GitHub Actions Documentation
Create .github/workflows/claude.yml:
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
env:
ANTHROPIC_BASE_URL: https://api.z.ai/api/anthropic
API_TIMEOUT_MS: 3000000
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: |
--model claude-opus
--max-turns 100
| Component | Purpose |
|---|---|
| Event Triggers | Listens for issue_comment, pull_request_review_comment, issues, and pull_request_review events |
Conditional (if) |
Only runs when @claude is mentioned in the comment/issue body or title |
| Permissions | contents: write for code changes, pull-requests: write for PRs, issues: write for issue responses, actions: read for CI results |
| ANTHROPIC_BASE_URL | Routes API calls through Z.AI endpoint for higher quotas |
| API_TIMEOUT_MS | Extended timeout (50 minutes) for complex operations |
| claude_args | Uses claude-opus model with up to 100 turns for complex tasks |
ANTHROPIC_API_KEY with your Z.AI API key.github/workflows/claude.yml@claude in any issue or PR comment to trigger the workflowClaude Code now supports Agent Skills.
.claude/skills/consult-zai/file:line citations/consult-zai "your code analysis question" or invoke via Skill tool.claude/skills/consult-codex/file:line citations/consult-codex "your code analysis question" or invoke via Skill tool.claude/skills/ai-image-creator/-t) with green-screen chroma key pipeline-r) for multimodal models (gemini, gpt5, gpt5.4)--analyze) — text-only output from multimodal models (gemini, gpt5, gpt5.4); no image generated--costs) with per-model breakdownuv runner)/ai-image-creator or invoke via Skill tool when user asks to generate images, create PNGs, make visual assets, or describe/analyze existing images.claude/skills/session-metrics/uv run python)--single-page to override)--chart-lib {highcharts,uplot,chartjs,none} — Highcharts default (vendored + SHA-256 verified, non-commercial licence); uPlot and Chart.js are MIT alternatives; none emits a JS-free detail page--session / --slug / env vars can't escape ~/.claude/projects/--all-projects — aggregates every project under ~/.claude/projects/ into a single dated export folder (exports/session-metrics/instance/YYYY-MM-DD-HHMMSS/) with per-project HTML drilldowns, daily-cost timeline chart, and a projects breakdown table sorted by cost descending. Add --no-project-drilldown for a flat fast-path index; --projects-dir /path to target a secondary Claude Code install (also honours CLAUDE_PROJECTS_DIR)uv run python .claude/skills/session-metrics/scripts/session-metrics.py. Install via marketplace: /plugin marketplace add centminmod/claude-plugins then /plugin install session-metrics@centminmodThe Claude Code hook is for STOP which uses Terminal-Notifier to show macOS desktop notifications whenever Claude Code stops and finishes it's response https://github.com/centminmod/terminal-notifier-setup.
Claude Code subagents are specialized tools designed to handle complex, multi-step tasks autonomously. A key benefit of Claude Code subagents is that uses its own context window separate from the main conversation and can use it's own custom prompt. Learn more about subagents in the official documentation.
.claude/agents/memory-bank-synchronizer.md.claude/agents/code-searcher.md.claude/agents/get-current-datetime.mdTZ='Australia/Brisbane' date commands.claude/agents/ux-design-expert.md.claude/agents/zai-cli.md.claude/agents/codex-cli.md/anthropic Commands/apply-thinking-to - Expert prompt engineering specialist that applies Anthropic's extended thinking patterns to enhance prompts with advanced reasoning frameworks
/apply-thinking-to @/path/to/prompt-file.md/convert-to-todowrite-tasklist-prompt - Converts complex, context-heavy prompts into efficient TodoWrite tasklist-based methods with parallel subagent execution
/convert-to-todowrite-tasklist-prompt @/path/to/original-slash-command.md/update-memory-bank - Simple command to update CLAUDE.md and memory bank files
/update-memory-bank/ccusage Commands/ccusage-daily - Generates comprehensive Claude Code usage cost analysis and statistics
ccusage daily command and parses output into structured markdown/ccusage-daily/cleanup Commands/cleanup-context - Memory bank optimization specialist for reducing token usage in documentation
/cleanup-context/documentation Commands/create-readme-section - Generate specific sections for README files with professional formatting
/create-readme-section "Create an installation section for my Python project"/create-release-note - Generate comprehensive release documentation from recent commits with dual output formats
/create-release-note (interactive), /create-release-note 20 (last 20 commits), or select commit hash after viewing recent commits/security Commands/security-audit - Perform comprehensive security audit of the codebase
/security-audit/check-best-practices - Analyze code against language-specific best practices
/check-best-practices/secure-prompts - Enterprise-grade security analyzer for detecting prompt injection attacks and malicious instructions
reports/secure-prompts/ directory for audit trails/secure-prompts @suspicious_file.txt or /secure-prompts "content to analyze".claude/commands/security/test-examples that you can run /secure-prompts against./secure-prompts .claude/commands/security/test-examples/test-encoding-attacks.md here/architecture Commands/explain-architecture-pattern - Identify and explain architectural patterns in the codebase
/explain-architecture-pattern/promptengineering Commands/convert-to-test-driven-prompt - Transform requests into Test-Driven Development style prompts
/convert-to-test-driven-prompt "Add user authentication feature"/batch-operations-prompt - Optimize prompts for multiple file operations and parallel processing
/batch-operations-prompt "Update all API calls to use new auth header"/refactor Commands/refactor-code - Analysis-only refactoring specialist that creates comprehensive refactoring plans without modifying code
reports/refactor/ directory/refactor-codeIf you are using Claude monthly subscription plans for Claude Code, new weekly rate limits will apply from August 28, 2025 in addition to max 50x 5hr session limits per month:
| Plan | Sonnet 4 (hrs/week) | Opus 4 (hrs/week) |
|---|---|---|
| Pro | 40–80 | – |
| Max ($100 /mo) | 140–280 | 15–35 |
| Max ($200 /mo) | 240–480 | 24–40 |
Configure Claude Code with global and project-level settings, and environment variables.
Claude Code offers a variety of settings to configure its behavior to meet your needs. You can configure Claude Code by running the /config command when using the interactive REPL.
The settings.json file is our official mechanism for configuring Claude
Code through hierarchical settings:
~/.claude/settings.json and apply to all.claude/settings.json for settings that are checked into source control and shared with your team.claude/settings.local.json for settings that are not checked in, useful for personal preferences and experimentation. Claude Code will configure git to ignore .claude/settings.local.json when it is created.settings.json supports a number of options:
| Key | Description | Example |
|---|---|---|
apiKeyHelper |
Custom script, to be executed in /bin/sh, to generate an auth value. This value will generally be sent as X-Api-Key, Authorization: Bearer, and Proxy-Authorization: Bearer headers for model requests |
/bin/generate_temp_api_key.sh |
cleanupPeriodDays |
How long to locally retain chat transcripts (default: 30 days) | 20 |
env |
Environment variables that will be applied to every session | {"FOO": "bar"} |
includeCoAuthoredBy |
Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true) |
false |
permissions |
See table below for structure of permissions. |
| Keys | Description | Example |
|---|---|---|
allow |
Array of permission rules to allow tool use | [ "Bash(git diff:*)" ] |
deny |
Array of permission rules to deny tool use | [ "WebFetch", "Bash(curl:*)" ] |
additionalDirectories |
Additional working directories that Claude has access to | [ "../docs/" ] |
defaultMode |
Default permission mode when opening Claude Code | "acceptEdits" |
disableBypassPermissionsMode |
Set to "disable" to prevent bypassPermissions mode from being activated. See managed policy settings |
"disable" |
Settings are applied in order of precedence:
Claude Code supports the following environment variables to control its behavior:
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY |
API key sent as X-Api-Key header, typically for the Claude SDK (for interactive usage, run /login) |
ANTHROPIC_AUTH_TOKEN |
Custom value for the Authorization and Proxy-Authorization headers (the value you set here will be prefixed with Bearer ) |
ANTHROPIC_CUSTOM_HEADERS |
Custom headers you want to add to the request (in Name: Value format) |
ANTHROPIC_MODEL |
Name of custom model to use (see Model Configuration) |
ANTHROPIC_SMALL_FAST_MODEL |
Name of Haiku-class model for background tasks |
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION |
Override AWS region for the small/fast model when using Bedrock |
BASH_DEFAULT_TIMEOUT_MS |
Default timeout for long-running bash commands |
BASH_MAX_TIMEOUT_MS |
Maximum timeout the model can set for long-running bash commands |
BASH_MAX_OUTPUT_LENGTH |
Maximum number of characters in bash outputs before they are middle-truncated |
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR |
Return to the original working directory after each Bash command |
CLAUDE_CODE_API_KEY_HELPER_TTL_MS |
Interval in milliseconds at which credentials should be refreshed (when using apiKeyHelper) |
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL |
Skip auto-installation of IDE extensions (defaults to false) |
CLAUDE_CODE_MAX_OUTPUT_TOKENS |
Set the maximum number of output tokens for most requests |
CLAUDE_CODE_USE_BEDROCK |
Use Bedrock |
CLAUDE_CODE_USE_VERTEX |
Use Vertex |
CLAUDE_CODE_SKIP_BEDROCK_AUTH |
Skip AWS authentication for Bedrock (e.g. when using an LLM gateway) |
CLAUDE_CODE_SKIP_VERTEX_AUTH |
Skip Google authentication for Vertex (e.g. when using an LLM gateway) |
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC |
Equivalent of setting DISABLE_AUTOUPDATER, DISABLE_BUG_COMMAND, DISABLE_ERROR_REPORTING, and DISABLE_TELEMETRY |
DISABLE_AUTOUPDATER |
Set to 1 to disable automatic updates. This takes precedence over the autoUpdates configuration setting. |
DISABLE_BUG_COMMAND |
Set to 1 to disable the /bug command |
DISABLE_COST_WARNINGS |
Set to 1 to disable cost warning messages |
DISABLE_ERROR_REPORTING |
Set to 1 to opt out of Sentry error reporting |
DISABLE_NON_ESSENTIAL_MODEL_CALLS |
Set to 1 to disable model calls for non-critical paths like flavor text |
DISABLE_TELEMETRY |
Set to 1 to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) |
HTTP_PROXY |
Specify HTTP proxy server for network connections |
HTTPS_PROXY |
Specify HTTPS proxy server for network connections |
MAX_THINKING_TOKENS |
Force a thinking for the model budget |
MCP_TIMEOUT |
Timeout in milliseconds for MCP server startup |
MCP_TOOL_TIMEOUT |
Timeout in milliseconds for MCP tool execution |
MAX_MCP_OUTPUT_TOKENS |
Maximum number of tokens allowed in MCP tool responses (default: 25000) |
VERTEX_REGION_CLAUDE_3_5_HAIKU |
Override region for Claude 3.5 Haiku when using Vertex AI |
VERTEX_REGION_CLAUDE_3_5_SONNET |
Override region for Claude 3.5 Sonnet when using Vertex AI |
VERTEX_REGION_CLAUDE_3_7_SONNET |
Override region for Claude 3.7 Sonnet when using Vertex AI |
VERTEX_REGION_CLAUDE_4_0_OPUS |
Override region for Claude 4.0 Opus when using Vertex AI |
VERTEX_REGION_CLAUDE_4_0_SONNET |
Override region for Claude 4.0 Sonnet when using Vertex AI |
We are in the process of migrating global configuration to settings.json.
claude config will be deprecated in place of settings.json
To manage your configurations, use the following commands:
claude config listclaude config get <key>claude config set <key> <value>claude config add <key> <value>claude config remove <key> <value>By default config changes your project configuration. To manage your global configuration, use the --global (or -g) flag.
To set a global configuration, use claude config set -g <key> <value>:
| Key | Description | Example |
|---|---|---|
autoUpdates |
Whether to enable automatic updates (default: true). When enabled, Claude Code automatically downloads and installs updates in the background. Updates are applied when you restart Claude Code. |
false |
preferredNotifChannel |
Where you want to receive notifications (default: iterm2) |
iterm2, iterm2_with_bell, terminal_bell, or notifications_disabled |
theme |
Color theme | dark, light, light-daltonized, or dark-daltonized |
verbose |
Whether to show full bash and command outputs (default: false) |
true |
Claude Code has access to a set of powerful tools that help it understand and modify your codebase:
| Tool | Description | Permission Required |
|---|---|---|
| Agent | Runs a sub-agent to handle complex, multi-step tasks | No |
| Bash | Executes shell commands in your environment | Yes |
| Edit | Makes targeted edits to specific files | Yes |
| Glob | Finds files based on pattern matching | No |
| Grep | Searches for patterns in file contents | No |
| LS | Lists files and directories | No |
| MultiEdit | Performs multiple edits on a single file atomically | Yes |
| NotebookEdit | Modifies Jupyter notebook cells | Yes |
| NotebookRead | Reads and displays Jupyter notebook contents | No |
| Read | Reads the contents of files | No |
| TodoRead | Reads the current session's task list | No |
| TodoWrite | Creates and manages structured task lists | No |
| WebFetch | Fetches content from a specified URL | Yes |
| WebSearch | Performs web searches with domain filtering | Yes |
| Write | Creates or overwrites files | Yes |
Permission rules can be configured using /allowed-tools or in permission settings.
You can run custom commands before or after any tool executes using
Claude Code hooks.
For example, you could automatically run a Python formatter after Claude
modifies Python files, or prevent modifications to production configuration
files by blocking Write operations to certain paths
claude mcp add --transport stdio metrics -s user -- uv run --directory /path/to/your/mcp-server metrics-server
claude mcp list
Checking MCP server health...
context7: https://mcp.context7.com/sse (SSE) - ✓ Connected
cf-docs: https://docs.mcp.cloudflare.com/sse (SSE) - ✓ Connected
metrics: uv run --directory /path/to/your/mcp-server metrics-server - ✓ Connected
MCP tool call get_current_cost. Returns today's total USD cost from Prometheus.
{
"metric": "Total Cost Today",
"value": 27.149809833783127,
"formatted": "$27.1498",
"unit": "currencyUSD"
}
claude mcp add gemini-cli /pato/to/.venv/bin/python /pato/to//mcp_server.py -s user -e GEMINI_API_KEY='GEMINI_API_KEY' -e OPENROUTER_API_KEY='OPENROUTER_API_KEY'
claude mcp add --transport sse cf-docs https://docs.mcp.cloudflare.com/sse -s user
with API key
claude mcp add --transport http context7 https://mcp.context7.com/mcp --header "CONTEXT7_API_KEY: YOUR_API_KEY" -s user
claude mcp add-json notionApi '{"type":"stdio","command":"npx","args":["-y","@notionhq/notion-mcp-server"],"env":{"OPENAPI_MCP_HEADERS":"{\"Authorization\": \"Bearer ntn_API_KEY\", \"Notion-Version\": \"2022-06-28\"}"}}' -s user
This MCP server can take up to 17K of Claude's context window so I only install it when project needs it via --mcp-config parameter when running Claude client:
claude --mcp-config .claude/mcp/chrome-devtools.json
Where .claude/mcp/chrome-devtools.json
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest"
]
}
}
}
Chrome Devtool MCP server takes up ~16,977 tokens across 26 MCP tools
mcp__chrome-devtools__list_console_messages (chrome-devtools): 584 tokens
mcp__chrome-devtools__emulate_cpu (chrome-devtools): 651 tokens
mcp__chrome-devtools__emulate_network (chrome-devtools): 694 tokens
mcp__chrome-devtools__click (chrome-devtools): 636 tokens
mcp__chrome-devtools__drag (chrome-devtools): 638 tokens
mcp__chrome-devtools__fill (chrome-devtools): 644 tokens
mcp__chrome-devtools__fill_form (chrome-devtools): 676 tokens
mcp__chrome-devtools__hover (chrome-devtools): 609 tokens
mcp__chrome-devtools__upload_file (chrome-devtools): 651 tokens
mcp__chrome-devtools__get_network_request (chrome-devtools): 618 tokens
mcp__chrome-devtools__list_network_requests (chrome-devtools): 783 tokens
mcp__chrome-devtools__close_page (chrome-devtools): 624 tokens
mcp__chrome-devtools__handle_dialog (chrome-devtools): 645 tokens
mcp__chrome-devtools__list_pages (chrome-devtools): 582 tokens
mcp__chrome-devtools__navigate_page (chrome-devtools): 642 tokens
mcp__chrome-devtools__navigate_page_history (chrome-devtools): 656 tokens
mcp__chrome-devtools__new_page (chrome-devtools): 637 tokens
mcp__chrome-devtools__resize_page (chrome-devtools): 629 tokens
mcp__chrome-devtools__select_page (chrome-devtools): 619 tokens
mcp__chrome-devtools__performance_analyze_insight (chrome-devtools): 649 tokens
mcp__chrome-devtools__performance_start_trace (chrome-devtools): 689 tokens
mcp__chrome-devtools__performance_stop_trace (chrome-devtools): 586 tokens
mcp__chrome-devtools__take_screenshot (chrome-devtools): 803 tokens
mcp__chrome-devtools__evaluate_script (chrome-devtools): 775 tokens
mcp__chrome-devtools__take_snapshot (chrome-devtools): 614 tokens
mcp__chrome-devtools__wait_for (chrome-devtools): 643 tokens