Efficient Prime
A command template for utilities workflows. Streamlines development with pre-configured patterns and best practices.
Efficient Prime
Prime Claude's context with your project's codebase structure, key files, and recent changes so it can work more effectively on all subsequent tasks in the session.
When to Use This Command
Run this command when...
- You are starting a new Claude Code session and want maximum effectiveness from the first prompt
- Your project is large and Claude needs to understand the directory layout and key entry points
- You want Claude to be aware of recent git changes that affect the current work
Avoid this command when...
- You have already loaded context through other means earlier in this session
- You are working on an isolated file that has no project-level dependencies
Quick Start
# .claude/commands/efficient-prime.md --- allowed-tools: ["Bash", "Read", "Glob", "Grep"] --- Read project structure, key configuration files, and recent git history. Build a mental model of the codebase for subsequent tasks.
Example usage:
/efficient-prime
Example output:
Priming Complete
================
Project: e-commerce-api (Node.js + Express + PostgreSQL)
Key Files:
- src/server.ts (entry point)
- src/routes/index.ts (route registry)
- prisma/schema.prisma (database schema)
Recent Changes (last 5 commits):
- Add pagination to product listing
- Fix cart total calculation
- Update Prisma to v5.8
Active Branch: feature/order-history
Ahead of main by: 3 commits
Ready for your next task.
Core Concepts
| Concept | Description |
|---|---|
| Structure scan | Maps the directory tree and identifies key entry points |
| Config parsing | Reads package.json, tsconfig, .env.example for tech stack info |
| Git awareness | Loads recent commits, current branch, and uncommitted diff summary |
| Entry point detection | Finds main files, route registries, and database schemas |
Project Root --> List Structure --> Identify Key Files
|
Read Configurations
|
Load Git Context
|
Primed & Ready
Configuration
| Option | Default | Description |
|---|---|---|
depth | 3 | Directory tree depth to scan |
history | 5 | Number of recent commits to include |
include-diff | true | Include a summary of current uncommitted changes |
key-files | auto | Override auto-detected key files with explicit paths |
verbose | false | Show every file scanned during priming |
Best Practices
- Prime once per session -- repeated priming wastes tokens without adding new information.
- Customize key files -- if auto-detection misses important files, list them explicitly.
- Include recent history -- recent commits help Claude understand what work is actively in progress.
- Use before complex tasks -- priming pays off most for multi-file changes and large refactors.
- Combine with CLAUDE.md -- priming automatically reads CLAUDE.md if present, so keep it current.
Common Issues
- Priming takes too long -- reduce depth and history count for very large monorepos.
- Key files missed -- add them to the key-files config list or mention them in CLAUDE.md.
- Token limit reached -- very large projects may exceed context limits. Reduce scan depth or exclude large generated directories.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.