- Home
- Skills
- Research & Analysis
- Agent Session Ledger and Repo Distiller
Works with the AI Agents you already use
Agent Session Ledger and Repo Distiller
Distill 100MB+ agent logs and complex ML repos into <8KB context-safe summaries and one-shot prompts.
$9.99
Agent Session Ledger and Repo Distiller
Example session with this skill installed
Run a digest on my latest Claude Code session and distill it into a one-shot prompt template for refactoring my PyTorch training loop.
- Read your context and instructions
- Compiled the agent session ledger
I have processed the latest session log from ~/.claude/projects/ using the O(1) ledger script. The session contained 42 turns with 3 tool errors related to CUDA memory management.
Refined One-Shot Prompt Template
# Task: PyTorch Training Loop Refactoring
You are an expert ML Engineer. Refactor the training loop in `src/train.py` to improve readability and memory efficiency.
## Context from Session [ID: 7a2f9b]
- **Original Pain Point**: The agent previously attempted to use `torch.cuda.empty_cache()` inside the batch loop, which caused a 15% performance regression.
- **Resolved Path**: Implementing a `GradientScaler` for AMP and moving validation logic to a separate context manager fixed the memory fragmentation.
## Constraints
1. Do not use manual cache clearing inside the iteration loop.
2. Use `torch.cuda.amp.autocast()` for all forward passes.
3. Ensure the `model.train()` and `model.eval()` flags are strictly toggled around the validation block.
4. If a `RuntimeError: CUDA out of memory` occurs, default to reducing the micro-batch size via the `config.yaml` rather than modifying the loop logic.
## Reference Implementation
[Insert code from line 452 of session_ledger digest]
Next steps
- Apply this template to your next refactoring session to avoid repeating the CUDA cache mistake.
- Run
python3 scripts/session_ledger.py digest --session latestagain if you modify the loop further to capture new edge cases.
Connects securely to your tools. The creator never sees your data.
About this skill
Large agent logs and research repositories are context killers. Reading a 100 MB JSONL transcript or a deep ML repo directly exhausts token limits and leads to hallucination. This skill provides the tooling to prune that noise, offering O(1) RAM log mining and structured repository walkthroughs.
What it does
- Multi-harness Log Mining scans Claude Code, Cursor, Codex, and Antigravity logs without loading them into memory.
- Context-safe Digesting extracts a structured JSON summary guaranteed to stay under 8 KiB from multi-megabyte session files.
- Zero-bloat Onboarding generates architectural walkthroughs of unfamiliar research codebases while ignoring binary data and dependency noise.
- One-shot Distillation converts failed multi-turn experiments into clean, single-turn prompts by identifying and resolving past errors.
- Precision Retrieval provides exact line-number pointers for deep-diving into specific tool outputs without reading surrounding bloat.
How it works
- Probe the repository structure or agent log roots using
session_ledger.py listorsearchto identify targets. - Digest target sessions using the
digestcommand to generate a low-token summary of prompts, tool calls, and errors. - Analyze the output against provided templates in
references/distillation-templates.mdfor either repo onboarding or prompt engineering. - Synthesize a final artifact, such as a Mermaid pipeline diagram or a reusable one-shot system prompt.
Frameworks & tools
Built with 100% Python 3.9+ standard library. Supports log formats for Claude Code, Cursor, OpenAI Codex, and Google Antigravity. Designed for research environments involving PyTorch, WandB, and Lightning where binary checkpoints must be avoided.
Why this beats prompting it yourself
Standard agents will attempt to cat or read large JSONL files, instantly hitting context limits and failing. This skill uses external Python scripts to process data out-of-band, returning only the essential signal to the LLM.
Use cases
- Onboard onto a new ML repository by generating a full pipeline diagram and smoke-test commands.
- Review recent agent sessions to find where a specific hyperparameter experiment was previously defined.
- Debug a recursive tool failure by distilling the exact sequence of errors into a new constraint list.
- Extract a 100-turn coding session into a concise, reusable one-shot prompt for similar future tasks.
Known limitations
Does not support reading binary checkpoints, datasets, or files inside .git and node_modules directories. Requires Python 3.9+ to be available on the execution path.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Research & Analysis.
Requires Python 3.9+ on the host. Skips all binary files (.pt, .safetensors, etc.) and deep directory structures by design to save context.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
Python