Configure Claude Code for optimized workflows.
Find a file
2026-03-11 14:23:01 +01:00
global/.claude Stylelint 2026-03-04 09:31:33 +01:00
project-template Fix gdlintrc 2026-03-06 17:19:03 +01:00
.gitignore Stylelint 2026-03-04 09:31:33 +01:00
README.md Correct Readme 2026-03-11 14:23:01 +01:00

Claude Code Configuration Setup

What's Included

global/
└── .claude/
    ├── CLAUDE.md          ← Applies to EVERY session (global preferences)
    ├── settings.json      ← Permissions, model selection, hooks, custom scripts
    └── statusline.sh      ← Script for displaying token usage


project-template/
├── .gdlintrc              ← Configuration used by gdlint
├── analysis_options.yaml  ← Configuration used by Flutter (dart) linter
├── CLAUDE.md              ← Template to fill in per-project (commit to git)
└── .claude/
    ├── settings.json      ← (copy from global, or leave absent to inherit)
    ├── hooks/
    │   └── post-edit-lint.sh   ← Auto-lints after every file edit
    ├── skills/
    │   ├── codebase-navigator/ ← Token-efficient project exploration
    │   │   └── SKILL.md
    │   └── code-quality/       ← PEP8 / GCC-clean / shellcheck enforcement
    │       └── SKILL.md
    ├── agents/
    │   ├── code-reviewer.md    ← Haiku-based review agent (saves tokens)
    │   └── project-scout.md    ← Maps codebase structure cheaply
    └── commands/
        ├── audit.md            ← /audit  - full quality check
        ├── scout.md            ← /scout  - map codebase structure
        └── review.md           ← /review - pre-commit code review

Requirements

The following tools need to be present for the setup to work:

Universal

  • git | Used throughout for diffs, changed files, root detection | sudo apt install git
  • tree | Directory structure overview in /scout | sudo apt install tree
  • bash | Hook scripts | pre-installed
  • grep, find, cat, ls | File exploration | pre-installed

Python

  • python3 | Runtime / python3 -m pytest | sudo apt install python3
  • pip3 | Package installer | sudo apt install python3-pip
  • black | Auto-formatter | pip3 install black
  • isort | Import sorter | pip3 install isort
  • flake8 | PEP8 linter | pip3 install flake8
  • pylint | Static analysis | pip3 install pylint
  • mypy | Type checker | pip3 install mypy
  • pytest | Test runner | pip3 install pytest

C / C++

  • gcc | C compiler (syntax + warning checks) | sudo apt install gcc
  • g++ | C++ compiler | sudo apt install g++
  • clang | Alternative compiler | sudo apt install clang
  • clang-tidy | C/C++ static analysis | sudo apt install clang-tidy
  • cppcheck | C/C++ static analysis | sudo apt install cppcheck
  • make | Build system | sudo apt install make

Bash / Shell

  • shellcheck | Shell script linter | sudo apt install shellcheck

Go

  • go | Runtime, go vet, go build, go test, go fmt | go.dev/dl or sudo apt install golang (often outdated — prefer upstream)
  • gofmt | Formatter — ships with Go | included with go
  • goimports | Import organizer | go install golang.org/x/tools/cmd/goimports@latest
  • staticcheck | Deep static analysis | go install honnef.co/go/tools/cmd/staticcheck@latest
  • golangci-lint | All-in-one linter (preferred, replaces several above) | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin

Rust

  • cargo | Build system, cargo clippy, cargo fmt, cargo test, cargo build | curl https://sh.rustup.rs -sSf | sh — includes cargo, rustc, rustfmt, clippy
  • cargo-audit | Dependency vulnerability audit | cargo install cargo-audit
  • rustfmt and clippy | Rustup components — add them with "rustup component add rustfmt clippy" if not already present.

JavaScript / TypeScript

  • node | Runtime | sudo apt install nodejs or via nvm (preferred)
  • npm | Package manager, npm test | included with Node.js
  • npx | Run local packages (eslint, prettier, tsc) | included with npm

The following are installed per-project via npm install --save-dev, not globally:

  • eslint + @typescript-eslint/eslint-plugin + @typescript-eslint/parser
  • prettier
  • typescript (provides tsc)

CSS

  • stylelint | W3C validator on cli | npm install stylelint

Quick install cheatsheet

# System packages (Debian/Ubuntu)
sudo apt install git tree gcc g++ clang clang-tidy cppcheck make \
                 shellcheck python3 python3-pip pipx golang nodejs npm

# Python tools
pipx install black isort flake8 pylint mypy pytest gdtoolkit

# Go tools (after installing Go)
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
# OR the all-in-one linter:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
  | sh -s -- -b "$(go env GOPATH)/bin"

# Rust toolchain + components
curl https://sh.rustup.rs -sSf | sh
rustup component add rustfmt clippy
cargo install cargo-audit

# Node/JS tools (also possible per-project via package.json devDependencies)
npm install eslint prettier typescript

# CSS
npm install stylelint

Installation

1. Global config (once, applies everywhere)

cp -r global/.claude ~

2. Per-project config (repeat for each project)

cp -r project-template/CLAUDE.me \
project-template/.claude \
project-template/.gdlintrc \
project-template/analysis_options.yaml \
~/your-project

# Fill in CLAUDE.md with the project details

3. Verify

# Start Claude Code and check it loaded the config
claude
# In Claude Code, type:
/help
# You should see the custom commands: /audit, /scout, /review

How to Use

Starting on a new/unfamiliar project

/scout

This runs the project-scout subagent (cheap Haiku model) and returns a structured summary without reading the whole codebase.

Before committing changes

/review

Reviews all changed files via the code-reviewer subagent.

Full quality check

/audit

Runs all linters and reports blockers vs. warnings.

Token efficiency tips

  • Always start with /scout instead of asking Claude to "look around"
  • Use plan mode (Shift+Tab) for multi-file tasks - review before executing
  • Run /compact manually when context gets large (before the 50% mark)
  • For big refactors, break them into 3-5 file chunks per session

Customizing

Adding a new skill

mkdir .claude/skills/my-skill
cat > .claude/skills/my-skill/SKILL.md << 'EOF'
---
name: my-skill
description: |
  One sentence: when should Claude load this?
---
# Skill: My Skill
...instructions...
EOF

Adding a new command

cat > .claude/commands/mycommand.md << 'EOF'
# /mycommand - What It Does
...natural language instructions...
Use $ARGUMENTS for any parameters.
EOF

Updating global rules

Edit ~/.claude/CLAUDE.md. Changes take effect on the next session. Keep it under 80 lines - every line competes for Claude's attention.