# Codex Session Msg Analysis Skill

> A reproducible, LLM-optional skill for analyzing Codex and other agent session logs. It provides deterministic message, tool-call, and network-call statistics, prompt catalogs, source hashing, and auditable outputs.

Codex Session Msg Analysis Skill is a free AI agent skill on Agensi by yalin feng, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [yalin feng](https://www.agensi.io/creators/yalin-feng)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-23
- Security: scan passed (2026-11-23); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/codex-session-msg-analysis-skill
- Tags: llm-ops, session-analysis, debugging, data-analysis, jsonl

## About this skill

Analyzing long-running AI agent sessions manually is tedious and error-prone. This skill automates the extraction of structured data from conversation logs, providing deterministic parsing and thematic clustering to understand agent performance and user intent.

### NOTE!
- DO NOT USE this skill for analyzing your SENSITIVE sessions or conversations !!
- Especially, DO NOT USE this skill for those credential projects or those conversations with **keys, passwords and your personal identifiable information**!!

#### What it does
- **Deterministic Parsing** converts raw logs from various sources into a unified event model for consistent analysis.
- **Thematic Clustering** groups user prompts into logical task phases using a hybrid similarity scoring system.
- **Usage Auditing** counts valid user prompts, agent messages, tool executions, and network requests.
- **Data Cataloging** generates a sequential catalog of user prompts mapped to specific categories and conversation stages.
- **Constraint Filtering** strips platform-injected noise like environment context or plugin recommendations for cleaner statistics.

#### How it works
1. **Source Loading** takes a session ID, local file path, or raw text and creates a frozen, read-only snapshot.
2. **Unified Modeling** maps source-specific roles to standard labels including user, agent, tool, and system.
3. **Prompt Cleaning** removes machine-generated XML noise and normalization artifacts to isolate true user intent.
4. **Weighted Clustering** applies TF-IDF, BM25, and Levenshtein distance to group messages by similarity and temporal adjacency.
5. **Validation** runs consistency checks to ensure every message is accounted for without duplication in the final reports.

#### Frameworks & tools
This skill works with structured log formats like JSONL and JSON, as well as unstructured Markdown or text files. It includes specific parsing logic for Codex thread exports and local development logs.

#### Why this beats prompting it yourself
Standard prompts struggle to maintain counting accuracy over long contexts and often hallucinate message sequences. This skill uses a deterministic execution flow to ensure the sum of categorized messages matches the total count every time.

#### Use cases
- **Performance Auditing** to measure tool dependency and network call frequency in production agents.
- **User Research** to identify recurring pain points and feature requests within support chat logs.
- **Session Debugging** to map out where an agent deviated from a plan during a multi-step task.

#### Known limitations
Thematic labels rely on keyword anchors for high accuracy; results may require manual adjustment if used in niche domains without provided lexical anchors. Network call counts might be underestimated if inner tool calls are unresolved.

## Requires

- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Codex Session Msg Analysis Skill skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill differ from simply asking an LLM to summarize a conversation log?

This skill solves the issue of manual log auditing by providing a deterministic way to count tool executions, strip out system noise, and cluster user intents without the hallucinations common in standard LLM prompting.

### Which AI agent frameworks or log formats are compatible with this analysis tool?

The skill is framework-agnostic and supports any agent that exports logs in JSON, JSONL, Markdown, or raw text, including specific parsing logic for Codex thread exports.

### What exactly is included in the purchase of the Session Analysis skill?

You receive the full session analysis logic, the deterministic parsing engine, and documentation on how to map your specific log schema to the skill's unified event model.

### Is there a limit to the length of the conversation or the number of logs I can analyze at once?

The skill is designed to handle long-running sessions; however, for extremely large datasets, it utilizes a frozen snapshot method to ensure data consistency and prevent memory overhead during the clustering process.

### Can I customize the thematic categories used to cluster user prompts?

While the clustering is automated, you can improve accuracy in niche industries by providing custom lexical anchors (keywords) to help the skill better categorize domain-specific user intents.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
