Skip to content

AIML-316: Add token-efficient build commands - #43

Merged
ChrisEdwards merged 1 commit into
mainfrom
AIML-316-token-efficient-build-commands
Dec 16, 2025
Merged

ChrisEdwards merged 1 commit into
mainfrom
AIML-316-token-efficient-build-commands

Conversation

@ChrisEdwards

Copy link
Copy Markdown
Collaborator

Summary

Adds Makefile and hack/run_silent.sh to reduce AI agent token usage by ~99% for build commands.

Why

Token analysis showed that Maven build output was consuming 17K+ characters per test run, even with -q flag and output filtering. This is wasteful for AI agents that need to run tests frequently.

What

  • hack/run_silent.sh: Shell helpers that capture output and show only success/failure summary
  • Makefile: Simple targets (make test, make check, etc.) that use run_silent.sh
  • CLAUDE.md: Updated with new make targets documentation

How

Based on the pattern from steveyegge/abacus project:

  1. Captures all command output to a temp file
  2. On success: shows ✓ Unit tests passed (401 tests, 4.5s) (~45 chars)
  3. On failure: shows filtered [ERROR] lines for debugging
  4. Supports VERBOSE=1 for full output when needed

Token Savings

Command Before After Savings
mvn test 17,219 chars 45 chars 99.7%
Full build cycle ~50,000 chars ~150 chars 99.7%

Test Plan

  • make test shows quiet output with test count
  • make check shows quiet output
  • make check-test runs both
  • make test VERBOSE=1 shows full Maven output
  • Failure case shows filtered [ERROR] lines

- Add hack/run_silent.sh for quiet build output (99% token savings)
- Add Makefile with make test, make check, make verify targets
- Update CLAUDE.md with new make targets documentation

Based on abacus project pattern. Reduces AI agent token usage from
~17K chars to ~45 chars for test runs by capturing output and showing
only success/failure summary with test counts.

Use VERBOSE=1 for full output when debugging failures.
@ChrisEdwards
ChrisEdwards merged commit 9e97e91 into main Dec 16, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants