Skip to content

Optimizing Claude Code

Learn how to integrate Forge with Anthropic's Claude Code CLI agent to manage repository tokens and optimize prompt structures.

Last updated: 16 Aug 2026Runtime Wrappers

Introduction to Claude Code Wrappers

Claude Code is an interactive command-line interface that allows Claude to write, search, and edit code. However, without context constraints, it can exhaust token limits quickly on larger repositories.

Forge provides a dedicated convenience wrapper for Claude Code. It intercepts runtime prompts, performs AST-level context filtering, and passes an optimized index structure to Claude.

How to Run

Instead of launching claude directly, prefix it with Forge:

forge claude

Under the Hood

  1. Ast Scanning: Scans directories and constructs an incremental code representation.
  2. Graph Filtering: Extracts key symbols based on your active files.
  3. Agent Launch: Launches Claude Code under an environment configured to feed AST queries through Forge's context pipeline.

Command Options

You can customize the wrapper execution using command-line arguments:

  • --prune-depth <n>: Restricts dependency crawler recursion levels.
  • --no-cache: Forces rebuilding of the symbol reference maps.
  • --ruleset <name>: Applies prompt optimization profiles (e.g. Minimal Build Mode / Concise Mode intensities).