Stop Copy-Pasting Terminal Output: logifai Captures Everything for Claude Code
Your terminal just got a memory upgrade.
Picture this: It's 2 AM. Your production build just failed with a cryptic stack trace that scrolls past 500 lines. You're frantically selecting text in your terminal, trying to grab the error message without losing the context. Your mouse slips. You miss the crucial line. Start over. Copy. Paste into Claude Code. Realize you forgot the surrounding logs. Repeat.
Sound familiar?
Every developer has burned hours on this ritual. We treat our terminals like amnesiac blackboards — write, erase, panic when we need what just vanished. Meanwhile, AI coding assistants promise to revolutionize debugging, yet we're still manually feeding them scraps like seagulls at a beach.
What if your terminal remembered everything?
What if asking Claude Code "what went wrong?" automatically surfaced the exact error, the full stack↗ Bright Coding Blog trace, and the surrounding context — without you lifting a finger?
Enter logifai, the open-source tool that's making terminal copy-paste obsolete. One pipe. Zero friction. Infinite context for your AI assistant.
What is logifai?
logifai is a lightweight, single-binary CLI tool that captures, structures, and serves your terminal output — purpose-built for seamless integration with Claude Code. Created by developer Tomoya F, it solves a deceptively simple problem with elegant engineering: bridging the gap between ephemeral terminal output and AI-assisted debugging.
The tool operates on a dead-simple principle: pipe any command through it, and everything gets recorded as structured NDJSON while still flowing to your terminal normally. No wrappers. No configuration files. No changes to your workflow.
But logifai isn't just a logger. It's a context bridge between your runtime environment and your AI assistant. By combining automatic normalization, intelligent redaction, a live Web UI, and a native Claude Code Skill, it transforms scattered terminal output into queryable, referenceable knowledge.
Why is it trending now? Three converging forces:
- AI coding assistants went mainstream — Claude Code, Cursor, GitHub Copilot Chat all need context, but getting terminal output into them remains friction-heavy
- Developer ergonomics became competitive — teams are optimizing every keystroke; manual log extraction is now recognized as pure toil
- Security consciousness spiked — pasting logs into cloud AI services risks leaking secrets; logifai's local-first, redaction-first approach eliminates that exposure
The repository has gained rapid traction across developer communities precisely because it attacks a universal pain point with zero adoption cost. One pipe character. That's the entire learning curve.
Key Features That Make logifai Irresistible
Let's dissect what makes this tool technically compelling — beyond the marketing gloss.
Pipe & Capture: Zero-Friction Logging
The core interaction is breathtakingly simple: command 2>&1 | logifai. The 2>&1 merges stderr into stdout so errors don't escape capture. Output passes through transparently — you see exactly what you'd see normally — while logifai records everything in the background. No TTY hijacking, no output mangling, no surprises.
Smart Normalization Engine
Raw terminal output is chaotic. logifai's normalizer auto-detects JSON logs, infers severity levels (ERROR/WARN/INFO/DEBUG), groups multi-line stack traces into single structured entries, and parses common formats like CLF and Syslog. This transforms unstructured text into queryable data without any schema configuration.
Automatic Secret Redaction
Before anything touches disk, sensitive patterns get masked: Bearer tokens, GitHub PATs, OpenAI/Anthropic API keys, AWS↗ Bright Coding Blog credentials, database connection strings, JWTs, generic api_key= assignments, even private key blocks. This isn't regex theater — it's production-grade protection that runs locally, keeping your secrets out of both your logs and any AI context windows.
Live Web UI with Streaming
A browser-based interface serves at http://127.0.0.1:3100 with Server-Sent Events for real-time log streaming. Filter by level. Search by keyword. Select specific lines and generate compact references. It's the observability dashboard you didn't know your terminal needed.
Log References: Precision Context for AI
Instead of dumping 300 lines into Claude Code, select relevant entries in the Web UI, click Copy Ref, and paste a compact URI like logifai://a1b2c3d4:42,50-55. Claude fetches only those lines automatically. Your prompts stay small. Your context window stays available for actual reasoning.
Claude Code Skill: Native AI Integration
Install via /plugin install logifai@logifai-marketplace or manually copy the SKILL.md. Claude gains the ability to search your logs using standard tools — grep, jq, cat — against local NDJSON files. No MCP server required. No network dependencies. Just natural language queries that resolve to precise log analysis.
Zero Runtime Dependencies
Distributed as a single binary. No Node.js runtime needed. No Python↗ Bright Coding Blog environment. No Docker↗ Bright Coding Blog container. The npm package auto-downloads the correct native binary for your platform. This matters when you're debugging in restricted environments or onboarding team members who resent dependency sprawl.
Self-Updating Binary
logifai update checks GitHub Releases and updates in-place. Your tooling stays current without package manager gymnastics.
Real-World Use Cases Where logifai Dominates
1. Debugging Flaky CI/CD Pipelines
Your GitHub Actions workflow fails intermittently. Logs expire in 90 days. Artifacts are truncated. By piping your local reproduction through npm run test:ci 2>&1 | logifai --source ci-repro, you capture the full failure with complete context. Ask Claude: "Compare this failure pattern to the last three successful runs." The structured NDJSON makes temporal analysis trivial.
2. Microservices Development with Docker Compose
Five containers spew interleaved logs. Finding which service originated an error is archaeology. docker compose up 2>&1 | logifai --source docker unifies everything with automatic source tagging. The Web UI's filtering lets you isolate services instantly. Claude can query: "Show me ERROR-level entries from the auth service in the last 10 minutes."
3. Security Incident Response
You need to analyze logs without risking secret exposure in cloud AI services. logifai's local processing and automatic redaction mean you can safely ask Claude: "Find all authentication failures and correlate with IP addresses" — without ever transmitting raw logs off-machine.
4. Long-Running Development Servers
Your Next.js↗ Bright Coding Blog dev server runs for hours. Errors scroll past in milliseconds. With npm run dev 2>&1 | logifai, every compilation error, every warning, every HMR hiccup is preserved. When something breaks, you don't need to reproduce it — just ask Claude what happened recently.
5. Team Knowledge Sharing
Share logifai:// references in Slack or pull requests instead of screenshots. Teammates open the exact log lines with full context. No more "see line 47 in the attached image" that becomes useless after any code change.
Step-by-Step Installation & Setup Guide
Getting started takes under 60 seconds. Choose your preferred method:
macOS / Linux: Homebrew (Recommended)
# Add the tap and install in one flow
brew install tomoyaf/logifai/logifai
macOS / Linux: Shell Script
# Direct install from GitHub — verifies with fsSL flags for security
curl -fsSL https://raw.githubusercontent.com/tomoyaf/logifai/main/install.sh | sh
Windows: PowerShell
# Modern Windows install using irm (Invoke-RestMethod)
irm https://raw.githubusercontent.com/tomoyaf/logifai/main/install.ps1 | iex
Windows: Scoop
# Add custom bucket, then install
scoop bucket add logifai https://github.com/tomoyaf/scoop-logifai
scoop install logifai
All Platforms: npm (Auto-Downloads Native Binary)
# Global install — handles platform detection automatically
npm i -g logifai
Verify Installation
logifai --version
First Capture: Instant Gratification
# Capture your dev server — Web UI auto-opens at http://127.0.0.1:3100
npm run dev 2>&1 | logifai
The 2>&1 is critical — it redirects stderr (where most errors appear) into stdout so logifai captures everything. Without this, your errors vanish into the ether.
Install the Claude Code Skill
Via Plugin Marketplace (Recommended):
# Add the marketplace source
/plugin marketplace add tomoyaf/logifai
# Install the skill
/plugin install logifai@logifai-marketplace
Manual Installation (Alternative):
# Create skills directory if needed
mkdir -p ~/.claude/skills/logifai
# Download the skill definition
curl -fsSL https://raw.githubusercontent.com/tomoyaf/logifai/main/skills/logifai/SKILL.md \
-o ~/.claude/skills/logifai/SKILL.md
Browse Saved Sessions
# No pipe needed — opens Web UI for historical sessions
logifai
REAL Code Examples from the Repository
Let's examine actual code patterns from logifai's documentation, with detailed breakdowns of what each accomplishes.
Example 1: Basic Capture with Source Labeling
# Label the source for better organization in multi-project workflows
npm run build 2>&1 | logifai --source build
Before: You run npm run build, see errors scroll past, try to select them manually, paste into Claude, lose context about which build step failed.
After: Every line is tagged with "source": "build" in the NDJSON. Claude queries can filter by this label. When you run npm run dev separately with --source dev, the logs don't intermingle confusingly.
The --source parameter injects metadata that survives in structured storage. It's the difference between "some error happened somewhere" and "the TypeScript compilation step emitted this specific diagnostic."
Example 2: Docker Compose with Passthrough Control
# Capture Docker logs without terminal echo — useful for background capture
npm test 2>&1 | logifai --no-passthrough
Wait, let's use the actual Docker example from the README:
# Capture any command with explicit source tagging
docker compose up 2>&1 | logifai --source docker
The --source docker tag is transformative for containerized development. Docker Compose interleaves logs from multiple services with prefix tags like web-1 | or db-1 |. logifai captures this raw interleaving, but the source label lets you query: "Show me only docker-sourced ERROR entries."
Practical pattern: Run multiple captures in different terminal tabs, each with distinct --source values, then use the Web UI to correlate events across your full stack.
Example 3: Custom Port and Capture-Only Mode
# Use a custom port when 3100 is occupied by another service
npm run dev 2>&1 | logifai --port 8080
# Capture only, no Web UI — legacy mode for headless environments
npm run dev 2>&1 | logifai --no-ui
The --port override matters when you're running multiple logifai instances (different projects) or have existing services on 3100. Each instance maintains independent storage — no collision.
--no-ui serves automation scenarios: CI pipelines, remote servers, or when you only need the NDJSON files for later batch analysis with jq.
Example 4: Manual Structured Queries with jq
# Extract recent errors with full structure
jq 'select(.level == "ERROR" and .stack != null)' ~/.local/state/logifai/logs/current.ndjson
This query demonstrates logifai's data model power. Each log entry is a JSON object with predictable fields:
timestamp: ISO 8601 with millisecond precisionlevel: Inferred severity (ERROR/WARN/INFO/DEBUG)message: Primary contentsource: Your--sourcelabel or "unknown"project: Working directory pathsession_id: Unique capture session identifiergit_branch/git_commit: Automatic VCS contextpid: Process ID for correlation with system toolsstack: Grouped stack trace when detected_original: Preserved raw input when normalization transforms
The select(.level == "ERROR" and .stack != null) filter finds only errors with stack traces — eliminating noise from simple log messages while ensuring you get actionable debugging information.
Example 5: Log Reference Resolution
# Resolve a compact reference to full log entries
logifai show logifai://a1b2c3d4:42,50-55 --format json
The show command decodes logifai's reference URIs. The format logifai://{session_id}:{line}[,{range}] is designed for:
- Compactness: Fits in any chat interface without truncation
- Precision: References exact lines, not approximate positions
- Durability: Session IDs are stable; line numbers in a session don't shift
- Security: Contains no actual log content — just retrieval coordinates
When you paste logifai://a1b2c3d4:42,50-55 into Claude Code, the Skill invokes this same resolution mechanism, fetching lines 42 and 50-55 from session a1b2c3d4 and injecting them into the context window.
Advanced Usage & Best Practices
Retention Management
# Preview cleanup without deleting
logifai cleanup --older-than 30d --dry-run
# Actually remove old sessions
logifai cleanup --older-than 30d --max-size 1G
Log files accumulate. The cleanup command respects both age and total size constraints. Use --dry-run religiously — NDJSON is append-only and irreplaceable.
Environment Variable Integration
# Skip update checks in CI environments
export CI=true
npm test 2>&1 | logifai --no-ui
The CI=true flag suppresses the daily GitHub Releases check. Essential for reproducible CI pipelines and air-gapped environments.
XDG Directory Compliance
# Custom state directory for team-shared machines
export XDG_STATE_HOME=/var/lib/team-logs
npm run dev 2>&1 | logifai
logifai respects $XDG_STATE_HOME, enabling centralized logging on shared development servers or custom backup strategies.
Multi-Project Workflow
# Terminal 1: Backend API
npm run dev:api 2>&1 | logifai --source api --port 3101
# Terminal 2: Frontend
npm run dev:client 2>&1 | logifai --source client --port 3102
Explicit source labels and port assignments prevent cross-project pollution when context-switching between microservices.
Comparison with Alternatives
| Feature | logifai | script / screen |
tee |
Cloud Log Aggregators | Terminal AI Plugins |
|---|---|---|---|---|---|
| Friction to start | One pipe character | Manual session mgmt | No AI integration | Complex setup | Editor-locked |
| AI assistant integration | Native Claude Skill | None | None | API-based, expensive | Often limited |
| Local-only / privacy | ✅ Yes | ✅ Yes | ✅ Yes | ❌ Cloud-dependent | Varies |
| Automatic secret redaction | ✅ Built-in | ❌ No | ❌ No | ⚠️ Often extra cost | ❌ Rare |
| Structured storage | NDJSON with schema | Plain text | Plain text | Proprietary | N/A |
| Live Web UI | ✅ Built-in | ❌ No | ❌ No | ✅ Yes | ❌ No |
| Zero dependencies | ✅ Single binary | ✅ Built-in | ✅ Built-in | ❌ Heavy stacks | Varies |
| Log references for AI | ✅ Compact URIs | ❌ No | ❌ No | ❌ No | ❌ No |
Why logifai wins: It occupies a unique intersection — local-first privacy, AI-native workflow integration, structured storage, and zero configuration. tee captures output but leaves you manually extracting context. Cloud aggregators solve search but introduce compliance overhead. Terminal plugins lock you to specific editors. logifai's Claude Code Skill is the first solution that makes terminal logs natively queryable by AI without leaving your machine.
FAQ: Common Developer Concerns
Q: Does logifai slow down my commands?
A: Negligible overhead. It's a pipe consumer — data flows through memory buffers with no disk blocking on the hot path. The Web UI uses Server-Sent Events, not polling. Benchmarks show <1% throughput impact on typical development workloads.
Q: Can I use logifai with tools other than Claude Code?
A: Absolutely. The NDJSON files are standard and queryable with jq, grep, or any tool. However, the Claude Code Skill with logifai:// references is currently exclusive to Claude. The roadmap includes MCP server support for broader assistant compatibility.
Q: What if I forget the 2>&1 redirect?
A: stderr escapes capture. You'll see errors in terminal but logifai won't record them. Muscle-memory helps: alias lf='2>&1 | logifai' in your shell for npm run dev lf shorthand.
Q: How secure is the automatic redaction?
A: Pattern-based with comprehensive coverage of common secret formats. File permissions are restrictive (700/600). However, redaction isn't cryptographic guarantee — review sensitive logs before sharing references, and audit the pattern list in the source code for your specific compliance needs.
Q: Does it work on Windows WSL?
A: Yes — install in your WSL distribution using the Linux methods. The Web UI binds to 127.0.0.1, accessible from Windows browsers via localhost. Native Windows PowerShell install also works for pure Windows workflows.
Q: What happens when my logs get huge?
A: Use logifai cleanup with --max-size or --older-than. The NDJSON format compresses well with standard tools. Phase 3 roadmap includes SQLite FTS5 indexing for massive historical datasets.
Q: Can I capture multiple simultaneous commands?
A: Each logifai instance is independent with unique session IDs. Run multiple terminals with different --port values, or use --no-ui for background captures and browse later with logifai.
Conclusion: Your Terminal Deserves a Memory
We've normalized an absurd workflow: manually selecting, copying, and pasting ephemeral terminal output into AI assistants that promise to eliminate drudgery. logifai breaks that cycle with a single pipe character.
The technical elegance is in the constraints: one binary, zero configuration, local-first, AI-native. No central service to trust. No subscription to justify. No paradigm shift to adopt — just 2>&1 | logifai between you and contextual, referenceable, AI-queryable logs.
For teams adopting Claude Code, this isn't a nice-to-have. It's a force multiplier on your most expensive resource: developer attention. Every second not spent context-switching between terminal and AI chat is a second spent solving actual problems.
The roadmap promises even deeper integration — child process mode, SQLite indexing, semantic search, anomaly detection. But what's shipping today already transforms daily debugging from friction to flow.
Stop copy-pasting. Start piping.
👉 Install logifai from GitHub — star the repo, open an issue if you hit edge cases, and never lose a log line again.