I've been working with different languages and frameworks for years, and there's one thing that has always bothered me a little: how much unnecessary output our development tools produce.

Run a test suite, build a project, install dependencies, or execute a CI job, and you're often greeted with hundreds of lines of output.

Most of the time, I don't actually need any of it.

If everything passes, a simple confirmation would be enough. If something fails, I want to see what went wrong without scrolling through an entire terminal session.

So I decided to build something small to deal with this.

It's called Muffle.

The idea

Muffle is a lightweight CLI written in C++17. It runs another command, captures its output, and only shows you what matters.

For example, instead of running:

npm test 

You run:

muffle -- npm test 

If the tests pass, you'll get something like:

muffle: passed (2.31s) 

That's it.

No unnecessary logs, no scrolling, and no wall of successful test results.

But if the command fails, Muffle displays the last 40 lines of output by default, along with the exit code and the location of the complete log.

For example, this deliberately failing command:

muffle --tail 2 -- sh -c \ 'echo "Preparing tests"; echo "Test failed"; exit 42' 

Produces output similar to:

muffle: failed (exit 42, 0.01s) Preparing tests Test failed Log: /tmp/muffle-XXXXXX 

The actual log filename is generated automatically.

You can change how many lines you want to see:

muffle --tail 100 -- npm test 

Or, if you need to see everything while the command runs:

muffle --verbose -- npm test 

There's also an option to keep the complete output in a specific file:

muffle --log build.log -- npm run build 

Muffle won't overwrite an existing log file.

Why C++?

Honestly, I wanted to build something small in C++.

A command-line wrapper like this seemed like a good fit because I could work directly with operating-system process APIs without bringing in a large framework.

The implementation uses POSIX APIs including:

  • fork() to create a child process.
  • execvp() to execute the requested command.
  • pipe() and dup2() to capture stdout and stderr.
  • waitpid() to retrieve the child's exit status.

The output is written to a temporary file rather than being accumulated indefinitely in memory.

On failure, Muffle reads the end of that log to display the requested number of lines.

The executable has no third-party C++ runtime dependencies, and the project uses CMake for building.

I also wanted to keep the implementation understandable. There's no plugin system, configuration language, or AI integration hiding behind what should be a simple command.

One detail I didn't want to compromise on

Exit codes.

If I wrap a command with Muffle, I expect my shell scripts and CI pipelines to behave as they would without it.

If a command returns 42, Muffle should return 42.

If a command exits successfully, Muffle should return 0.

That sounds obvious, but it's an important part of making a command wrapper useful beyond an interactive terminal.

Muffle also forwards SIGINT and SIGTERM to the child process group while it's running.

There are still limitations, particularly around unusual process trees and interactive commands, but I wanted to get these fundamentals right before adding anything else.

What about AI coding tools?

This is another reason I find the idea interesting.

I've been using tools such as Codex and Claude Code in my development workflow.

When an agent runs a command, the output can become part of the context it has to process.

A successful build that prints hundreds of routine lines isn't necessarily providing much useful information.

Wrapping that command with Muffle can produce something considerably smaller.

muffle -- cmake --build build 

Or:

muffle -- ./vendor/bin/phpunit 

There are potentially useful applications here for agentic development workflows.

I'm not claiming any specific token savings or performance improvements yet. That would require proper measurements across representative workloads.

For now, it's simply a way to reduce routine command output without losing access to the logs when something goes wrong.

Getting started

Muffle currently targets macOS and Linux.

It's still early in development, and I'm working toward the first packaged release. For now, you can build it from source.

You'll need CMake 3.20 or newer and a C++17 compiler.

git clone https://github.com/Thavarshan/muffle.git cd muffle cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build 

Then try:

./build/muffle -- echo "Hello from Muffle" 

You should see a short success message rather than the command's normal output.

I've also included a small demonstration script:

bash scripts/demo.sh 

It demonstrates successful and failing commands, checks that the exit code is preserved, and cleans up its temporary logs.

What I learned building it

Something that initially looks as simple as executing a command and capturing its output becomes a little more interesting when you consider the edge cases.

What happens if the executable doesn't exist?

What if the output is enormous?

What if the process receives SIGTERM?

What if the log destination already exists?

What if the command fails halfway through writing output?

Those are the kinds of details I've been spending time on.

The repository includes unit and integration tests, strict compiler warnings, clang-format, clang-tidy, sanitizer builds, and GitHub Actions checks for Linux and macOS.

It's probably more infrastructure than most people would expect around a tiny CLI, but I wanted the project to have a solid foundation.

Is this a completely new idea?

No.

Tools such as chronic and failprint already address similar problems.

I don't think every open-source project needs to invent an entirely new category of software.

Sometimes it's worth building a different implementation of a familiar idea, with a slightly different set of priorities.

For Muffle, those priorities are a small native executable, straightforward behavior, useful failure output, and logs that remain available for debugging.

What's next?

There are still things I want to improve.

The immediate priorities are finishing the first release, making installation easier through Homebrew and Linux packages, expanding edge-case testing, and getting feedback from developers who might actually use it.

I'm intentionally trying to avoid turning this into a complicated tool.

I'd rather have something small that does one job reliably.

Give it a try

The project is open source under the MIT license.

GitHub: https://github.com/Thavarshan/muffle

If you work with noisy test suites, builds, or CI pipelines, I'd be interested to hear whether something like this would fit into your workflow.

I'd also appreciate feedback on the implementation, particularly from developers familiar with C++, POSIX process handling, and terminal tooling.

And if you find the project useful, consider giving it a star on GitHub. It would help a new open-source project get some visibility.

Thanks for reading!

Muffle — Less noise. More signal.