Examples

Practical use cases and examples showing how to use CodeBroker in everyday development scenarios.

1. Understanding Authentication Flow

When tasked with modifying the login logic, you need to know exactly which files touch the authentication provider and session handlers.

codebroker query "login handler flow"
✓ Found Entrypoint: src/api/auth.ts (loginHandler) → src/services/authProvider.ts → src/models/Session.ts Generated context capsule 'auth_flow.md' (2,104 tokens)

2. Impact Analysis

Before refactoring a widely used utility function, check the blast radius to see what will break.

codebroker impact src/utils/dateFormatter.ts:formatDate
Impact Analysis for formatDate: - Directly used in 14 files. - Transitive dependencies touch 3 React components. - Risk level: HIGH See full list in 'impact_report.md'

3. Generating LLM Context

Prepare a highly optimized context payload for an external LLM agent (like Claude or GPT-4) without relying on the MCP server.

Terminal
codebroker capsule create --query "database migration script" --out context.md

The resulting `context.md` will contain the exact implementations of your DB schema, migrations, and ORM config, tightly packed without any irrelevant UI components.