⚒ ACG ⚒

ACG Optimization Services

Reducing waste, improving efficiency, and lowering the cost of AI-assisted software — for teams building and maintaining with AI agents.

Every token processed by an AI agent has a cost — in time, money, and cognitive overhead. A codebase that was built carelessly accumulates token waste the way a leaky building accumulates water damage: slowly, invisibly, and then all at once. The AI Craftspeople Guild offers optimization services to identify and eliminate that waste before it compounds.

Inspired by a chat with Thomas Frumkin

The Token Economy of a Codebase

When an AI agent reads your code, it processes tokens. Every file, every path, every identifier costs tokens.

A codebase optimized for human readability alone is not optimized for AI-assisted maintenance. The two concerns overlap significantly, but not completely. Guild optimization work targets the gap: places where your codebase imposes unnecessary token overhead on every AI interaction, every day, for the lifetime of the project.

Small changes compound. Eliminating waste early is dramatically cheaper than eliminating it later.

Optimization Areas

Naming Efficiency

Excessively long folder, file, and variable names inflate every token count in every context where those names appear. As an example, a folder named user-authentication-and-authorization-management-service would cost the AI more tokens that a folder named auth — and provides no additional clarity to either human or machine readers familiar with the codebase. We audit naming conventions and propose concise, unambiguous alternatives.

Comment and Documentation Hygiene

AI agents produce comments compulsively. Over time, a codebase fills with comments that restate what the code already says, describe decisions that have since changed, or document behavior that no longer exists. These are pure token overhead — loaded into context on every AI interaction without contributing useful information. We identify and remove comment noise while preserving genuinely valuable documentation.

Dead Code Elimination

AI agents leave scaffolding behind. Unused functions, unreachable branches, commented-out blocks, and orphaned modules accumulate silently. Each one is loaded into the AI's context window every time a related file is touched — consuming tokens, introducing confusion, and increasing the chance that the agent responds to stale information. We systematically locate and remove code that is no longer doing work.

File and Module Size Management

AI agents tend to append rather than reorganize. Large, monolithic files grow unboundedly as features accumulate. A 3,000-line file forces the AI to load and process far more context than a well-decomposed set of focused modules. We restructure oversized files into coherent, right-sized units that minimize the context required for any individual task.

Directory Structure Flattening

Deep, baroque directory trees impose path overhead on every file reference. They also obscure the logical structure of the system, forcing the AI agent to traverse more levels to understand what lives where. We analyze directory structures and propose flatter, more semantically clear layouts that reduce navigation cost and improve discoverability.

Dependency Trimming

Every dependency in a project file is context the AI must reason about. AI agents frequently suggest adding packages to solve problems that could be handled with a few lines of standard library code. We identify dependencies that can be removed or replaced, shrinking the dependency surface and reducing the cognitive load on both agents and human maintainers.

Configuration File Compaction

AI-generated configuration files are characteristically verbose: every default spelled out, every optional field included, comments explaining choices that are either obvious or obsolete. Configuration files are loaded frequently by AI agents assessing project settings. We compact configurations to carry only non-default, intentional settings — reducing token overhead and making intent immediately legible.

Duplicate Code Consolidation

AI agents solve the same problem multiple times without noticing they have already solved it. Near-duplicate functions, nearly identical test fixtures, and parallel implementations of the same logic proliferate across AI-assisted codebases. Each duplicate is redundant context. We identify and consolidate duplication into shared, well-named abstractions — reducing size, improving consistency, and making changes cheaper.

Test Suite Efficiency

AI agents write tests generously but not efficiently. Test files frequently contain repetitive setup, duplicated assertions, and fixtures that are loaded universally but used rarely. A bloated test suite slows CI, consumes unnecessary compute on every agent-assisted run, and buries genuine failures in noise. We restructure test suites for precision: less repetition, faster execution, clearer failure signals.

Prompt and System Message Optimization

If your system embeds AI agents with custom prompts or system messages, those prompts are processed on every invocation. Verbose, redundant, or poorly structured system prompts waste tokens on every call and can degrade model performance. We review and tighten agent configurations to reduce per-call overhead while preserving or improving behavioral clarity.

The Compounding Return on Optimization

Optimization work is not a one-time cost reduction. It is an investment that pays returns on every subsequent AI interaction with the codebase. A codebase that has been optimized for token efficiency will cost less to maintain, produce better AI suggestions, and accumulate new waste more slowly — because the habits and structures that create waste have been replaced with ones that resist it.

The earlier optimization happens in a project's life, the larger the compounding return. But it is never too late. Even a mature, heavily AI-assisted codebase carries waste that is worth eliminating.

Guild Principle

Waste is not neutral. Every unnecessary token is a tax on every future interaction with your codebase.

Craftsmanship in the age of AI is not just about what you build. It is about how efficiently your codebase can be read, understood, and maintained — by humans and agents alike.

Explore More Guild Services

Optimization removes waste. Auditing finds deeper structural and security problems.

Audit Services

Independent, candid review of AI-assisted codebases for correctness, security, and structural integrity.

Meet the Guild

The optimizers are practitioners. Get to know who would be working in your codebase.

Back to Home

Return to the AI Craftspeople Guild home page.