Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Research and explore codebases to build context before making changes. Use when starting work on an unfamiliar project, investigating a bug, planning a feature, or when you need to understand how something works.
.claude/skills/marco-souza-explore/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | 154% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 208% | 0% |
| case-02 | ✓→✗ | ▼ Worse | 30% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 37% | 0% |
| case-22 | ✓→✗ | ▼ Worse | 35% | 0% |
Systematically research codebases to build accurate mental models before acting.
Start broad, then drill down:
Project Structure → Module Organization → File Purpose → Implementation DetailsTrace how information flows:
Input → Validation → Transformation → Storage → OutputBefore assuming:
Use modern alternatives for faster, more ergonomic exploration. Install them if available:
| Task | Traditional | Modern Alternative | Why Modern is Better | |------|-------------|-------------------|----------------------| | Search text in files | grep | ripgrep (rg) | Faster, respects .gitignore, better output formatting | | Find files | find | fd | Faster, simpler syntax, respects .gitignore | | View files | cat | bat | Syntax highlighting, line numbers, Git integration | | View diffs | git diff | delta | Syntax-highlighted diffs, side-by-side view, line numbers |
bash# macOS (Homebrew) brew install ripgrep fd bat delta # Ubuntu/Debian sudo apt install ripgrep fd-find bat # Note: Ubuntu binary is 'fdfind', symlink: sudo ln -sf $(which fdfind) /usr/local/bin/fd # Arch Linux sudo pacman -S ripgrep fd bat delta # Check if installed command -v rg fd bat delta 2>/dev/null || echo 'Some tools not installed'
bash# ripgrep - faster grep grep -r 'TODO' src/ # Traditional rg 'TODO' src/ # Modern (faster, cleaner output) rg -t ts 'interface' # Search only TypeScript files # fd - faster find find . -name '*.ts' # Traditional fd '\.ts$' # Modern (regex support) fd -e ts # By extension # bat - better cat cat README.md # Traditional bat README.md # Modern (syntax highlighting) bat -l yaml config.yml # Force language # delta - better diffs git diff # Traditional git diff | delta # Modern (syntax highlighting) delta --side-by-side # Side-by-side view
bash# Start here — every project has these cat README.md # Project overview, setup, conventions cat package.json 2>/dev/null # Dependencies, scripts, metadata cat AGENTS.md 2>/dev/null # Project-specific agent instructions # Or with bat (if available) bat README.md # Syntax-highlighted view with line numbers bat package.json 2>/dev/null # Better readability for JSON
bash# Understand directory layout ls -la # Root contents find . -maxdepth 2 -type d # Top-level directories tree -L 2 2>/dev/null || find . -maxdepth 2 -type d | head -20 # Or with fd (if available) fd -d 2 -t d # Top-level directories (simpler syntax) fd -d 3 -e ts -e go # Find source files up to 3 levels deep
bash# Detect frameworks and patterns grep -l "react\|vue\|angular" package.json 2>/dev/null && echo "Frontend framework detected" grep -l "express\|fastify\|hono" package.json 2>/dev/null && echo "Backend framework detected" grep -l "prisma\|drizzle\|typeorm" package.json 2>/dev/null && echo "ORM detected" # Or with ripgrep (if available) rg -l 'react|vue|angular' package.json 2>/dev/null && echo "Frontend framework detected" rg -l 'prisma|drizzle' package.json 2>/dev/null && echo "ORM detected"
markdown## Exploration: Project Overview **Stack:** React + Node + Prisma **Structure:** src/{components,pages,api}/ **Conventions:** - Feature-based folders - Tests co-located (\*.test.ts) - API routes in src/api/
bash# Identify high-traffic files git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -20 # Or find most imported modules grep -r "^import.*from" --include="*.ts" --include="*.js" | cut -d'"' -f2 | sort | uniq -c | sort -rg | head -20 # With ripgrep (faster) rg -o 'from ["\'][^"\']+["\']' -t ts | sed 's/from //g' | sort | uniq -c | sort -rg | head -20
Pick a key entity (e.g., "User", "Order") and trace it:
bash# Find where it's defined grep -r "interface User\|type User\|class User" --include="*.ts" | head -5 # With ripgrep rg 'interface User|type User|class User' -t ts | head -5 # Find where it's used grep -r "User" --include="*.ts" | grep -v node_modules | wc -l # With ripgrep (auto-ignores node_modules) rg -c 'User' -t ts | head -10 # Find API endpoints that handle it grep -r "user\|User" src/api/ --include="*.ts" | head -10 # With ripgrep cd src/api && rg -i 'user' -t ts | head -10
bash# What does this module depend on? cat src/auth/login.ts | grep "^import" # Or with bat + rg bat src/auth/login.ts | rg '^import' # What depends on this module? grep -r "from.*auth/login" --include="*.ts" | head -10 # With ripgrep rg 'from.*auth/login' -t ts | head -10
markdown# Architecture ## Entry Points - `src/main.ts` — Application bootstrap - `src/api/index.ts` — API route registration ## Core Modules - `auth/` — Authentication, session management - `models/` — Database schemas (Prisma) - `services/` — Business logic ## Data Flow
Request → Middleware → Handler → Service → Model → DB
## Key Files
| File | Purpose |
|------|---------|
| `src/auth/jwt.ts` | Token generation/validation |
| `src/models/user.ts` | User entity definition |Given a task (e.g., "fix login bug"):
bash# Search for keywords grep -r "login\|signin\|authenticate" --include="*.ts" | grep -v test | head -10 # With ripgrep (cleaner, faster) rg -g '!*.test.ts' 'login|signin|authenticate' -t ts | head -10 # Find related tests (show usage patterns) grep -r "login" --include="*.test.ts" | head -5 # With ripgrep fd -e test.ts && rg 'login' -g '*.test.ts' | head -5 # Check recent changes git log --oneline --all --grep="login" | head -5
Start from entry point, trace down:
bash# API route cat src/api/auth.ts # → Calls authService.login() # Implementation cat src/services/auth.ts # → Calls userRepository.findByEmail() # Data layer cat src/repositories/user.ts # → Calls prisma.user.findUnique() # With bat (better readability) bat src/api/auth.ts src/services/auth.ts src/repositories/user.ts
Look for:
throw, catch, if (error))zod, joi, manual checks)canAccess, requireAuth)process.env, import.meta.env)If something doesn't make sense:
bash grep -r "similarFunctionName" --include="*.ts" -A 3 | head -20
bash cat src/auth/login.test.ts | grep -A 10 "should"
bash grep -B 5 "function login" src/auth/login.ts
bash git log -p --all -S "suspiciousCode" -- src/auth/login.ts | head -50
Before proceeding, verify:
bash# "This function is only called from X" grep -r "functionName" --include="*.ts" | grep -v "def\|export" | wc -l # With ripgrep rg -c 'functionName' -t ts # Shows count per file # "This is always a string" grep -r "variableName:" --include="*.ts" | head -5 # With ripgrep rg 'variableName:' -t ts | head -5 # "This mutation updates the database" grep -A 10 "mutationName" src/services/*.ts | grep -E "prisma|save|update" # With ripgrep rg -A 10 'mutationName' -t ts | rg 'prisma|save|update'
After exploration, create/update:
markdown# Context: <Feature/Area> ## What I Learned - X is handled by Y module - Z is the source of truth for W data - Authentication uses JWT with 24h expiry ## Open Questions - [ ] Why is X implemented as Y instead of Z? - [ ] How does the caching layer work? ## Relevant Files | File | Why It Matters | | ------------------------ | ---------------------- | | `src/auth/jwt.ts` | Token generation logic | | `src/middleware/auth.ts` | Route protection | ## Risks/Watchouts - Changing X requires updating Y and Z - No tests for edge case A
Based on your exploration:
DECISIONS.md if you discovered why something is the way it isTODO.md with tasks that emergedSPEC.md for areas you now understandbash# 1. Find error location grep -r "errorMessage" --include="*.ts" # 2. Trace backward cat src/fileWithError.ts # → Find caller # → Find caller's caller # 3. Check recent changes git log --oneline --all -- src/fileWithError.ts | head -5 # 4. Reproduce # Look for test that exercises this path
bash# 1. Find similar features grep -r "similarFeature" --include="*.ts" -l # 2. Study the pattern cat src/features/similar/index.ts # 3. Identify all touchpoints grep -r "similarFeature" --include="*.ts" | grep -v "def\|export" | cut -d: -f1 | sort -u # 4. Note conventions # - How are routes registered? # - How are tests structured? # - What validation is used?
bash# 1. Understand the change git diff main...feature-branch --stat # 2. Read modified files in dependency order # (models → services → handlers → tests) # 3. Check for missing pieces # - Are there tests? # - Is there error handling? # - Are types defined? # 4. Verify assumptions # - Does this break existing code? # - Are there migration concerns? # 5. Review with delta (if available) git diff main...feature-branch | delta # Syntax-highlighted diff delta --side-by-side main...feature-branch # Side-by-side view
bash# Find function definitions grep -r "function name\|const name\|async function name" --include="*.ts" # Find all imports of a module grep -r "from.*module-name" --include="*.ts" # Find where a variable is used (excluding definition) grep -r "varName" --include="*.ts" | grep -v "const\|let\|var\|import" # Find exported items grep -r "^export" --include="*.ts" src/some-module/ # Find TODO/FIXME comments grep -r "TODO\|FIXME\|XXX\|HACK" --include="*.ts" src/
bash# Find function definitions rg '(function|const|async function) name' -t ts # Find all imports of a module rg 'from.*module-name' -t ts # Find exported items rg '^export' -t ts src/some-module/ # Find TODO/FIXME comments rg 'TODO|FIXME|XXX|HACK' -t ts src/
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 4,212 | 4,570 | +8% | 1 | 1 | 0% | 498 | 3,844 | +672% | 0 | 0 | — |
case-02 | pass→fail | 32,477 | 3,761 | -88% | 1 | 1 | 0% | 2,822 | 3,674 | +30% | 0 | 0 | — |
case-03 | fail→fail | 17,827 | 20,021 | +12% | 1 | 1 | 0% | 1,706 | 5,225 | +206% | 0 | 0 | — |
case-04 | pass→pass | 8,281 | 5,181 | -37% | 1 | 1 | 0% | 1,733 | 4,624 | +167% | 0 | 0 | — |
case-05 | pass→pass | 6,792 | 3,515 | -48% | 1 | 1 | 0% | 1,421 | 4,222 | +197% | 0 | 0 | — |
case-06 | pass→pass | 6,113 | 3,430 | -44% | 1 | 1 | 0% | 1,178 | 4,167 | +254% | 0 | 0 | — |
case-07 | pass→pass | 7,871 | 2,881 | -63% | 1 | 1 | 0% | 1,616 | 4,042 | +150% | 0 | 0 | — |
case-08 | pass→pass | 7,336 | 3,434 | -53% | 1 | 1 | 0% | 1,227 | 4,231 | +245% | 0 | 0 | — |
case-09 | pass→pass | 4,120 | 2,225 | -46% | 1 | 1 | 0% | 868 | 3,867 | +346% | 0 | 0 | — |
case-10 | pass→pass | 7,151 | 4,975 | -30% | 1 | 1 | 0% | 1,465 | 4,602 | +214% | 0 | 0 | — |
case-11 | pass→pass | 15,715 | 11,749 | -25% | 1 | 1 | 0% | 3,356 | 5,941 | +77% | 0 | 0 | — |
case-12 | fail→pass | 8,226 | 4,276 | -48% | 1 | 1 | 0% | 1,733 | 4,403 | +154% | 0 | 0 | — |
case-13 | pass→pass | 4,627 | 2,169 | -53% | 1 | 1 | 0% | 1,032 | 3,949 | +283% | 0 | 0 | — |
case-14 | pass→pass | 4,727 | 3,892 | -18% | 1 | 1 | 0% | 965 | 3,982 | +313% | 0 | 0 | — |
case-15 | pass→pass | 5,317 | 4,054 | -24% | 1 | 1 | 0% | 1,125 | 4,065 | +261% | 0 | 0 | — |
case-21 | pass→pass | 6,500 | 13,579 | +109% | 1 | 1 | 0% | 1,375 | 6,101 | +344% | 0 | 0 | — |
case-16 | fail→pass | 6,467 | 2,731 | -58% | 1 | 1 | 0% | 1,316 | 4,055 | +208% | 0 | 0 | — |
case-17 | pass→pass | 11,099 | 9,205 | -17% | 1 | 1 | 0% | 2,060 | 5,339 | +159% | 0 | 0 | — |
case-18 | pass→pass | 14,914 | 6,286 | -58% | 1 | 1 | 0% | 2,618 | 4,690 | +79% | 0 | 0 | — |
case-19 | pass→pass | 8,417 | 5,729 | -32% | 1 | 1 | 0% | 1,598 | 4,557 | +185% | 0 | 0 | — |
case-20 | pass→fail | 11,137 | 4,239 | -62% | 1 | 1 | 0% | 2,701 | 3,689 | +37% | 0 | 0 | — |
case-22 | pass→fail | 11,706 | 5,109 | -56% | 1 | 1 | 0% | 2,738 | 3,691 | +35% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -5 percentage points is the difference between those two pass rates over the 19 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.