Setup
Context intelligence activates automatically when Pilot detects a .agent/ directory in your project.
Since v0.33.16, Pilot auto-initializes the .agent/ directory on first task execution — no manual setup required.
For most projects, context intelligence works out of the box. Pilot creates the .agent/
directory automatically when it runs its first task. Manual setup is only needed for
customizing the documentation structure.
Prerequisites
- Pilot installed and configured (
pilot doctorpasses) - Claude Code (or Qwen Code / OpenCode) installed
- A project repository with at least one commit
Auto-Initialization (Default)
When Pilot executes its first task in a project, it automatically creates the .agent/ directory
with a default DEVELOPMENT-README.md. This is sufficient for most projects.
# Just run a task — .agent/ is created automatically
pilot task "Add health check endpoint"The auto-generated index includes your project structure, detected framework, and component status.
What Gets Created
Auto-init creates the full Navigator directory structure:
.agent/
├── DEVELOPMENT-README.md # Project-specific navigator guide
├── .nav-config.json # Navigator configuration
├── .gitignore # Excludes session-specific files
├── tasks/ # Implementation plans
├── system/ # Architecture docs
└── sops/ # Standard operating procedures
├── integrations/
├── debugging/
├── development/
└── deployment/Tech Stack Detection
Pilot auto-detects your technology stack from project files:
| File | Detected Stack |
|---|---|
go.mod | Go + detected frameworks (Gin, Gorilla, Fiber) + ORMs (GORM) |
package.json | Node.js + frameworks (Next.js, React, Vue, Express) + TypeScript |
pyproject.toml | Python + frameworks (FastAPI, Django, Flask) |
Cargo.toml | Rust + frameworks (Actix, Axum) |
| (none found) | Uses directory name as project identifier |
Template Variables
Templates use these placeholders, automatically replaced during initialization:
| Variable | Value |
|---|---|
${PROJECT_NAME} | Detected project name (Title Case) |
${project_name} | Lowercase project name with hyphens |
${TECH_STACK} | Detected technology stack string |
${DATE} | Current date (YYYY-MM-DD) |
${YEAR} | Current year |
Auto-Init Configuration
Configure auto-initialization in your Pilot config:
# ~/.pilot/config.yaml
executor:
navigator:
auto_init: true # Enable auto-init (default: true)
templates_path: "/custom/path" # Override template location (optional)Auto-init is enabled by default. If you manage .agent/ manually or use a custom Navigator setup, disable it with auto_init: false.
Custom Templates
If templates_path is set, Pilot uses templates from that directory instead of built-in ones.
This is useful for organizations that want standardized Navigator setup across all projects.
Custom Setup
For projects that need a tailored context structure, initialize manually:
Create the directory structure
mkdir -p .agent/system .agent/tasks .agent/memories .agent/sops .agent/.context-markersThis creates the standard layout:
.agent/
├── DEVELOPMENT-README.md # Index document (loaded every session)
├── system/ # Architecture and system docs
│ ├── ARCHITECTURE.md # System design, data flow
│ ├── FEATURE-MATRIX.md # What's implemented vs planned
│ └── PR-CHECKLIST.md # Pre-merge verification
├── tasks/ # Task implementation plans
│ └── archive/ # Completed task docs
├── memories/ # Knowledge graph entries
├── sops/ # Standard Operating Procedures
└── .context-markers/ # Session save pointsWrite the index document
Create .agent/DEVELOPMENT-README.md — this is the only file loaded at session
start. Keep it under 500 words (~2k tokens).
# Project Name — Development Context
## Quick Navigation
| Document | When to Read |
|----------|-------------|
| This file | Every session (auto-loaded) |
| `system/ARCHITECTURE.md` | System design, data flow |
| `system/FEATURE-MATRIX.md` | What's implemented vs not |
| `tasks/TASK-XX.md` | Active task details |
## Current State
**Version:** v1.0.0
### Key Components
| Component | Status | Notes |
|-----------|--------|-------|
| API Server | Working | Express + TypeScript |
| Database | Working | PostgreSQL + Prisma |
| Auth | In Progress | JWT-based |
## Project Structure
\`\`\`
project/
├── src/
│ ├── api/ # Route handlers
│ ├── services/ # Business logic
│ └── models/ # Database models
├── tests/
└── .agent/ # Context docs
\`\`\`
## Active Work
_See GitHub Issues with `pilot` label for current queue._Configure CLAUDE.md
Add context intelligence instructions to your project’s CLAUDE.md:
## Context Intelligence
This project uses structured context management.
Documentation lives in `.agent/`.
### Quick Commands
- `/nav-start` — Start or resume context session
- `/nav-task "description"` — Plan a new task
- `/nav-compact` — Clear context when done with a taskVerify the setup
Run Pilot to confirm detection:
pilot task --dry-run "Test context detection"The output should include:
🧭 Context: ✓ detected (.agent/ exists)If you see ⚠️ Context: not found, check that .agent/DEVELOPMENT-README.md exists.
Directory Reference
DEVELOPMENT-README.md (Required)
The index document. Loaded every session. Contains:
- Quick navigation table linking to other docs
- Current project state and version
- Key component status
- Project structure overview
- Active work references
Target size: Under 500 words (~2,000 tokens).
system/ (Recommended)
Architecture and system-level documentation:
| File | Purpose |
|---|---|
ARCHITECTURE.md | System design, data flow, package map |
FEATURE-MATRIX.md | Implementation status of all features |
PR-CHECKLIST.md | Pre-merge verification steps |
These are loaded on demand when tasks touch architecture.
tasks/ (Recommended)
Task implementation plans created by /nav-task. Each task gets a markdown file with:
- Requirements analysis
- Implementation steps
- Affected files
- Test plan
- Post-completion archive with learnings
Completed tasks move to tasks/archive/.
memories/ (Optional)
Knowledge graph entries — decisions, patterns, and pitfalls captured during development. The context engine creates and queries these automatically.
sops/ (Optional)
Standard Operating Procedures for recurring workflows:
- Release process
- Integration testing
- Deployment steps
.context-markers/ (Auto-managed)
Session save points created by the context engine. Do not manually edit these files.
Format: YYYY-MM-DD-HHMM_description.md
.nav-config.json (Optional)
Context engine configuration overrides:
{
"version": "6.1.0",
"features": {
"knowledge_graph": true,
"user_profile": true,
"loop_mode": true
}
}.user-profile.json (Auto-managed)
User preferences learned by the bilateral modeling system:
{
"verbosity": "concise",
"confirmation_threshold": "low",
"framework_preferences": ["Go", "TypeScript"],
"correction_patterns": []
}Configuration in config.yaml
Enable context intelligence per project in your Pilot configuration:
# ~/.pilot/config.yaml
projects:
- name: "my-project"
path: "/path/to/project"
navigator: true # Pilot checks for .agent/ before each taskWhen navigator: true, Pilot will activate context intelligence
if .agent/ exists in the project path.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
Context: not found in output | Missing .agent/ directory | Run mkdir -p .agent and create index |
| Context engine loads but burns tokens | Index document too large | Keep DEVELOPMENT-README.md under 500 words |
| Knowledge graph empty | No memories captured yet | Memories accumulate automatically over tasks |
| Context markers missing | First session | Markers created when using /nav-marker or /nav-compact |
| Phase progress stuck | Context signals not detected | Verify execution backend is configured correctly |