update CLAUDE.md

This commit is contained in:
George Liu 2025-09-14 16:26:27 +10:00
parent 0668dbc021
commit ef3b1b146d
2 changed files with 106 additions and 3 deletions

102
CLAUDE.md
View File

@ -36,3 +36,105 @@ This project uses a structured memory bank system with specialized context files
When asked to backup Memory Bank System files, you will copy the core context files above and @.claude settings directory to directory @/path/to/backup-directory. If files already exist in the backup directory, you will overwrite them. When asked to backup Memory Bank System files, you will copy the core context files above and @.claude settings directory to directory @/path/to/backup-directory. If files already exist in the backup directory, you will overwrite them.
## Project Overview ## Project Overview
## ALWAYS START WITH THESE COMMANDS FOR COMMON TASKS
**Task: "List/summarize all files and directories"**
```bash
fd . -t f # Lists ALL files recursively (FASTEST)
# OR
rg --files # Lists files (respects .gitignore)
```
**Task: "Search for content in files"**
```bash
rg "search_term" # Search everywhere (FASTEST)
```
**Task: "Find files by name"**
```bash
fd "filename" # Find by name pattern (FASTEST)
```
### Directory/File Exploration
```bash
# FIRST CHOICE - List all files/dirs recursively:
fd . -t f # All files (fastest)
fd . -t d # All directories
rg --files # All files (respects .gitignore)
# For current directory only:
ls -la # OK for single directory view
```
### BANNED - Never Use These Slow Tools
* ❌ `tree` - NOT INSTALLED, use `fd` instead
* ❌ `find` - use `fd` or `rg --files`
* ❌ `grep` or `grep -r` - use `rg` instead
* ❌ `ls -R` - use `rg --files` or `fd`
* ❌ `cat file | grep` - use `rg pattern file`
### Use These Faster Tools Instead
```bash
# ripgrep (rg) - content search
rg "search_term" # Search in all files
rg -i "case_insensitive" # Case-insensitive
rg "pattern" -t py # Only Python files
rg "pattern" -g "*.md" # Only Markdown
rg -1 "pattern" # Filenames with matches
rg -c "pattern" # Count matches per file
rg -n "pattern" # Show line numbers
rg -A 3 -B 3 "error" # Context lines
rg " (TODO| FIXME | HACK)" # Multiple patterns
# ripgrep (rg) - file listing
rg --files # List files (respects •gitignore)
rg --files | rg "pattern" # Find files by name
rg --files -t md # Only Markdown files
# fd - file finding
fd -e js # All •js files (fast find)
fd -x command {} # Exec per-file
fd -e md -x ls -la {} # Example with ls
# jq - JSON processing
jq. data.json # Pretty-print
jq -r .name file.json # Extract field
jq '.id = 0' x.json # Modify field
```
### Search Strategy
1. Start broad, then narrow: `rg "partial" | rg "specific"`
2. Filter by type early: `rg -t python "def function_name"`
3. Batch patterns: `rg "(pattern1|pattern2|pattern3)"`
4. Limit scope: `rg "pattern" src/`
### INSTANT DECISION TREE
```
User asks to "list/show/summarize/explore files"?
→ USE: fd . -t f (fastest, shows all files)
→ OR: rg --files (respects .gitignore)
User asks to "search/grep/find text content"?
→ USE: rg "pattern" (NOT grep!)
User asks to "find file/directory by name"?
→ USE: fd "name" (NOT find!)
User asks for "directory structure/tree"?
→ USE: fd . -t d (directories) + fd . -t f (files)
→ NEVER: tree (not installed!)
Need just current directory?
→ USE: ls -la (OK for single dir)
```

View File

@ -8,10 +8,11 @@
My Claude Code project's starter settings and Claude Code hooks and slash commands are provided in this repository for users to try out. 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](https://claude.ai/) 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](https://support.anthropic.com/en/articles/9797557-usage-limit-best-practices). My Claude Code project's starter settings and Claude Code hooks and slash commands are provided in this repository for users to try out. 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](https://claude.ai/) 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](https://support.anthropic.com/en/articles/9797557-usage-limit-best-practices).
1. Copy the files in this Github repo to your project directory (where you intended codebase will be). 1. Copy the files in this Github repo to your project directory (where you intended codebase will be).
2. Modify the template files and `CLAUDE.md` to your liking. `.claude/settings.json` needs 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`. 2. Modify the template files and CLAUDE.md`to your liking. `.claude/settings.json` needs 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`.
3. After launching Claude Code for the first time within your project directory, run `/init` so that Claude Code analyses your code base and then populates your memory bank system files as per `CLAUDE.md` instructions. 3. After launching Claude Code for the first time within your project directory, run `/init` so that Claude Code analyses your code base and then populates your memory bank system files as per CLAUDE.md` instructions.
4. Optional step highly recommended: Install Visual Studio Code ([beginners YouTube video guide](https://www.youtube.com/watch?v=rPITZvwyoMc) and [here](https://www.youtube.com/watch?v=P-5bWpUbO60)) and [Claude Code VSC Extension](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code). 4. Optional step highly recommended: Install Visual Studio Code ([beginners YouTube video guide](https://www.youtube.com/watch?v=rPITZvwyoMc) and [here](https://www.youtube.com/watch?v=P-5bWpUbO60)) and [Claude Code VSC Extension](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code).
5. Optional step highly recommended: Sign up for [Github.com](https://github.com/) account and install Git for Visual Studio Code. Checkout YouTube guides [here](https://www.youtube.com/watch?v=twsYxYaQikI) and [here](https://www.youtube.com/watch?v=z5jZ9lrSpqk). 5. Optional step highly recommended: Sign up for [Github.com](https://github.com/) account and install Git for Visual Studio Code. Checkout YouTube guides [here](https://www.youtube.com/watch?v=twsYxYaQikI) and [here](https://www.youtube.com/watch?v=z5jZ9lrSpqk).
6. CLAUDE.md updated to instruct models to use faster tools so for macOS: `brew install ripgrep fd jq`
I also install the following MCP servers ([install commands](#claude-code-mcp-servers)): I also install the following MCP servers ([install commands](#claude-code-mcp-servers)):