$ recombobulate _
home / tips / use-compact-test-output-for-faster-feedback
0

Use Compact Test Output for Faster Feedback

bagwaa @bagwaa · Mar 9, 2026 · Performance
use-compact-test-output-for-faster-feedback

When running tests in Claude Code, always use the --compact flag:

php artisan test --compact

This gives clean, single-line output per test:

..............................................

Tests:    46 passed (89 assertions)
Duration: 1.23s

Compare with the default verbose output which takes up far more context window space — and gives Claude a lot of noise to wade through when reading results.

For targeted testing, combine with --filter:

# Run a specific test file
php artisan test --compact tests/Feature/Voting/VoteTest.php

# Run tests matching a name pattern
php artisan test --compact --filter="user can upvote"

# Run a specific test directory
php artisan test --compact tests/Feature/Models/

Add this to your CLAUDE.md so Claude always uses it:

## Testing
- `php artisan test --compact` — run all tests
- `php artisan test --compact --filter=TestName` — run specific test

Compact output keeps Claude's context focused on what matters — failures, not noise.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Filter Test Output with a PreToolUse Hook to Cut Token Costs

A PreToolUse hook can intercept test runner commands and filter output to show only failures, cutting thousands of tokens from Claude's context.

bagwaa @bagwaa · 3 hours ago
0
Move Specialised CLAUDE.md Instructions into Skills to Shrink Context

CLAUDE.md loads into every message. Move workflow-specific instructions into skills that load on demand to reduce token costs across your session.

bagwaa @bagwaa · 3 hours ago
0
Use prompt.id to Trace All Activity from a Single User Prompt

Every event emitted while processing a single prompt shares a prompt.id UUID, letting you trace the complete chain of API calls and tool executions.

bagwaa @bagwaa · 3 hours ago