Invisible Wrapping
PTY proxy so wrapped processes behave identically. Colors, interactive prompts,
TUI apps — isatty() returns true, everything just works.
Transparent process wrapper that captures stdout, stderr, and stdin — with an MCP server so LLM agents can read your terminal output.
v1.0 · production ready Pair it with the agent skill for the best results.
Grab the prebuilt binary, or build from source with Cargo.
curl -fsSL https://raw.githubusercontent.com/urjitbhatia/brainlog/master/install.sh | sh
macOS & Linux, no Rust toolchain required. Linux builds are statically linked (musl).
cargo install --git https://github.com/urjitbhatia/brainlog
Compiles from source — requires a Rust toolchain.
Drop brainlog in front of any command and gain full observability with zero configuration.
PTY proxy so wrapped processes behave identically. Colors, interactive prompts,
TUI apps — isatty() returns true, everything just works.
Every byte of stdout, stderr, and stdin recorded with nanosecond timestamps in a compact framed binary format. Nothing is lost.
7 tools let LLM agents discover, read, search, and watch process output directly — no copy-pasting required.
Keep services alive with --restart, and resume named services
across sessions. Long-running processes made easy.
Hand a command to brainlog -D and get your shell back
instantly. A singleton daemon supervises detached wrappers, so
services outlive your terminal.
running means actually running. Records are
reconciled against live processes on every read, so a wrapper killed
by SIGKILL or lost with its terminal
self-heals to crashed instead of lingering
as a phantom service.
Instead of sleeping blindly and hoping a server is up,
wait_for_pattern
blocks until a regex appears in the process output — then returns
immediately. Like Playwright's waitForText,
but for any terminal process.
No polling loops. No arbitrary timeouts. No racing against a server that isn't ready yet. The agent proceeds with certainty.
Prefix any command with brainlog — the process runs exactly as before.
Brainlog speaks MCP — add it to any agent that supports the protocol.
One command — globally available across all projects:
Add to codex.json or your project config:
Add to .cursor/mcp.json in your project root:
Standard MCP server config — works with any MCP-compatible agent:
The MCP server gives your agent the tools. The skill teaches it when to reach for them. Together they are how agents get the most out of brainlog.
Connecting the MCP server alone leaves your agent guessing. The skill closes that gap — it
teaches the agent to check brainlog first when you say a build failed or a server is
crashing, to wait on a real readiness line instead of sleeping, and to suggest
brainlog <cmd> when it needs output it cannot see.
wait_for_pattern until a service is genuinely readymkdir -p .claude/skills/brainlog-guide && curl -fsSL https://raw.githubusercontent.com/urjitbhatia/brainlog/master/.claude/skills/brainlog-guide/SKILL.md -o .claude/skills/brainlog-guide/SKILL.md
Drops SKILL.md into your project. Use ~/.claude/skills/ instead to make it
available everywhere.
View logs, search output, control processes, and manage storage — all from the terminal.
A complete toolkit for agents to observe, query, and control your processes without any manual copy-pasting.
| Tool | Description |
|---|---|
| list_recent_runs | Last N runs across all services, newest first — best for "what just happened?" |
| discover_services | Find tracked services by name, cwd, tags, port, executable, status, or exit code |
| get_logs | Read stdout, stderr, or stdin by service ID, run ID, or working directory |
| search_logs | Regex search across all services with timestamps and context lines |
| wait_for_pattern | Block until a regex appears in output — like Playwright's waitForText |
| kill_service | Send a signal (SIGTERM, SIGKILL, etc.) to stop a running process |
| restart_service | Restart a running process via its wrapper (SIGUSR1) |
A natural sequence of tool calls gives any LLM agent full situational awareness over your running processes.
cwd to scope to the current repository.cwd shorthand — no need to discover first."listening on port 3000" before proceeding.Built on solid Unix primitives — PTY, SQLite, and a compact binary frame format.
Allocates a pseudo-terminal so the wrapped process behaves identically. isatty() returns true, colors and interactive prompts work, and terminal dimensions are inherited.
Every byte of stdout, stderr, and stdin is recorded with nanosecond timestamps.
Frame format: [timestamp_ns:u64][stream:u8][len:u32][payload]
Services without -n get a derived name from working directory and executable. LLM enrichment can generate human-readable names from initial output.
Service and run metadata lives in a SQLite database with WAL mode for concurrent reads. Logs are compact binary files in ~/.brainlog/logs/.