﻿# Give Codex dependency evidence instead of a whole repository dump

Give Codex precise dependency context using manifests, lockfiles, call sites and generated-source relationships instead of copying an entire repository into a prompt.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/learn-codex-dependency-context/
Language: en

A whole-repository dump can contain more text while providing less direction than a few connected artifacts. Codex can inspect files progressively, and IDE context can include open files and selections. A useful starting packet identifies the changed interface, its source of truth and the consumers that make compatibility meaningful.

## Begin with the authoritative definition

Suppose a task changes a generated API client. The generator’s schema is often a more useful starting point than the generated file alone. Identify where the definition lives and how generation is invoked. This prevents an apparently successful local edit that is overwritten by the next build. The task can then explain whether the intended change belongs to the schema, the generator or handwritten integration code.

## Use manifests and lockfiles for different questions

A manifest describes declared dependencies and scripts; a lockfile records resolved dependency information for the package manager’s workflow. Read the material that answers the current question. If a script is missing, the manifest is relevant. If two environments resolve different transitive packages, the lockfile relationship becomes important. Neither artifact alone proves that a running process loaded the expected dependency from the expected location.

## Follow the interface into its consumers

A type change matters through the code that constructs or reads the affected value. Search for representative call sites and inspect how they handle the old contract. For an optional response field, a caller that assumes a value exists may reveal the actual compatibility issue. This gives the agent a behavioral path to reason about instead of a disconnected collection of similarly named files.

## Distinguish available context from inspected evidence

An IDE may provide a selected file or open editor context, but the final explanation should be based on what the agent actually inspected. A relevant dependency can sit outside the currently open tabs. The task should permit focused follow-up reads and preserve the resulting references. A concise input packet is a starting map, not an assertion that no other file can influence the change.

## Validate the boundary the evidence revealed

Once the schema, generated client and consumer are connected, choose a check that exercises their relationship. A generation check can establish whether output matches the definition, while a consumer test checks behavior with the changed field. Report these conclusions separately. The resulting patch explanation is small because the dependency path is explicit, rather than because the agent ignored everything beyond the first file it received.

## Documentation and further study

- [Codex IDE extension](https://learn.chatgpt.com/docs/codex/ide).

- [Codex as a platform: build on the open agent harness](https://developers.openai.com/blog/codex-as-a-platform).

- [Codex App Server](https://learn.chatgpt.com/docs/app-server).

Related engineering guides: [Reproducible inference stacks: preserving a GPU pilot’s result](/journal/software-stack-reproducibility/); [Choose a local AI stack: desktop chat, shared UI or coding agent](/journal/local-ai-app-stack-selection/).
