We're living in the golden age of AI-assisted coding.
Claude can refactor your functions. Copilot can write your tests. Cursor can navigate your entire codebase.
But ask any of them: "What was that error I saw 5 minutes ago?"
Silence.
AI can read your code. But it's completely blind to your runtime.
That's the problem I solved with logifai.
The Moment I Knew I Had to Build This
I was debugging a race condition. The bug appeared maybe once every 50 requests — completely random.
After 2 hours of watching logs scroll by, I finally caught it:
[ERROR] Connection timeout: pool exhausted after 30000ms
at ConnectionPool.acquire (lib/pool.js:142:15)
at async QueryRunner.connect (lib/runner.js:87:21)
I immediately asked Claude: "Can you help me fix this connection pool exhaustion?"
Claude asked: "Can you show me the error message and stack trace?"
I scrolled up. And up. And up.
Gone. Swallowed by 10,000 lines of HTTP request logs.
I spent the next 20 minutes trying to reproduce the error, just so I could copy-paste it.
That night, I started building logifai.
What is logifai?
logifai is a zero-dependency CLI tool that:
- 📥 Captures your terminal output via pipe
- 🔄 Normalizes logs into a consistent format
- 🔒 Redacts secrets automatically (API keys, tokens, passwords)
- 🌐 Serves a real-time Web UI
- 🤖 Integrates with Claude Code via a Skill
One line changes your debugging workflow forever:
npm run dev 2>&1 | logifai
That's it. Every log is now searchable by AI.
See It In Action
Step 1: Pipe Your Command
$ npm run dev 2>&1 | logifai
📡 logifai v0.1.0
📁 Session: a1b2c3d4
🌐 Web UI: http://localhost:3100
⏳ Capturing stdin...
Step 2: Errors Happen (They Always Do)
Your app crashes. A stack trace flies by at 100 lines per second.
Normally, you'd panic-scroll or pray your terminal buffer is big enough.
Not anymore.
Step 3: Ask Claude
With the Claude Code Skill installed, just ask:
You: What errors happened in my last session?
Claude: I found 3 errors in session
a1b2c3d4:
Line 142:
TypeError: Cannot read property 'id' of undefined
- Location:
src/api/users.ts:47Line 287:
ECONNREFUSED 127.0.0.1:5432
- PostgreSQL connection failed
Line 512:
JsonWebTokenError: jwt malformed
- Authentication middleware rejected the token
Want me to investigate any of these?
Claude now sees what your terminal saw.
The Web UI
logifai automatically opens a Web UI at http://localhost:3100:
| Feature | Description |
|---|---|
| Live streaming | Logs appear in real-time via Server-Sent Events |
| Level filtering | Toggle ERROR / WARN / INFO / DEBUG |
| Keyword search | Find specific messages instantly |
| Line references | Click any line to copy a logifai:// URI |
| Shift+click | Select a range of lines |
No React. No npm install. No webpack. Just HTML served from a single TypeScript file.
Log References: Share Exact Lines
Every session gets a unique ID. Every line gets a number.
This creates precise, shareable references:
logifai://a1b2c3d4:142-150
Translation: "Session a1b2c3d4, lines 142 through 150"
What You Can Do With References
In your terminal:
$ logifai show logifai://a1b2c3d4:142-150
142: [ERROR] Connection refused
143: at Socket.connect (net.js:1141:16)
144: at DBClient.connect (client.js:89:12)
...
In GitHub issues:
The error occurs at
logifai://a1b2c3d4:142. See attached logs.
With Claude:
Explain this error:
logifai://a1b2c3d4:142-150
Automatic Secret Redaction
Logs leak secrets. It happens to everyone.
logifai automatically detects and redacts sensitive data:
| Pattern | Before | After |
|---|---|---|
| AWS Keys | AKIAIOSFODNN7EXAMPLE |
[AWS_KEY] |
| OpenAI Keys | sk-proj-abc123def456... |
[API_KEY] |
| Bearer Tokens | Bearer eyJhbGciOiJ... |
Bearer [TOKEN] |
| Database URLs | postgres://user:secret@host |
postgres://user:[REDACTED]@host |
| Private Keys | -----BEGIN RSA PRIVATE |
[PRIVATE_KEY] |
Your logs never leave your machine. No cloud. No telemetry. No tracking.
Storage location: ~/.local/state/logifai/logs/ (permissions: 600)
The Normalizer: Order From Chaos
Different tools log differently. logifai normalizes them all:
Input (Raw log)
2024-01-15 10:23:45 ERROR Failed to connect
at Database.connect (db.js:42)
at Server.start (server.js:15)
Output (NDJSON)
{
"timestamp": "2024-01-15T10:23:45.000Z",
"level": "ERROR",
"message": "Failed to connect",
"stack": "at Database.connect (db.js:42)\n at Server.start (server.js:15)",
"session_id": "a1b2c3d4",
"git_branch": "feature/auth",
"git_commit": "7f3a2b1"
}
Supported Formats
- Structured JSON — pino, winston, bunyan
- Multi-line stack traces — automatically grouped with their errors
- Log levels — inferred from keywords when not explicit
- Timestamps — ISO 8601, Unix epoch, RFC 3339
- Common formats — Apache CLF, Syslog, nginx
Installation
One-Line Install (macOS / Linux)
curl -fsSL https://raw.githubusercontent.com/fujitatomoya/logifai/main/install.sh | bash
What happens:
- Detects your OS and CPU architecture
- Downloads the correct binary from GitHub Releases
- Verifies SHA256 checksum
- Installs to
~/.local/bin/and updates your PATH
Alternative: npm
npm install -g logifai
Enable Claude Code Integration
logifai install-skill
This installs the Skill to ~/.claude/skills/logifai/.
Why These Technical Choices?
| Decision | Why |
|---|---|
| Zero runtime dependencies | No node_modules. No supply chain attacks. ~20MB binary. |
| Bun compile | Single executable. No Node.js required on target machine. |
| NDJSON storage | Stream-friendly. Grep-able. No database setup. |
| Server-Sent Events | Simpler than WebSockets. Works through corporate proxies. |
| Embedded HTML | No build step. The UI is a template string in TypeScript. |
| XDG Base Directory | Respects ~/.local/state, ~/.config, ~/.cache conventions. |
The entire codebase uses only Node.js built-ins: node:fs, node:http, node:test, etc.
Roadmap
| Phase | Status | What's Included |
|---|---|---|
| 1 | ✅ Complete | Pipe capture, Web UI, Claude Skill, auto-redaction, show command |
| 2 | 🚧 In Progress |
logifai exec npm run dev — wrap commands, preserve colors and TTY |
| 3 | 📋 Planned | SQLite FTS5 for millisecond full-text search across all sessions |
| 4 | 💭 Exploring | MCP server protocol, semantic search, anomaly detection |
Get Started in 60 Seconds
# 1. Install logifai
curl -fsSL https://raw.githubusercontent.com/fujitatomoya/logifai/main/install.sh | bash
# 2. Capture your dev server
npm run dev 2>&1 | logifai
# 3. Open the Web UI
# → http://localhost:3100
# 4. Install Claude Code integration
logifai install-skill
# 5. Ask Claude about your logs
# → "What errors happened in my last session?"
Links
- GitHub: github.com/fujitatomoya/logifai
- Issues & Feedback: github.com/fujitatomoya/logifai/issues
If logifai saves you from scrolling through logs even once, consider giving it a ⭐ on GitHub.
And if you've ever lost a stack trace to terminal buffer overflow, share this with a friend. They'll thank you.
Top comments (0)