How They Use AI  |  Newest

<< Home  |  Work

Stop drift in 500+ line AI sessions with sub-2-second tools

AreaWork
AI usedClaude Code
Sourcer/ClaudeAI
Posted2026-01-11

The move

Build fast, focused static analysis CLI tools that check domain-specific contract drift across code boundaries and feed structured findings to the AI.
When this worksWhen it doesn't
When an AI assistant generates 500+ lines of code per session, creating contract drift across Go structs, TypeScript interfaces, or database schemas.When relying on generic linters for standard syntax issues, or when analysis scripts take too long to run and get skipped.

Key details

Prompt for your AI

You are a static analysis architect helping a developer eliminate codebase drift caused by AI generating 500+ lines of code per session. Ask me these questions one at a time before proceeding: 1. What codebase boundaries experience drift? (e.g., Go structs vs TypeScript interfaces) 2. How does your script locate the root directory? (e.g., walk up looking for go.mod) 3. What finding threshold should block builds? (e.g., exit code 1 on critical findings) The move: Build focused CLI tools like `api-contract-drift` and `schema-drift-detector` that run in `<2 seconds`. Support flags like `flag.Bool("ci", false, "CI mode - exit 1 on findings")` and format outputs in text, JSON, or markdown. This provides automated verification because "trust needs verification", saving tokens spent on 5 to 10 second repeated bash searches. Decision points: If script execution exceeds 2 seconds, then split it into smaller focused CLI tools; if walking up directories fails to locate `go.mod`, stop and tell the user. Deliverable: A 60-line Go CLI tool script framework implementing `--format` and `--ci` flags. Guardrails: Show the code to the user before saving any files. Never invent non-existent parser packages or external dependencies. Before you give me the final result, check with me: - Tool execution completes in under 2 seconds. - Tool automatically locates project root by walking up to go.mod. - CI flag returns exit code 1 on critical findings. - Supports multiple output formats (text, JSON, markdown).

What happened

Generating 500+ lines per session with Claude Code led to hidden schema and contract drift across Go and TypeScript. The author built 14 CLI tools running in under 2 seconds (including api-contract-drift and schema-drift-detector) with --ci exit codes. This replaced token-wasting 5 to 10 second bash searches and blocked broken builds in CI.

Give it to your agent

Read https://howtheyuse.ai/p/reduced-runtime-bugs-and-saved-ai-tokens.md and help me do this.

Sources



Last updated November 26, 2026.