Context Awareness

How CodeMap builds and maintains a deep understanding of your codebase to provide intelligent assistance

The Knowledge Graph

At the heart of context awareness is CodeMap's knowledge graph - a live representation of your code that tracks:

  • File relationships - Import/export connections between modules
  • Symbol definitions - Functions, classes, interfaces, and their locations
  • Symbol call graph - Which functions call which, tracked across file boundaries
  • Dependency chains - Who imports what, creating a navigable dependency tree
  • Code structure - File hierarchy, symbol nesting, and organizational patterns

Building Context: The Orient Tool

The orient tool is your entry point to understanding a project. It scans the codebase and provides:

  • Project statistics (file count, symbol count, dependency count, symbol graph edge count)
  • Technology stack detection (frameworks, languages, build tools)
  • Key architectural patterns
  • Session memory from previous work

When to use: Start of every session, when joining a new project, or after major structural changes.

Symbol Targeting

Many CodeMap tools accept a symbol reference in addition to a file path. The format is relativePath$symbolName — for example src/services/UserService.ts$deleteUser. This lets you scope any supported operation to a single symbol rather than the entire file:

  • Readcodemap_read_file returns just that symbol's source
  • Editcodemap_replace_text, codemap_write, codemap_delete operate only within that symbol's line range
  • Inspectcodemap_get_dependencies returns the symbol's calls and calledBy instead of file-level imports
  • Blast radiuscodemap_impact_analysis traverses the symbol call graph to show what transitively calls it

The Peek Tool: Always-On Call Graph

codemap_peek is the fastest way to build deep context on a file. Unlike a directory listing, peek always returns every symbol with its full call graph data — no flags needed:

  • All imports and importers
  • Every symbol with calls (what it invokes) and calledBy (what invokes it)
  • Groups and labels this file belongs to

Use peek before editing a file to understand its full blast radius before making changes.

# Get project orientation
codemap orient

# Orient to a specific directory
codemap orient --root /path/to/project
# Peek at a file — always returns all symbols with calls/calledBy
codemap peek src/services/UserService.ts

# Read a specific symbol's source
codemap read src/services/UserService.ts$deleteUser
💡Best Practice

Always run orient at the start of each session. It loads project memory and helps CodeMap understand recent changes since your last session.

ℹ️Symbol Reference Format

Use relativePath$symbolName to target a specific symbol — e.g. src/services/auth.ts$validateToken. This format is accepted by codemap_read_file, codemap_replace_text, codemap_write, codemap_delete, codemap_get_dependencies, codemap_impact_analysis, and more.

ℹ️Knowledge Graph Updates

The knowledge graph — including the symbol call graph — updates automatically as you work. When you create, modify, or delete files, CodeMap tracks these changes and adjusts the graph in real-time.