- Threads - https://www.threads.com/@george_sl_liu
- BlueSky - https://bsky.app/profile/georgesl.bsky.social
A comprehensive starter kit for Claude Code projects featuring a memory bank system for context retention, pre-configured hooks, skills, subagents, and MCP server recommendations.
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.
- Quick Start
- Beginner
- Intermediate
- Advanced
- Reference
Get up and running in under 5 minutes:
Prerequisites Checklist:
- Paid Claude AI account (Pro $20/mo, Max $100/mo, or Max $200/mo)
- Node.js 18+ installed
- Git installed
- macOS:
brew install ripgrep fd jq
Installation Options:
Choose the method that works best for you:
# 1. Clone this repository as your new project
git clone https://github.com/centminmod/my-claude-code-setup.git my-project
cd my-project
# 2. Remove template README files (create your own project README)
rm README.md README-v2.md README-v3.md README-v4.md
# 3. Reinitialize git for your own project (optional)
rm -rf .git
git init
# 4. Launch Claude Code and initialize
claude
# Then run: /initCopy only the files you need into your existing project:
# Core files (recommended)
cp /path/to/my-claude-code-setup/CLAUDE.md your-project/
cp -r /path/to/my-claude-code-setup/.claude your-project/
# Or selectively copy specific components:
cp -r /path/to/my-claude-code-setup/.claude/commands your-project/.claude/
cp -r /path/to/my-claude-code-setup/.claude/skills your-project/.claude/
cp -r /path/to/my-claude-code-setup/.claude/agents your-project/.claude/
cp -r /path/to/my-claude-code-setup/.claude/hooks your-project/.claude/Browse the repository on GitHub and download individual files:
CLAUDE.md- Memory bank main file.claude/settings.json- Settings template.claude/commands/- Slash commands you want.claude/skills/- Skills you want.claude/agents/- Subagents you want
After copying files, launch Claude Code in your project and run /init.
- Memory Bank System: Structured context files for persistent memory across sessions
- Pre-configured Settings: Optimized
.claude/settings.jsonwith fast tools - Custom Hooks: Desktop notifications when Claude Code completes tasks
- Custom Skills: Specialized agents for documentation lookup
- Custom Subagents: Task-specific agents for code search, UX design, and more
- Custom Slash Commands: Security audits, refactoring plans, prompt engineering
- MCP Server Recommendations: Curated list of useful MCP servers
| Requirement | Version | Purpose |
|---|---|---|
| Claude AI Account | Pro/Max | Required for Claude Code access |
| Node.js | 18+ | Runtime environment |
| Git | Latest | Version control |
| ripgrep | Latest | Fast content search |
| fd | Latest | Fast file finding |
| jq | Latest | JSON processing |
Operating System Support:
- macOS: Fully supported
- Linux: Fully supported
- Windows: Supported (PowerShell or CMD)
-
Copy Repository Files
Copy all files from this GitHub repo to your project directory (where your intended codebase will be).
-
Modify Template Files
Edit
CLAUDE.mdto match your project. The.claude/settings.jsonfile includes Terminal-Notifier for macOS notifications (setup guide). Remove this file if not using macOS. -
Initialize Memory Bank
After launching Claude Code in your project directory, run
/initto analyze your codebase and populate memory bank files. -
Install Fast Tools (macOS)
brew install ripgrep fd jq
-
Visual Studio Code: Install VS Code and the Claude Code Extension
-
GitHub Integration: Set up Git for VS Code
-
Dev Container: Run Claude Code, Codex GPT-5, Gemini CLI, and more in an isolated VS Code dev container with full YOLO mode support.
-
Platform-Specific Docs: If using Cloudflare/ClerkOS, keep
CLAUDE-cloudflare.mdorCLAUDE-cloudflare-mini.mdand reference them inCLAUDE.md. For Convex database, useCLAUDE-convex.md.
- Advent of Claude: 31 Days of Claude Code by Ado Kukic (Anthropic)
- Claude Code with Opus 4.5 by Alex Finn
- Claude Code Overview by Matt Maher
The Memory Bank System is a structured set of markdown files that help Claude Code retain context across multiple chat sessions. Instead of starting fresh each time, Claude Code reads these files to understand your project's patterns, decisions, and current state.
| File | Purpose |
|---|---|
CLAUDE.md |
Main entry point with project overview and AI guidance |
CLAUDE-activeContext.md |
Current session state, goals, and progress |
CLAUDE-patterns.md |
Established code patterns and conventions |
CLAUDE-decisions.md |
Architecture decisions and rationale (ADRs) |
CLAUDE-troubleshooting.md |
Common issues and proven solutions |
CLAUDE-config-variables.md |
Configuration variables reference |
CLAUDE-temp.md |
Temporary scratch pad (only read when referenced) |
- Copy the template files from this repository to your project root
- Run
/initin Claude Code to analyze your codebase - Claude Code will populate the memory bank files based on your project
After completing significant work, ask Claude Code to update the memory bank:
update memory bank
Here's what Claude Code's thinking looks like when updating the memory bank:
> 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
Claude Code supports plugins from both official and third-party marketplaces.
Browse and install plugins from the official marketplace.
# Install a plugin
/plugin install plugin-name@claude-plugins-official
# Update marketplace
/plugin marketplace update claude-plugins-official| Plugin | Description | Install Command |
|---|---|---|
| code-simplifier | Simplifies and refines code for clarity, consistency, and maintainability | /plugin install code-simplifier |
| frontend-design | Creates distinctive, production-grade frontend interfaces | /plugin install frontend-design@claude-code-plugins |
| feature-dev | Systematic 7-phase approach to building new features | /plugin install feature-dev@claude-code-plugins |
| ralph-wiggum | Interactive self-referential AI loops for iterative development | /plugin install ralph-wiggum@claude-code-plugins |
Note: Ralph Wiggum may have issues on some systems. See #16398 and #16389. Usage guide: YouTube by Greg Isenberg | GitHub
| Plugin | Source | Description | Install Commands |
|---|---|---|---|
| safety-net | cc-marketplace | Catches destructive git/filesystem commands before execution | /plugin marketplace add kenryu42/cc-marketplace/plugin install safety-net@cc-marketplace |
| glm-plan-usage | zai-coding-plugins | Query Z.AI usage statistics | /plugin marketplace add zai/zai-coding-plugins/plugin install glm-plan-usage@zai-coding-plugins |
| Cloudflare Skills | cloudflare/skills | Development skills for Cloudflare platform (Workers, Agents SDK) | /plugin marketplace add cloudflare/skills |
MCP (Model Context Protocol) servers extend Claude Code's capabilities by connecting to external tools and documentation.
| Server | Purpose | Transport | Token Cost | Install Command |
|---|---|---|---|---|
| Context7 | Documentation lookup for any library | SSE | Low | See below |
| Cloudflare Docs | Cloudflare documentation | SSE | Low | See below |
| Usage Metrics | Claude Code usage and cost tracking | stdio | Low | See below |
| Gemini CLI | Access to Gemini models | stdio | Variable | See below |
| Notion | Notion workspace integration | stdio | Variable | See below |
| Chrome DevTools | Browser automation & debugging | stdio | ~17K tokens | See below |
Context7 MCP (with API key):
claude mcp add --transport http context7 https://mcp.context7.com/mcp --header "CONTEXT7_API_KEY: YOUR_API_KEY" -s userCloudflare Documentation MCP:
claude mcp add --transport sse cf-docs https://docs.mcp.cloudflare.com/sse -s userUsage Metrics MCP:
claude mcp add --transport stdio metrics -s user -- uv run --directory /path/to/your/mcp-server metrics-serverGemini CLI MCP:
claude mcp add gemini-cli /path/to/.venv/bin/python /path/to/mcp_server.py -s user -e GEMINI_API_KEY='YOUR_KEY' -e OPENROUTER_API_KEY='YOUR_KEY'Notion MCP:
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 userChrome DevTools MCP (high token cost - use on-demand):
Due to the ~17K token overhead across 26 tools, install only when needed via --mcp-config:
claude --mcp-config .claude/mcp/chrome-devtools.jsonCreate .claude/mcp/chrome-devtools.json:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}claude mcp list
# Output:
# context7: https://mcp.context7.com/sse (SSE) - ✓ Connected
# cf-docs: https://docs.mcp.cloudflare.com/sse (SSE) - ✓ Connected
# metrics: uv run --directory /path/to/mcp-server metrics-server - ✓ ConnectedThe get_current_cost MCP tool returns today's total USD cost:
{
"metric": "Total Cost Today",
"value": 27.149809833783127,
"formatted": "$27.1498",
"unit": "currencyUSD"
}Git worktrees allow you to run parallel Claude Code sessions with complete code isolation. Each worktree has its own working directory while sharing Git history.
Benefits:
- Run multiple AI coding sessions in parallel
- Each worktree has independent file state
- Changes in one worktree won't affect others
- Ideal for experimental features or YOLO mode
Official Documentation: Run parallel Claude Code sessions with git worktrees
Add 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: source ~/.bashrc or source ~/.zshrc
Windows PowerShell Functions
Add to your PowerShell profile (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
}
}Reload: . $PROFILE
Windows CMD Batch Files
Create 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'
)
endlocalclx.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 pruneEach new worktree needs its own development environment:
- JavaScript/Node.js: Run
npm installoryarn - Python: Create virtual environment or run
pip install -r requirements.txt - Other languages: Follow your project's standard setup process
When Claude Code creates a worktree, files ignored via .gitignore aren't automatically available. The .worktreeinclude file specifies which ignored files should be copied.
How It Works:
- Uses
.gitignore-style patterns - Only files matched by both
.worktreeincludeAND.gitignoreare copied
Create .worktreeinclude in your repository root:
# Environment files
.env
.env.local
.env.*
# Claude Code local settings
**/.claude/settings.local.json
Common Use Cases:
.envfiles with API keys and secrets.env.localfor local development overrides.claude/settings.local.jsonfor personal Claude Code settings
When using Claude Code via the Claude Desktop app:
- Default location:
~/.claude-worktrees - Configurable through Claude Desktop app settings
- Repository must be Git initialized for worktree sessions
Official Documentation: Claude Code on Desktop
Use .git/info/exclude to ignore files locally without modifying shared .gitignore:
# Edit the local exclude file
nano .git/info/excludeAdd patterns:
# Local IDE settings
.idea/
*.swp
# Personal scripts
my-local-scripts/
| File | Scope | Committed to Git |
|---|---|---|
.gitignore |
Shared with team | Yes |
.git/info/exclude |
Local only | No |
~/.config/git/ignore |
Global (all repos) | No |
Configure custom status lines in ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "~/.claude/statuslines/statusline.sh",
"padding": 0
}
}Create ~/.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"- VS Code Extension: Claude Code for VS Code
- Dev Containers: Isolated dev environment with Claude Code, Codex CLI, Gemini CLI, and YOLO mode support
Subagents are specialized tools that handle complex, multi-step tasks autonomously with their own context window and custom prompts. Learn more in the official documentation.
| Agent | Location | Purpose |
|---|---|---|
| memory-bank-synchronizer | .claude/agents/ |
Synchronizes memory bank documentation with codebase state |
| code-searcher | .claude/agents/ |
Efficient codebase navigation with optional Chain of Draft mode |
| get-current-datetime | .claude/agents/ |
Accurate Brisbane timezone (GMT+10) values |
| ux-design-expert | .claude/agents/ |
Comprehensive UX/UI design guidance with Tailwind CSS & Highcharts |
| zai-cli | .claude/agents/ |
CLI wrapper for z.ai GLM 4.7 model (used by consult-zai skill) |
| codex-cli | .claude/agents/ |
CLI wrapper for OpenAI Codex GPT-5.2 (used by consult-codex skill) |
Proactively maintains consistency between CLAUDE-*.md files and source code:
- Pattern documentation synchronization
- Architecture decision updates
- Technical specification alignment
- Implementation status tracking
Efficiently searches the codebase with two modes:
- Standard mode: Full detailed analysis
- CoD mode: ~80% fewer tokens with ultra-concise responses
# Standard: "Find the payment processing code"
# CoD: "Find the payment processing code using CoD"
Returns accurate Brisbane, Australia (GMT+10) timestamps:
- Supports multiple formats (default, filename, readable, ISO)
- Eliminates timezone confusion
Comprehensive UX/UI guidance:
- UX flow optimization
- Premium UI design with Tailwind CSS
- Data visualization with Highcharts
- Accessibility compliance
CLI wrapper for z.ai GLM 4.7 model:
- Executes z.ai CLI with JSON output
- Used internally by consult-zai skill
- Returns raw output for skill to process
CLI wrapper for OpenAI Codex GPT-5.2:
- Executes Codex CLI in readonly mode
- Used internally by consult-codex skill
- Returns raw output for skill to process
Skills provide specialized capabilities. See Agent Skills documentation.
| Skill | Purpose | Invocation |
|---|---|---|
| claude-docs-consultant | Selectively fetches official Claude Code documentation from docs.claude.com | Automatic when working on Claude Code features |
| consult-zai | Dual-AI consultation comparing z.ai GLM 4.7 and code-searcher | /consult-zai "question" or via Skill tool |
| consult-codex | Dual-AI consultation comparing Codex GPT-5.2 and code-searcher | /consult-codex "question" or via Skill tool |
| ai-image-creator | Generate PNG images using AI (multiple models including Gemini, FLUX.2, Riverflow, SeedDream, GPT-5, GPT-5.4 Image 2 via OpenRouter/Cloudflare AI Gateway). Supports transparent backgrounds (-t), reference image editing (-r), image analysis and description (--analyze), per-project cost tracking (--costs), prompt enhancement patterns, and composite banner generation for multi-size logo banners via ImageMagick. Requires setup |
/ai-image-creator or via Skill tool |
| session-metrics | Parse Claude Code JSONL logs into per-turn token/cost/cache breakdowns with multi-format export (text/JSON/CSV/MD/HTML). Includes 5-hour session blocks with 7/14/30-day counters for weekly-cap tracking, weekly roll-up with percentage deltas, session duration + burn rate, hour-of-day bars, weekday × hour punchcard, and pluggable chart libraries via --chart-lib {highcharts,uplot,chartjs,none} (Highcharts default, uPlot/Chart.js MIT alternatives, all vendored + SHA-256 verified). Instance-wide dashboard (--all-projects, v1.14.0+) rolls up every project under ~/.claude/projects/ into one dated export folder with per-project HTML drilldowns and a daily-cost timeline. Zero network at runtime, stdlib-only Python. |
Auto-triggers on cost/usage questions or uv run python .claude/skills/session-metrics/scripts/session-metrics.py — also installable via /plugin marketplace add centminmod/claude-plugins + /plugin install session-metrics@centminmod |
| Command | Purpose |
|---|---|
/apply-thinking-to |
Applies Anthropic's extended thinking patterns to enhance prompts |
/convert-to-todowrite-tasklist-prompt |
Converts prompts to TodoWrite tasklist methods (60-70% speed improvement) |
/update-memory-bank |
Updates CLAUDE.md and memory bank files |
| Command | Purpose |
|---|---|
/ccusage-daily |
Generates comprehensive usage cost analysis with daily breakdowns |
| Command | Purpose |
|---|---|
/cleanup-context |
Memory bank optimization (15-25% token reduction) |
| Command | Purpose |
|---|---|
/create-readme-section |
Generates README sections with professional formatting |
/create-release-note |
Creates dual release notes (customer-facing + technical) |
| Command | Purpose |
|---|---|
/security-audit |
Comprehensive security audit using OWASP guidelines |
/check-best-practices |
Analyzes code against language-specific best practices |
/secure-prompts |
Detects prompt injection attacks and malicious instructions |
Example test prompts at .claude/commands/security/test-examples/
| Command | Purpose |
|---|---|
/explain-architecture-pattern |
Identifies and explains architectural patterns |
| Command | Purpose |
|---|---|
/convert-to-test-driven-prompt |
Transforms requests into TDD-style prompts |
/batch-operations-prompt |
Optimizes prompts for parallel processing |
| Command | Purpose |
|---|---|
/refactor-code |
Creates detailed refactoring plans with risk assessment |
Hooks run custom commands before or after tool execution.
The STOP hook uses Terminal-Notifier for macOS desktop notifications when Claude Code completes a response. Setup: Terminal-Notifier
Z.AI's GLM Coding Plan provides cost-effective access to high-performance language models optimized for coding.
10% Discount: Use invite code
WWB8IFLROM
- Performance: 55+ tokens/second for real-time interaction
- Features: Vision Understanding, Web Search, Web Reader MCP servers
- Multimodal: GLM-4.7 with state-of-the-art reasoning capabilities
| Plan | Prompts/5hrs | Approx. Monthly Cost | vs Claude |
|---|---|---|---|
| Lite | ~120 | ~$3 | 3× Claude Pro quota |
| Pro | ~600 | Higher | 3× Claude Max 5x quota |
| Max | ~2,400 | Higher | 3× Claude Max 20x quota |
Each prompt allows 15–20 model calls, yielding billions of tokens monthly at ~1% of standard API pricing.
- Data Location: Singapore
- Privacy Guarantee: Z.AI does not store any content you provide or generate
- See Privacy Policy
- Node.js 18+
- Z.AI API key from Z.AI dashboard
- Official documentation
Option 1: Automated Setup (macOS/Linux only)
curl -O "https://cdn.bigmodel.cn/install/claude_code_zai_env.sh" && bash ./claude_code_zai_env.shOption 2: Manual Configuration
Edit ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-zai-api-key",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"API_TIMEOUT_MS": "3000000"
}
}The easiest way to use Z.AI without affecting your existing Claude Code setup.
macOS / Linux (Bash/Zsh)
Add 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 "$@"
}Reload: source ~/.bashrc or source ~/.zshrc
Windows PowerShell
Add to PowerShell profile (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
}Reload: . $PROFILE
Windows CMD Batch
Create zai.bat in a directory in your PATH:
@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 %*GLM Coding Plan maps Claude model names to GLM models:
| Claude Model | GLM Model |
|---|---|
| Opus | GLM-4.7 |
| Sonnet | GLM-4.7 |
| Haiku | GLM-4.5-Air |
Customizing Model Mappings (optional):
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"
}
}Or in shell function:
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 "$@"
}Windows PowerShell Model Mapping
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
}Windows CMD Model Mapping
@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 planCombine Z.AI with git worktrees for isolated parallel sessions.
macOS / Linux (Bash/Zsh)
# 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
}Windows PowerShell Z.AI + Worktree
# 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
}
}Windows CMD Z.AI + Worktree
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
)
endlocalUsage:
# Create worktree with custom name
zaix feature-auth
# Create worktree with auto-generated timestamp name
zaixClaude 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:
- Respond to
@claudementions in issues and pull requests - Create and modify code through pull requests
- Follow project-specific guidelines from
CLAUDE.md - Execute slash commands like
/review
Reference: Claude Code GitHub Actions Documentation
Create .github/workflows/claude.yml:
Click to expand workflow YAML
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 |
- Add API key as secret: Go to repository Settings → Secrets and variables → Actions → Add
ANTHROPIC_API_KEYwith your Z.AI API key - Create workflow file: Save the YAML above to
.github/workflows/claude.yml - Usage: Mention
@claudein any issue or PR comment to trigger the workflow
From August 28, 2025, weekly rate limits apply in addition to monthly 50x 5hr session limits:
| 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 |
Use the Usage Metrics MCP server to track costs:
claude mcp add --transport stdio metrics -s user -- uv run --directory /path/to/mcp-server metrics-serverOr use the /ccusage-daily slash command for detailed cost analysis.
- Use Z.AI for higher quotas at lower cost
- Configure status lines to monitor real-time usage
- Use git worktrees for parallel sessions without duplicating quota
- Leverage CoD mode in code-searcher for 80% token reduction
| Scope | Location | Affects | Shared? |
|---|---|---|---|
| Managed | System directories | All users | By IT |
| User | ~/.claude/settings.json |
You (all projects) | No |
| Project | .claude/settings.json |
All collaborators | Yes |
| Local | .claude/settings.local.json |
You (this project) | No |
Precedence (highest to lowest):
- Enterprise policies
- Command line arguments
- Local project settings
- Shared project settings
- User settings
| Key | Description | Example |
|---|---|---|
apiKeyHelper |
Script to generate auth value | /bin/generate_temp_api_key.sh |
cleanupPeriodDays |
Days to retain chat transcripts (default: 30) | 20 |
env |
Environment variables for every session | {"FOO": "bar"} |
includeCoAuthoredBy |
Include co-authored-by Claude in commits |
false |
permissions |
Permission rules (see below) |
| Key | Description | Example |
|---|---|---|
allow |
Array of allowed tool use rules | ["Bash(git diff:*)"] |
deny |
Array of denied tool use rules | ["WebFetch", "Bash(curl:*)"] |
additionalDirectories |
Additional working directories | ["../docs/"] |
defaultMode |
Default permission mode | "acceptEdits" |
disableBypassPermissionsMode |
Prevent bypass mode | "disable" |
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY |
API key for Claude SDK |
ANTHROPIC_AUTH_TOKEN |
Custom auth header value |
ANTHROPIC_BASE_URL |
Custom API endpoint |
ANTHROPIC_MODEL |
Custom model name |
ANTHROPIC_SMALL_FAST_MODEL |
Haiku-class model for background tasks |
BASH_DEFAULT_TIMEOUT_MS |
Default bash command timeout |
BASH_MAX_TIMEOUT_MS |
Maximum bash command timeout |
BASH_MAX_OUTPUT_LENGTH |
Max characters before truncation |
CLAUDE_CODE_MAX_OUTPUT_TOKENS |
Max output tokens per request |
CLAUDE_CODE_USE_BEDROCK |
Use Amazon Bedrock |
CLAUDE_CODE_USE_VERTEX |
Use Google Vertex AI |
DISABLE_AUTOUPDATER |
Disable automatic updates |
DISABLE_TELEMETRY |
Opt out of Statsig telemetry |
HTTP_PROXY / HTTPS_PROXY |
Proxy server settings |
MAX_THINKING_TOKENS |
Force thinking budget |
MCP_TIMEOUT |
MCP server startup timeout |
MCP_TOOL_TIMEOUT |
MCP tool execution timeout |
MAX_MCP_OUTPUT_TOKENS |
Max MCP response tokens (default: 25000) |
| File | macOS | Linux | Windows |
|---|---|---|---|
| User settings | ~/.claude/settings.json |
~/.claude/settings.json |
%USERPROFILE%\.claude\settings.json |
| Project settings | .claude/settings.json |
.claude/settings.json |
.claude\settings.json |
| Local settings | .claude/settings.local.json |
.claude/settings.local.json |
.claude\settings.local.json |
| Tool | Description | Permission Required |
|---|---|---|
| Agent | Runs sub-agents for complex tasks | No |
| Bash | Executes shell commands | Yes |
| Edit | Makes targeted file edits | Yes |
| Glob | Finds files by pattern | No |
| Grep | Searches file contents | No |
| LS | Lists files and directories | No |
| MultiEdit | Multiple edits atomically | Yes |
| NotebookEdit | Modifies Jupyter cells | Yes |
| NotebookRead | Reads Jupyter notebooks | No |
| Read | Reads file contents | No |
| TodoRead | Reads task list | No |
| TodoWrite | Creates/manages task lists | No |
| WebFetch | Fetches URL content | Yes |
| WebSearch | Performs web searches | Yes |
| Write | Creates/overwrites files | Yes |
# List settings
claude config list
# Get a setting
claude config get <key>
# Set a setting
claude config set <key> <value>
# Add to a list setting
claude config add <key> <value>
# Remove from a list setting
claude config remove <key> <value>
# Global configuration
claude config set -g <key> <value>| Key | Description | Example |
|---|---|---|
autoUpdates |
Enable automatic updates (default: true) | false |
preferredNotifChannel |
Notification method | iterm2, terminal_bell, notifications_disabled |
theme |
Color theme | dark, light, light-daltonized, dark-daltonized |
verbose |
Show full command outputs | true |
- Claude Code Overview
- Claude Code Settings
- Claude Code Hooks
- Claude Code Skills
- Claude Code Sub-agents
- Plugin Marketplace
- Claude Code with Opus 4.5 - Alex Finn
- How To Master Claude Code (Anthropic's Official 7-Hour Course) - Anthropic Official
- Claude Code Overview - Matt Maher
- VS Code Beginner Guide
- Ralph Wiggum Tutorial - Greg Isenberg & Ryan Carson
- Advent of Claude: 31 Days - Ado Kukic
- 40+ Claude Code Tips
- OpenClaw: Security, Deployment & Cost Guide - For using Claude LLM models with OpenClaw