codecontext learn
Ask questions about your codebase in natural language
The learn
command lets you ask questions about your codebase and get intelligent answers. It understands your code structure, patterns, and relationships to provide accurate, context-aware responses.
Natural Language
Ask questions the way you think, get answers that make sense
Deep Understanding
Analyzes code relationships and dependencies
Code References
Provides specific file and line references in answers
$ codecontext learn "how does the authentication flow work?"
Interactive Demo
Example Questions
Architecture & Design
"What's the overall architecture?"
"How is the database structured?"
"What design patterns are used?"
Features & Functionality
"How does user registration work?"
"Where is email sending handled?"
"What APIs are exposed?"
Dependencies & Integration
"What external services are used?"
"How is Redis integrated?"
"Which payment processor is used?"
Code Organization
"Where are utility functions?"
"How are routes organized?"
"What's the folder structure for?"
Options
--code, -c
Include code snippets in the answer
$ codecontext learn "how to validate user input?" --code
--depth, -d
Set analysis depth (shallow, normal, deep)
$ codecontext learn "explain the data flow" --depth deep
How It Works
Parse Question
Understands your natural language query and intent
Search Codebase
Finds relevant files, functions, and patterns
Analyze Context
Understands relationships and dependencies
Generate Answer
Provides clear explanation with file references
Usage Limits
Daily Question Limits
Check your usage with codecontext status
Pro Features
Advanced Learning Capabilities
Pro users get enhanced learning features:
- • Cross-repository knowledge (answer questions across all your repos)
- • Team knowledge sharing (learn from team's questions)
- • Visual diagrams for architecture questions
- • Export answers to documentation
- • Follow-up questions and conversations
Tips for Better Answers
Be specific
Instead of "how does it work?", ask "how does user authentication work?"
Ask about relationships
Questions like "how does X interact with Y?" get detailed flow explanations
Use domain terms
If your code uses specific terms (e.g., "workflow", "pipeline"), use them in questions
See Also
- codecontext how - Get implementation guidance
- codecontext context - Manage codebase understanding
- How AI Understands Code - Learn how CodeContext analyzes your codebase