The problem Teams building AI‑augmented codebases spend hours grepping for LLM calls, manually tracing branches, and rebuilding mental models after every prompt change. Codag automates that tracing: it extracts the full workflow, renders an interactive graph inside VS Code, and highlights which functions changed when files are edited.
What this does Codag analyses the codebase and produces a live, clickable DAG of every LLM call, decision branch, and data transformation. Key capabilities, grounded in the code, include:
- Automatic workflow detection – tree‑sitter parsers scan 78 source files (70 TypeScript, 7 Python) and resolve 222 import edges, surfacing LLM calls from OpenAI, Anthropic, Gemini, LangChain, etc. The detection logic lives in
frontend/src/tree-sitter/extractors.tsandfrontend/src/analysis/workspace.ts. - Live graph updates – editing a file triggers an incremental re‑analysis; changed functions receive a green highlight. The update pathway runs through
frontend/src/webview.ts→postMessage→state.ts. - Click‑to‑source navigation – each graph node links to the exact function and line. The navigation mesh is built in
frontend/src/webview-client/state.ts(27 functions, called from 9 other files) andfrontend/src/webview-client/messages.ts(1 → 16 edges). - Export to PNG – the graph can be exported as a high‑resolution PNG via
frontend/src/webview-client/export.ts. - Native theme support – graphs automatically adopt the VS Code light/dark theme, using styles defined in
frontend/media/webview/styles.css.
How it is wired Execution starts at two entry points:
| Entry point | File | Reaches |
|---|---|---|
init | frontend/src/tree-sitter/parser-manager.ts:75 | 50 functions; called from 2 places |
scheduleFileAnalysis | frontend/src/file-watching/handler.ts:47 | 6 functions; called from 1 place |
The internal call graph contains 748 resolved call edges. Notable hubs and cycles:
- Hub module –
frontend/src/webview-client/state.tsis depended on by 17 modules; any change has a broad blast radius. - Import cycles – four modules form circular dependencies:
frontend/src/call-graph-extractor.ts,frontend/src/tree-sitter/extractors.ts,frontend/src/webview-client/directory.ts, andfrontend/src/webview-client/visibility.ts. - Most connected functions –
postMessage(34 callers),toRelativePath(20),log(16),estimateTokens(10).
Paths that leave the process: init → show → getHtml reads the filesystem via fs.readFileSync; outbound network calls are limited to 4 functions that make HTTP requests from backend/main.py.
How to use it The repository does not ship a documented start‑up script, but the presence of the following files gives a practical pathway:
- Clone the repository: ``
bash git clone https://github.com/moses-y/codag`` - Install dependencies (npm‑based front‑end, Python back‑end): ``
bash cd codag/frontend && npm install cd ../backend && python -m pip install -r requirements.txt`` - Build / run the extension – the VS Code extension is packaged from
frontend/. Typical commands (inferred frompackage.jsonscripts) arenpm run compileandnpm run watch, or load the extension folder directly into VS Code for development. - Start the backend server – run
python backend/main.py(the entry point listed in the analysis) or use the provided Dockerfile:docker compose up --build. - Open VS Code and enable the Codag extension; the graph appears in the side panel and updates as you edit files.
If the README or package.json scripts differ, consult those files for the exact commands.
Real‑world use A developer joins a LangChain project with 20 files and nested tool calls. After opening the codebase in VS Code and activating Codag, the extension instantly maps every LLM call, decision branch, and data transformation. The graph highlights the exact function that failed after a prompt tweak, and a click jumps to the source line. The team exports a PNG for documentation and watches the graph update in real‑time as they refactor.
Code health & issues (measured static‑analysis findings)
- [HIGH] Add a test suite – 78 source files, no test files exist. Any change ships with no regression signal.
- [HIGH] Add a CI/CD workflow – no
.github/CI config; every merge runs untested. - [HIGH] Build gate for Docker image –
backend/Dockerfilehas no automated build validation. - [HIGH] Replace wildcard CORS origin –
backend/main.pysetsallow_origins=["*"]with credentials enabled, a security risk. - [MEDIUM] Enable Dependabot/Renovate – 3 manifest files, no update bot configured.
- [MEDIUM] Pin container base image by digest –
backend/Dockerfileusespython:3.11-slimwithout a digest. - [MEDIUM] Move large binaries out of repo –
media/demo.gifis 21.5 MB; every clone pays that cost. - [MEDIUM] Add timeout to outbound requests –
backend/Dockerfilehas no timeout on the single outbound call. - [MEDIUM] Add non‑root USER to Docker image – container runs as root; no
USERdirective. - [LOW] Add convention files – missing
.editorconfig,.gitattributes, formatter config.
The bottom line Codag provides a powerful, in‑VS‑Code view of AI/LLM workflows with minimal configuration, making it easy to trace and visualise complex pipelines. The codebase suffers from a lack of tests, CI, and several security / maintenance gaps that should be addressed before production use, especially the CORS wildcard and missing test coverage. It is well‑suited for AI engineers and agent builders who need rapid insight into code‑level LLM interactions, provided the hygiene items are resolved.