tool-call-extract

Search pi session logs for tool calls and dump paired call-result records.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/peachest/skills --skill tool-call-extract-peachest
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tool-call-extract
Source: https://github.com/peachest/skills/tree/main/in-progress/tool-call-extract
Command: npx skills add https://github.com/peachest/skills --skill tool-call-extract-peachest

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Pi agent session logs are multi-megabyte JSONL files, making it painful to find which sessions called a specific tool, which calls failed, and what arguments and results were involved. This Skill locates those sessions and extracts compact paired call/result records so diagnosis never requires reading the raw log. ## Core Features & Use Cases - Cross-session search: Find all sessions calling a given tool, filterable by argument substring (e.g. 'glab api' inside bash commands) and errors-only, with per-session match/error stats and sample error texts. - Paired calls dump: For one chosen session, dump toolCall-args plus toolResult-text records linked by call id, with configurable clipping of args and results. - Use Case: When subagent workflowScript calls keep failing, search with errors-only to triage affected sessions, pick the fullest finished one, and hand the calls dump to the tool-call-diagnose skill for root-cause analysis. ## Quick Start Find all my pi sessions where bash commands containing 'glab api' failed, then dump the paired call and result records for the most recent finished session.

Frequently Asked Questions about tool-call-extract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find which pi sessions called a specific tool?▼

Run the search mode with the tool name as it appears in tool definitions, such as bash, subagent, or edit. The script scans all JSONL files under the sessions directory and reports per-session call counts, timestamps, and error stats.

How to filter session tool calls by argument content?▼

Use the --args-contains option with a substring matched against the serialized call arguments. For example, filtering bash calls with 'glab api' finds every session where that command pattern appeared.

How are tool call failures detected in pi session logs?▼

Failures are toolResult messages with isError set to true, which is the only reliable failure signal. A call whose result never arrived because the session was cut short is not counted as an error.

What happens when the session search finds zero matches?▼

The search reports an empty result and stops. The recommended next step is loosening the filter, such as disabling errors-only or dropping the argument substring, before concluding the tool was never called.

Can I dump full tool call arguments without clipping?▼

Yes, dump mode clips arguments to 4000 characters by default, but the --full-args flag disables clipping entirely. Result text clipping is separately controlled with --result-chars.