Your AI-powered development assistant with self-learning capabilities.
# Start of session
/session-start # Load context from previous sessions
# During development
/generate-tests # Generate tests for your code
/fix-build # Fix build errors
/run-tests # Run unit/integration tests
/security-scan # Security analysis
# When mistakes happen
/correct "description" # Capture mistake → adds to LEARNINGS
# End of session
/diary # Save session learnings┌─────────────────────────────────────────────────────────────┐
│ START SESSION │
│ /session-start │
└─────────────────┬───────────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────┐
│ DEVELOPMENT │
│ Write code, use commands, Claude learns from mistakes │
└─────────────────┬───────────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────┐
│ MISTAKE HAPPENS? │
│ /correct "what went wrong" │
└─────────────────┬───────────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────┐
│ END SESSION │
│ /diary │
└─────────────────────────────────────────────────────────────┘
| Command | Purpose | When to Use |
|---|---|---|
/session-start |
Load context from previous sessions | Start of every session |
/diary |
Save learnings to memory | End of session |
/reflect |
Review diary, propose CLAUDE.md updates | Weekly review |
| Command | Purpose | Example |
|---|---|---|
/correct |
Capture a mistake for learning | /correct "forgot to handle nil pointer" |
How it works:
- You notice Claude made a mistake
- Run
/correct "description of what went wrong" - Claude abstracts the pattern and adds it to LEARNINGS in CLAUDE.md
- Future sessions avoid the same mistake
| Command | Purpose | Tools Used |
|---|---|---|
/add-command |
Create new CLI command | Read, Write, Edit, Glob, Grep |
/generate-crud-command |
Generate full CRUD command | Read, Write, Edit, Glob, Grep |
/add-flag |
Add flag to existing command | Read, Edit |
/add-domain-type |
Add new domain type | Read, Write, Edit |
/add-api-method |
Add new API method | Read, Write, Edit |
Authoritative source:
.claude/commands/run-tests.md
| Command | Purpose | Tools Used |
|---|---|---|
/run-tests |
Run unit/integration tests | Read, Bash(go test, make test) |
/generate-tests |
Generate tests for code | Read, Write, Edit, Bash(go test) |
/add-integration-test |
Add integration test | Read, Write, Edit, Bash(go test) |
/debug-test-failure |
Analyze and fix test failures | Read, Edit, Bash(go test) |
/analyze-coverage |
Analyze test coverage | Read, Bash(go test) |
Coverage goals: See .claude/rules/testing.md for authoritative targets.
Make targets: See
docs/DEVELOPMENT.mdfor authoritative list.
| Command | Purpose | Tools Used |
|---|---|---|
/fix-build |
Fix Go build errors | Read, Edit, Write, Bash(go build, go vet) |
/security-scan |
Security vulnerability scan | Read, Grep, Glob, Bash(make security) |
/review-pr |
Review pull request | Read, Grep, Glob, Bash(git) |
/update-docs |
Update documentation | Read, Write, Edit |
| Command | Purpose | When to Use |
|---|---|---|
/parallel-explore |
Explore codebase with 4-5 parallel agents | Large codebase search, cross-layer feature discovery |
/parallel-review |
Review code with parallel reviewer agents | Large PRs, multi-file reviews |
Parallel Explore Details:
# Basic usage - searches all layers
/parallel-explore "email sending functionality"
# Spawns 4-5 codebase-explorer agents across:
# - internal/cli/ (commands, flags)
# - internal/adapters/ (API integrations)
# - internal/air/ (web UI handlers)
# - internal/tui/ (terminal UI)
# - internal/domain/ (core types)Each agent uses thoroughness levels (quick/medium/thorough) and consolidates results by layer.
Claude has specialized agents for different tasks:
Best for: Production-ready code in Go, JavaScript, CSS
Expertise:
- Go: Hexagonal architecture, error wrapping, table-driven tests
- JavaScript: Vanilla JS, progressive enhancement, event delegation
- CSS: BEM naming, CSS custom properties, mobile-first
Reference: .claude/agents/references/helper-reference.md
Best for: Fast codebase exploration without coding
Thoroughness Levels:
- quick: 1-2 searches, 1-2 files, 50 words (targeted lookups)
- medium: 3-5 searches, 3-5 files, 150 words (default)
- thorough: Exhaustive, 10+ files, 300 words (deep dives)
Use for:
- Finding where functionality is implemented
- Understanding code patterns
- Answering "where is X?" questions
Best for: All test generation (Go + Playwright)
Go Tests: Table-driven with t.Run(), testify assertions, rate-limited
Playwright: Semantic selectors only (getByRole > getByText > getByTestId)
Patterns: .claude/shared/patterns/go-test-patterns.md
.claude/shared/patterns/playwright-patterns.md
Best for: JavaScript, CSS, Go templates
Tech stack:
- Vanilla ES6+ JavaScript (no npm in browser)
- CSS custom properties, BEM naming
- Go html/template (.gohtml)
Best for: Abstracting mistakes into learnings
Process:
1. Understand what went wrong
2. Abstract the pattern (not specific instance)
3. Add to CLAUDE.md LEARNINGS section
Best for: Independent code review for quality
Checks: Quality, bugs, security, performance
Can run in parallel with other reviewers
Best for: Deep security vulnerability analysis
Audits: Secrets, command injection, path traversal, dependencies
Checklist: .claude/agents/references/security-checklist.md
Hooks run automatically to enforce quality:
Runs: When Claude tries to complete a task Blocks if: Go code fails fmt, vet, lint, or tests
# What it checks:
go fmt ./... # Code formatting
go vet ./... # Static analysis
golangci-lint run # Linting
go test -short ./... # Unit testsRuns: When a subagent completes Blocks if: Output contains CRITICAL, FAIL, or BUILD FAILED
Runs: Before context window compaction
Action: Warns to save learnings with /diary
Runs: When you submit a prompt Action: Injects relevant context based on keywords
Triggers:
- "test" → Testing patterns reminder
- "security" → Security scan reminder
- "api" → Nylas v3 API reminder
- "playwright" → Semantic selector reminder
- "css" → BEM naming reminder
- "commit" → Git rules reminder
Runs: Before writing Go files Blocks if: File would exceed 600 lines Warns if: File would exceed 500 lines
Runs: After editing Go files
Action: Auto-runs gofmt -w on the edited file
Hook Configuration: See .claude/HOOKS-CONFIG.md for settings.json setup
claude-progress.txt # What's done, in progress, next up (auto-updated)
~/.claude/memory/diary/ # Session learnings from /diary
- Use
/mcpto disable unused MCP servers - For large tasks: dump plan to .md,
/clear, resume - Press
#to quickly update CLAUDE.md during sessions - Agents load reference files on-demand (not auto-loaded)
CLAUDE.md has a self-updating LEARNINGS section:
Things unique to this codebase:
- Playwright selectors: ALWAYS use semantic selectors (getByRole > getByText > getByLabel > getByTestId)
- Go tests: ALWAYS use table-driven tests with t.Run()
- Integration tests: ALWAYS use acquireRateLimit(t) before API calls
- Directory permissions: Use 0750, not 0755 (gosec G301)
Surprising sequences:
- Progressive disclosure: Keep main skill files under 100 lines
- Self-learning: Use "Reflect → Abstract → Generalize → Write"
Hard-won knowledge:
- Go build cache corruption: Fix with
sudo rm -rf ~/.cache/go-build ~/go/pkg/mod && go clean -cache
# Start every session with context
/session-start
# Capture mistakes immediately
/correct "what went wrong"
# Save learnings before ending
/diary
# Use specialized agents for their domain
# - test-writer for tests (Go + Playwright)
# - frontend-agent for CSS/JS
# - codebase-explorer for finding code# Don't skip session start - you lose context
# Don't ignore mistakes - they'll repeat
# Don't skip /diary - learnings are lost
# Don't use CSS selectors in Playwright - use semantic selectors| Task | Command |
|---|---|
| Start session | /session-start |
| Create command | /add-command |
| Generate tests | /generate-tests |
| Fix build | /fix-build |
| Run tests | /run-tests |
| Security check | /security-scan |
| Explore codebase | /parallel-explore |
| Review PR | /parallel-review |
| Capture mistake | /correct "description" |
| End session | /diary |
| Review learnings | /reflect |
When nylas auth config runs, credentials are stored in the system keyring:
| Key | Description |
|---|---|
client_id |
Nylas Application/Client ID |
api_key |
Nylas API key (Bearer auth) |
client_secret |
Provider OAuth secret (Google/Microsoft) |
org_id |
Nylas Organization ID |
grants |
JSON array of grant info (ID, email, provider) |
default_grant |
Default grant ID for CLI |
grant_token_<id> |
Per-grant access tokens |
Key files: internal/ports/secrets.go (constants), internal/adapters/keyring/keyring.go (keyring), internal/adapters/keyring/grants.go (grants)
Service name: "nylas" | Fallback: Encrypted file in ~/.config/nylas/
- All commands: Type
/and see autocomplete - Command details: Read
.claude/commands/<command>.md - Agent details: Read
.claude/agents/<agent>.md - Hook setup: Read
.claude/HOOKS-CONFIG.md - Project rules: Read
CLAUDE.md - Architecture: Read
docs/ARCHITECTURE.md
| Topic | Authoritative Source |
|---|---|
| Architecture | docs/ARCHITECTURE.md |
| Make targets | docs/DEVELOPMENT.md |
| Test coverage | .claude/rules/testing.md |
| File size limits | .claude/rules/file-size-limits.md |
| Go test patterns | .claude/shared/patterns/go-test-patterns.md |
| Integration tests | .claude/shared/patterns/integration-test-patterns.md |
| CLI helpers | .claude/agents/references/helper-reference.md |
| Security checklist | .claude/agents/references/security-checklist.md |
| Doc standards | .claude/agents/references/doc-standards.md |
Welcome to self-learning Claude Code!