extract-log-debug
Skill11 starsChanged 18 days agoMITView on GitHub
Extract and analyze LibrAgent debug logs with pattern matching and context. Use when debugging LibrAgent issues, analyzing agent workflows, investigating tool execution problems, or extracting specific log patterns like errors, warnings, planning operations, MCP tool calls, or browser automation traces. Supports extracting last N lines or searching for patterns with surrounding context.
In this repository48 other files it gives its agents.
- agents.mdAGENTS.md
- .agents/skills/react-best-practices/AGENTS.mdAGENTS.md
- .agents/skills/react-native-skills/AGENTS.mdAGENTS.md
- .agents/skills/react-view-transitions/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agent-initSkill
- agy-delegateSkill
- audit-docsSkill
- code-audit-expertSkill
- computer-diagnosisSkill
- create-builtin-toolSkill
- create-prSkill
- critique-builtin-toolSkill
- doc-auditorSkill
- docxSkill
- feature-refactor-proposalSkill
- gatekeeper-loopSkill
- harbor-harness-improvement-loopSkill
- i18n-language-standardsSkill
- jobs-trace-analyzerSkill
- lean-builtin-tool-auditorSkill
- libragent-qualitySkill
- libr-delegateSkill
- libr-tool-e2e-harness-loopSkill
- modular-large-file-refactorSkill
- performance-auditSkill
- pptxSkill
- vercel-react-best-practicesSkill
- vercel-react-native-skillsSkill
- vercel-react-view-transitionsSkill
- readme-showcase-syncSkill
- refactor-builtin-toolSkill
- release-managerSkill
- review-local-changesSkill
- review-pr-commentsSkill
- science-searchSkill
- setup-wizardSkill
- skill-creatorSkill
- soul-awakeningSkill
- sqlite-analyzerSkill
- sync-pending-approvalsSkill
- tool-creatorSkill
- trace-analyzerSkill
- trace-eval-loopSkill
- vitepress-doc-syncSkill
- worker-loopSkill
- x-cliSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 142
When using --pattern, output includes:
- Distinctive: line 165
Use wider context (10-20 lines) for workflow analysis
- Distinctive: line 166
Use narrower context (3-5 lines) for quick error checks
- Distinctive: line 168
Check log_patterns.md for component-specific patterns
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Extract Log Debug
Extract and analyze LibrAgent debug logs for troubleshooting and analysis.
Quick Start
Extract logs using the Python script:
# Extract last 100 lines
python scripts/extract_logs.py -n 100
# Extract all errors with 5 lines of context
python scripts/extract_logs.py --pattern "[ERROR]" --context 5
# Extract planning logs
python scripts/extract_logs.py --pattern "PLANNING" -n 5000
# Save to custom file
python scripts/extract_logs.py --pattern "[WARN]" -o warnings.txtLog File Location
LibrAgent stores logs in platform-specific directories:
- Windows:
%LOCALAPPDATA%\com.fritzprix.libragent\logs\libragent.log - macOS:
~/Library/Logs/com.fritzprix.libragent/libragent.log - Linux:
~/.local/share/com.fritzprix.libragent/logs/libragent.log
The script automatically detects and uses the correct path.
Common Patterns
Error Extraction
python scripts/extract_logs.py --pattern "[ERROR]" --context 10Component-Specific Logs
# Agent workflow logs
python scripts/extract_logs.py --pattern "agent_" -n 5000
# MCP tool execution
python scripts/extract_logs.py --pattern "MCPServiceProxy" --context 10
# Planning operations
python scripts/extract_logs.py --pattern "PLANNING" --context 5
# Browser automation
python scripts/extract_logs.py --pattern "BrowserServer" --context 10Recent Activity
# Last 500 lines for quick check
python scripts/extract_logs.py -n 500
# Last 5000 lines for detailed analysis
python scripts/extract_logs.py -n 5000Pattern Reference
For comprehensive list of log patterns and search strategies, see log_patterns.md.
Key pattern categories:
- Error patterns (
[ERROR],Failed to,panic) - Component logs (
agent_,MCPServiceProxy,BrowserServer) - Workflow phases (
Think phase,Act phase,Observe phase) - Tool operations (
call_tool,list_tools) - Performance indicators (
Duration:,elapsed)
Debugging Workflows
1. Investigate Error
# Extract errors
python scripts/extract_logs.py --pattern "[ERROR]" --context 10 -o errors.txt
# Review errors.txt for:
# - Error message and stack trace
# - Preceding operations (context lines above)
# - Affected component (agent, MCP, builtin server)
# - Session ID for tracking2. Analyze Agent Workflow
# Extract workflow logs
python scripts/extract_logs.py --pattern "agent_" -n 5000 -o workflow.txt
# Review workflow.txt for:
# - Session lifecycle (create, start, stop)
# - Workflow phases (Think, Act, Observe)
# - Tool execution sequences
# - Loop iterations and completion3. Debug Tool Execution
# Extract tool logs
python scripts/extract_logs.py --pattern "call_tool" --context 10 -o tools.txt
# Review tools.txt for:
# - Tool name and arguments
# - Routing (builtin vs external)
# - Execution results or errors
# - Response structure4. Track Session Activity
# Extract specific session logs (replace <session-id> with actual ID)
python scripts/extract_logs.py --pattern "<session-id>" --context 5 -o session.txt
# Review session.txt for:
# - Session initialization
# - Tool calls made during session
# - Workflow status changes
# - Errors specific to sessionOutput Format
Pattern Match Output
When using --pattern, output includes:
- Match count and line ranges
- Line numbers with markers (
>for matching lines) - Context lines before and after matches
- Merged ranges for adjacent matches
Example:
=== Match 1: Lines 1234-1244 ===
1234 [DEBUG] Starting operation
1235 > [ERROR] Failed to execute tool
1236 Stack trace: ...
1237 at module.rs:123Full Line Output
Without --pattern, outputs raw log lines preserving original format.
Tips
- Use wider context (10-20 lines) for workflow analysis
- Use narrower context (3-5 lines) for quick error checks
- Combine
-nwith--patternto search recent logs only - Check log_patterns.md for component-specific patterns
- For performance issues, search for "Duration:" or "elapsed" patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

