The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Claude Code starter files with memory bank templates
This repository sets up a Claude Code project with reusable memory files, rules, hooks, subagents, and command files. The `CLAUDE.md` templates are meant to be copied into a project and then populated by Claude Code so future sessions keep context instead of starting over.
Videos about this repo
Builders who want Claude Code to use the same project setup, memory files, and workflow rules across sessions.
You can start new Claude Code projects with the same memory bank structure and agent behavior instead of rebuilding the setup each time.
What it does
CLAUDE.md memory bank templates
Provides `CLAUDE-template-1.md`, `CLAUDE-template-2.md`, and `CLAUDE-template-3.md` for different memory and disclosure styles.
Migration prompt for existing setups
Includes `CLAUDE-migrate-to-new-template.md` to help move an existing `CLAUDE.md` into one of the new template formats.
Claude Code project folders
Uses `.claude/agents`, `.claude/commands`, `.claude/hooks`, `.claude/mcp`, `.claude/rules`, and `.claude/skills` to organize agent behavior and extensions.
Project settings files
Includes `.claude/settings.json` and `.claude/settings.local.json` for Claude Code configuration.
Supplementary memory files
Adds `CLAUDE-cloudflare.md`, `CLAUDE-cloudflare-mini.md`, `CLAUDE-convex.md`, and other project-specific memory notes.
Worktree support
Documents `.worktreeinclude` and git worktree usage so Claude Code sessions can copy the right local files into new worktrees.
MCP server references
Lists MCP servers in `mcp-servers.md` for tools like Gemini CLI MCP, Cloudflare docs, Context 7, Chrome Devtools, Notion, and usage metrics.
How to get it
- 1Run
# Create worktree with custom name clx feature-auth cx bugfix-123 # Create worktree with auto-generated timestamp name clx cx
- 2Just run the following command in your terminal. Attention only macOS Linux environment…
curl -O "https://cdn.bigmodel.cn/install/claude_code_zai_env.sh" && bash ./claude_code_zai_env.sh
- 3Run
# Launch with Z.AI configuration zai # Launch with specific model zai --model sonnet # Launch with permission mode zai --model opus --permission-mode plan
README
May 4, 2026 — CLAUDE.md template updated. The
CLAUDE.mdtemplate has been modernized with 3 new variants (CLAUDE-template-1.md,CLAUDE-template-2.md,CLAUDE-template-3.md) following official Anthropic best practices — including dual-memory architecture, progressive disclosure, and standalone behavioral rules. Existing users: useCLAUDE-migrate-to-new-template.mdas an AI prompt to migrate your current CLAUDE.md to any of the new templates while preserving all your project-specific content. See the CLAUDE.md Templates section for details.
- My AI journey Substack to follow me in more indepth AI adventures - https://ai.georgeliu.com
- Threads - https://www.threads.com/@george_sl_liu
- BlueSky - https://bsky.app/profile/georgesl.bsky.social
My Claude Code Project's Starter Settings
Alternate Read Me Guides
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.
- README.md - Original written version I did myself below
- README-v2.md - Progressive Disclosure Guide (Beginner → Intermediate → Advanced sections)
- README-v3.md - Task-Based Guide ("I want to..." navigation for goal-oriented users)
- README-v4.md - Technical Reference Manual (Chapter-based, dense reference format)
Overview
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. The repo now includes 3 CLAUDE.md templates following official Anthropic best practices with progressive disclosure, dual-memory architecture, and a migration guide for existing users. 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.
- Copy the files in this Github repo to your project directory (where you intended codebase will be).
- Modify the template files and CLAUDE.md
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`. - After launching Claude Code for the first time within your project directory, run
/initso that Claude Code analyses your code base and then populates your memory bank system files as per CLAUDE.md` instructions. - Optional step highly recommended: Install Visual Studio Code (beginners YouTube video guide and here) and Claude Code VSC Extension.
- Optional step highly recommended: Sign up for Github.com account and install Git for Visual Studio Code. Checkout YouTube guides here and here.
- CLAUDE.md updated to instruct models to use faster tools so for macOS:
brew install ripgrep fd jq - Optional step to setup Claude Code, Codex GPT-5, Gemini CLI, OpenCode, Vercel CLI, Cloudflare Wrangler, Amazon AWS CLI, all in a single isolated Visual Studio Code dev container running Debian 12. Allowing you to run YOLO modes for Claude Code with
dangerously_skip_permissionsenabled and Codex CLI withsandbox_mode = danger-full-accessetc. - Claude Code via Claude Desktop apps use Git Worktrees. You may need to create a
.worktreeincludefile as outlined here. - If you use Cloudflare and ClerkOS platforms in your apps, you can keep either
CLAUDE-cloudflare.mdorCLAUDE-cloudflare-mini.mdsupplementary reference docs and updateCLAUDE.mdreferencing 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. - If you use Convex database in your apps, you can use
CLAUDE-convex.mdsupplementary reference docs for building Next.js and React apps with Convex backend deployed on Cloudflare Pages. - Useful read Advent of Claude: 31 Days of Claude Code by Ado Kukic from Anthropic.
- Useful Claude Code with Claude Opus 4.5 YouTube video by Alex Finn and Claude Code YouTube video by Matt Maher.
- Configure 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.
- For folks intending to use Claude LLM models with OpenClaw, read this first for security, deployment and cost optimizations https://github.com/centminmod/explain-openclaw.
CLAUDE.md Memory Bank system
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
CLAUDE.md Templates
This repo provides 3 modernized CLAUDE.md templates following official Anthropic best practices:
| Template | Lines | Philosophy | Best For |
|---|---|---|---|
CLAUDE-template-1.md | ~101 | Compact self-contained + memory resilience | Quick starts, small projects |
CLAUDE-template-2.md | ~153 | Memory bank headline + dual memory | Existing memory bank users |
CLAUDE-template-3.md | ~105 | Progressive disclosure native | Teams, max context efficiency |
The current CLAUDE.md uses the Template 3 format. All templates include:
- Dual-memory architecture (git-shared CLAUDE-*.md + machine-local auto memory for resilience)
- Progressive disclosure (memory bank files read on-demand, not auto-loaded)
- Standalone behavioral rules (no dependency on
~/.claude/CLAUDE.md)
Migrating an existing CLAUDE.md? See CLAUDE-migrate-to-new-template.md — paste it as a prompt and Claude Code will migrate your content to your chosen template format.
Tip: HTML comments (<!-- -->) in CLAUDE.md are stripped from context at runtime and cost zero tokens. The templates use them for guidance notes — you can add your own without impacting Claude's context window.
Companion rules file: Template 3 requires .claude/rules/core-rules.md for behavioral rules. Templates 1 and 2 have rules inline but can optionally use it.
MCP Servers
I also install the following MCP servers (install commands):
- Gemini CLI MCP
- Cloudflare Documentation MCP
- Context 7 MCP
- Chrome Devtools MCP
- Notion MCP
- Claude Code Usage Metrics MCP
Claude Code Plugin Marketplace
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.
- https://github.com/anthropics/claude-code/issues/16398
- https://github.com/anthropics/claude-code/issues/16389
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 3rd Party Marketplaces
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 Code Statuslines
~/.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 for AI Coding Sessions
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:
- 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 usage
Official Documentation: Run parallel Claude Code sessions with git worktrees
macOS / Linux (Bash/Zsh)
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
Windows (PowerShell)
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
Windows (CMD Batch Files)
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
Usage
# Create worktree with custom name
clx feature-auth
cx bugfix-123
# Create worktree with auto-generated timestamp name
clx
cx
Worktree Management
# List all worktrees
git worktree list
# Remove a worktree when done
git worktree remove ../worktree-name
# Clean up stale worktree references
git worktree prune
Environment Setup
Each 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
The .worktreeinclude File
When 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:
- Uses
.gitignore-style patterns - Only files matched by both
.worktreeincludeAND.gitignoreare copied - This prevents accidentally duplicating tracked files
Create a .worktreeinclude file 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
Claude Desktop Worktree Location
When using Claude Code via the Claude Desktop app:
- Default worktree location:
~/.claude-worktrees - Configurable through Claude Desktop app settings
- Repository must be Git initialized for worktree sessions to work
Official Documentation: Claude Code on Desktop
Local Ignores Without .gitignore
To 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:
- Personal IDE or editor files
- Local testing scripts
- Machine-specific configurations
- Files you don't want to clutter the shared
.gitignore
Note: Files in .git/info/exclude work with .worktreeinclude the same way as .gitignore - patterns must appear in both files for copying to worktrees.
Using Z.AI with Claude Code
- Get extra 10% discount with invite code [(https://z.ai/subscribe?ic=WWB8IF
Files in the repo
- .claude
- reports
- .clinerules
- .dockerignore
- .worktreeinclude
- AGENTS.md
- CHANGELOG.md
- CLAUDE-cloudflare-mini.md
- CLAUDE-cloudflare.md
- CLAUDE-convex.md
- CLAUDE-history-template.md
- CLAUDE-migrate-to-new-template.md
- CLAUDE-template-1.md
- CLAUDE-template-2.md
- CLAUDE-template-3.md
- CLAUDE.md
- GEMINI.md
- LICENSE
- mcp-servers.md
- README-v2.md
- README-v3.md
- README-v4.md
- README.md
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More harnesses
from vibe coding to agentic engineering - practice makes claude perfect
🌊 The original agent meta-harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost.
Git. Ship. Done - Core

The most RAM efficient harness