← Journal
7 min readAI Dev Review

Feeding a monorepo to an AI agent without going broke

Naive context loading in a monorepo will blow your token bill. Here's the strategy we use.

MonoreposBest Practices

Every AI tool struggles at monorepo scale — either the agent misses obvious context or you pay for embeddings you'll never use. A few boring rules keep costs sane and quality high.

The rules

  • Root-level AGENT.md pointing to package-level READMEs. Never let the agent guess repo layout.
  • Per-package .aiignore that hides fixtures, snapshots, and generated code.
  • Explicit 'read only these paths' in the prompt for cross-package changes.

The savings

Same 30 tasks, same tool, disciplined context: 42% cheaper and measurably higher quality. The upfront hour of setup paid for itself the first day.

Comments

0 replies

Join the conversation

Sign in to leave a comment on "Feeding a monorepo to an AI agent without going broke".

Loading comments…