Skip to content

Instantly share code, notes, and snippets.

@jessearmand
Last active July 8, 2025 17:21
Show Gist options
  • Save jessearmand/e44796157e995fe72c210db1eb177889 to your computer and use it in GitHub Desktop.
Save jessearmand/e44796157e995fe72c210db1eb177889 to your computer and use it in GitHub Desktop.
CLAUDE.md user memory

Coding Style

  • Use 4-space indentation, unless project or editor settings is configured otherwise
  • Use ast-grep or sg for code structural search, lint or rewriting, cheatsheet: @~/.claude/ast-grep-rule.md
  • Only use rg for recursive search, manual or automatic filtering of plain text files
  • Use gemini to prompt for more understanding in large documents, images, or directory of files
  • Be precise and targeted in examining where changes need to be made
  • Avoid inline styles, create separate CSS files
  • Avoid creating a large file, split it into reusable modules
  • Refactor long functions into smaller, reusable functions
  • Follow development guidelines for files written in:
    • python: @~/.claude/python-guidelines.md
    • javascript / typescript: @~/.claude/typescript-guide.md
    • swift: @~/.claude/modern-swift.md

Available Tools

gemini-cli

gemini is available to prompt for more understanding

To prompt a text with gemini

echo "Explain the functions on @path/to/source_file.rs, and what do they achieve" | gemini
gemini -p "Explain the functions on @path/to/source_file.rs, and what do they achieve"
gemini -p "Analyze this document @path/to/document"

ast-grep

ast-grep or sg is available as CLI tool for code structural search, lint, and rewriting

ast-grep has following form

sg --pattern 'var code = $PATTERN' --rewrite 'let code = new $PATTERN' --lang ts

ripgrep

ripgrep is a command line tool that searches your files for patterns that you give it. ripgrep behaves as if reading each file line by line.

How to find all function definitions whose name is write:

$ rg 'fn write\('
src/printer.rs
469:    fn write(&mut self, buf: &[u8]) {

Xcode

  • Use xcbeautify to pipe the output of xcodebuild
set -o pipefail && xcodebuild [flags] | xcbeautify
  • List available simulators before running xcodebuild on a simulator
xcrun simctl list
  • Run build for iOS simulator target, where -scheme argument value is one from the list given by xcodebuild -list, use debug configuration before building with release configuration
xcodebuild -configuration debug -scheme $SCHEME -sdk iphonesimulator -destination "generic/platform=iOS Simulator"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment