Give Claude Code, Codex, Cursor, and Gemini CLI Live Log Access with Logdy
When you debug a local app with an AI coding agent, two things go wrong fast. First, the agent runs your dev server or test suite in a background shell and either blocks waiting for output or dumps thousands of noisy lines into its context window. Second, you lose sight of what the app is actually logging while the agent edits files and restarts processes.
Logdy fixes both halves of that loop with a single local binary. You pipe your dev server, Docker container, or test runner through Logdy with --append-to-file and --rotate-file-size. You get a live, filterable web UI in your browser at http://127.0.0.1:8080, and your AI agent gets a clean, bounded local file it can inspect on demand—plus a REST endpoint if you want the agent to emit structured markers into the same timeline.
Below are copy-paste skill and instruction files for Claude Code (SKILL.md), OpenAI Codex (.agents/skills/ and AGENTS.md), Cursor (.cursor/rules/*.mdc), and Gemini CLI (GEMINI.md). Every Logdy flag and agent file path in this guide is checked against official documentation.
Why Pair an AI Coding Agent with Logdy?
Without a dedicated log tee, agent-assisted debugging usually falls into one of two traps:
- Context overflow: The agent runs
npm run devordocker compose logsand pulls hundreds of kilobytes of repetitive startup lines into its prompt. - Blind spots for the human: The agent redirects output to
/tmp/server.logand greps it silently. You cannot see live errors, HTTP status facets, or stack traces without opening another terminal and runningtail -fyourself.
Logdy bridges both workflows in one command:
npm run dev 2>&1 | logdy \
--port 8080 \
--append-to-file .logs/dev.log \
--append-to-file-raw \
--rotate-file-size 10M \
--no-analyticsHere is what each verified flag does (see the Logdy CLI reference):
--port 8080serves the embedded Web UI onhttp://127.0.0.1:8080(Logdy binds to127.0.0.1by default via--ui-ip).--append-to-file .logs/dev.logtees every incoming line to a local file the agent can read withtail,rg, or its file-reading tool.--append-to-file-rawwrites raw log lines without extra metadata wrappers, keeping grep and JSON parsing straightforward for the agent.--rotate-file-size 10Mcaps file growth so a chatty server never fills your disk or blows up an agent read.- Add
-t(--fallthrough) if you also want the raw stream echoed back to your terminal.
If you do not have Logdy installed yet, follow the Quick Start guide:
# macOS (Homebrew)
brew install logdy
# Linux / macOS install script
curl https://logdy.dev/install.sh | shYou can also try the UI right now at demo.logdy.dev before wiring it into a repo.
1. Claude Code Skill (SKILL.md)
Claude Code loads filesystem-based skills from ~/.claude/skills/<skill-name>/SKILL.md (personal, across all repos) or .claude/skills/<skill-name>/SKILL.md (project-scoped, committed to git for your team). Each SKILL.md starts with YAML frontmatter containing name and description so Claude knows when to trigger it automatically.
Create .claude/skills/live-log-debugging/SKILL.md:
---
name: live-log-debugging
description: Stream local dev server, container, or test logs through Logdy so the user can inspect them in a browser UI while Claude reads bounded log slices from disk. Use when debugging runtime errors, starting a dev server, or tailing multi-service logs.
---
# Live Log Debugging with Logdy
## When to use this workflow
Use Logdy whenever you start a long-running local process (web server, worker, Docker Compose) or need to inspect runtime logs during a debugging session.
## Setup check
1. Verify `logdy` is installed (`command -v logdy`). If missing, ask the user before installing (`brew install logdy` or `curl https://logdy.dev/install.sh | sh`).
2. Ensure `.logs/` exists and is listed in `.gitignore` so local logs are never committed.
## Starting a single service
Run the service in the background piped through Logdy:
```bash
mkdir -p .logs
<your-dev-command> 2>&1 | logdy \
--port 8080 \
--append-to-file .logs/dev.log \
--append-to-file-raw \
--rotate-file-size 10M \
--api-key "${LOGDY_API_KEY:-local-dev}" \
--no-analytics
```
Tell the user the live UI is available at `http://127.0.0.1:8080`.
## Combining multiple services
When debugging an API + worker + frontend together, start one Logdy socket listener and forward each stream into it:
```bash
logdy socket 8123 8124 \
--port 8080 \
--append-to-file .logs/all-services.log \
--append-to-file-raw \
--rotate-file-size 10M \
--no-analytics
```
In separate background terminals:
```bash
npm run dev:api 2>&1 | logdy forward 8123
npm run dev:worker 2>&1 | logdy forward 8124
```
## Reading logs without blowing up context
- Never read the entire `.logs/dev.log` file at once.
- Inspect the last 80 lines first: `tail -n 80 .logs/dev.log`.
- Search narrowly for errors or request IDs: `rg -n -C 3 "ERROR|Exception|500" .logs/dev.log | tail -n 100`.
- When you trigger a reproduction (e.g., `curl` or a test), record a marker via Logdy's REST API so the user can spot the exact moment in the Web UI:
```bash
curl -sS -X POST http://127.0.0.1:8080/api/log \
-H "Authorization: Bearer ${LOGDY_API_KEY:-local-dev}" \
-H "Content-Type: application/json" \
-d '{"source":"claude-code","logs":[{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","log":{"level":"info","msg":"repro-start: testing checkout 500"}}]}'
```
## Cleanup
Stop background `logdy` processes when the debugging session ends. Never leave `--ui-ip 0.0.0.0` exposed without `--ui-pass`.Notice the last trick: posting a marker to Logdy's built-in POST /api/log endpoint (documented in the REST API reference). Because Logdy's Web UI auto-generates columns and facets from JSON fields, you can filter by source = claude-code or jump straight to the exact timestamp where the agent ran a reproduction request.
2. OpenAI Codex (AGENTS.md and .agents/skills/)
OpenAI Codex supports both repository-wide AGENTS.md instructions and modular skills in .agents/skills/<skill-name>/SKILL.md (with user-level skills in ~/.agents/skills/). Note that newer versions of Claude Code also read AGENTS.md when no CLAUDE.md is present, making AGENTS.md a practical cross-agent baseline.
If you want a dedicated Codex skill, copy the exact SKILL.md above into:
.agents/skills/live-log-debugging/SKILL.mdIf you prefer a compact section inside your root AGENTS.md (which works for Codex, Cursor, and Claude Code without a CLAUDE.md):
## Runtime Log Debugging (Logdy)
- When running local servers or background workers for debugging, pipe output through `logdy` so the developer can watch structured logs in `http://127.0.0.1:8080` while you inspect bounded slices from `.logs/dev.log`:
`mkdir -p .logs && <cmd> 2>&1 | logdy --port 8080 --append-to-file .logs/dev.log --append-to-file-raw --rotate-file-size 10M --no-analytics`
- For existing log files, use `logdy follow --full-read path/to/app.log` to load existing lines and keep tailing.
- Never load full log files into context. Always use `tail -n 100 .logs/dev.log` or targeted `rg` queries.
- Never commit `.logs/` or bind Logdy to `0.0.0.0` without `--ui-pass`.3. Cursor Rules (.cursor/rules/logdy-debugging.mdc)
Cursor project rules live in .cursor/rules/ and must use the .mdc file extension with YAML frontmatter (description, globs, alwaysApply). Plain .md files inside .cursor/rules/ are ignored by Cursor's rules engine.
Save this as .cursor/rules/logdy-debugging.mdc:
---
description: Use Logdy to stream local dev server and container logs to a browser UI and a rotated log file during debugging
alwaysApply: false
---
When the user asks to run a local server, reproduce a runtime bug, or inspect live logs:
1. Check whether `logdy` is available (`command -v logdy`).
2. Start the process piped to Logdy with a rotated file sink:
```bash
mkdir -p .logs
<command> 2>&1 | logdy --port 8080 --append-to-file .logs/dev.log --append-to-file-raw --rotate-file-size 10M --no-analytics
```
3. Share `http://127.0.0.1:8080` with the user so they can filter logs with facets and columns in the browser (or inside VS Code / Cursor's Simple Browser).
4. Read logs strictly in bounded chunks (`tail -n 80 .logs/dev.log` or `rg`) instead of opening the whole file.
5. For multi-service debugging, use `logdy socket 8123 8124` and `logdy forward <port>` to merge streams into a single timeline.Setting alwaysApply: false with a clear description configures Cursor's "Apply Intelligently" mode so the rule only enters context when you are actually debugging runtime logs.
4. Gemini CLI (GEMINI.md)
Gemini CLI loads context hierarchically from ~/.gemini/GEMINI.md (global), ./GEMINI.md (project root), and subdirectory GEMINI.md files. You can verify what is loaded in any session by running /memory show.
Add this section to your project's GEMINI.md (or configure .gemini/settings.json with "context": { "fileName": ["AGENTS.md", "GEMINI.md"] } to reuse your AGENTS.md directly):
## Debugging with Logdy
- Stream local dev server logs through Logdy (`<cmd> 2>&1 | logdy --port 8080 --append-to-file .logs/dev.log --append-to-file-raw --rotate-file-size 10M --no-analytics`) so the user can filter live output at `http://127.0.0.1:8080`.
- When diagnosing a failure, inspect `.logs/dev.log` with `tail -n 100` or `rg` rather than reading the entire file.
- For large historical log files, slice the relevant window first using Logdy's built-in utilities (e.g., `logdy utils cut-by-line-number app.log 200 1000` or `logdy utils cut-by-string app.log "START_MARKER" "END_MARKER"`).That last line highlights a little-known Logdy feature: logdy utils includes cut-by-line-number, cut-by-string, and cut-by-date (see command modes), which let an agent carve a 2 GB log file down to a 200-line incident window before reading a single byte into its prompt.
Security & Hygiene Checklist
Before committing an agent log-debugging skill to a shared repository, add three guardrails:
- Add
.logs/to.gitignoreso rotated local logs never leak secrets or PII into git commits. - Keep
--ui-ipon127.0.0.1(Logdy's default). If you ever expose Logdy on a LAN or dev VM, require--ui-passand, if usingPOST /api/log, set--api-key. - Avoid piping secrets into
POST /api/log: Use the REST endpoint for short reproduction markers (repro-start,test-case-42), not raw auth tokens or customer payloads.
Where Logdy Fits—and Where It Doesn't
Logdy is built for live, local, ephemeral debugging—it keeps up to --max-message-count messages (default 100000) in an in-memory ring buffer and tees to a rotated file when you pass --append-to-file.
It is not a replacement for:
- SQL-heavy offline log forensics over gigabytes of archived
.gzfiles (uselnavin headless mode with-n -c ';SELECT ...'for that). - Production multi-host log retention and alerting (use a dedicated log backend like Grafana Loki, Better Stack, or Axiom).
For the daily local loop—where an AI coding agent is editing code, restarting your server, and running reproductions while you want to watch structured logs, filter by facets, and spot stack traces in real time—a 40-line SKILL.md + logdy turns terminal chaos into a shared debugging workspace.
Next steps:
- Install Logdy via the Quick Start guide
- Explore command modes (
stdin,follow,socket,forward,utils) - Try the interactive UI at demo.logdy.dev
