session-analyzer/SKILL.md
Analyze Codex session logs for one repository, extract the repo-specific top-level conversations for a target day, summarize every user message in order, and surface the next best action. Use when the user asks what happened yesterday in a repo, which conversations touched a repo, what to work on next based on recent Codex work, or to reconstruct repo workstreams from session history.
npx skillsauth add grp06/useful-codex-skills session-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when the job is "figure out what happened in Codex sessions for repo X and synthesize the next move" rather than doing open-ended manual log spelunking.
The default path is: run the bundled Python sync+digest script once, read its compact digest, then only inspect raw transcripts or repo artifacts if the digest is complete and still leaves an ambiguity.
Default time selection is the previous calendar date in the user's locale timezone. If the user instead asks for a rolling recent window such as "last 6 hours" or "past 12 hours", pass --last-hours N and let the script own the window math.
The script now does more than enumerate sessions:
high, medium, low)implemented_and_merged, plan_only, blocked_waiting_for_input, etc.)candidate_next_actions instead of forcing the final synthesis to start from a blank slatetheme_summaries that collapse many sessions into one workstream-level truth, including current state, superseded earlier sessions, and landed-vs-local-only countsmain/upstream when --include-git is enabledRun the extractor first.
python3 ~/.codex/skills/session-analyzer/scripts/repo_session_digest.py \
--repo ~/TaskRally \
--when yesterday \
--format markdown \
--include-git
If the user gave a specific date, replace --when yesterday with --date YYYY-MM-DD.
If the user asked for a recent rolling window instead of a calendar day:
python3 ~/.codex/skills/session-analyzer/scripts/repo_session_digest.py \
--repo ~/TaskRally \
--last-hours 6 \
--format markdown \
--include-git
If you want machine-readable output for follow-on processing:
python3 ~/.codex/skills/session-analyzer/scripts/repo_session_digest.py \
--repo ~/TaskRally \
--date 2026-03-31 \
--format json \
--include-git
The script now writes a canonical local mirror at
~/.codex/sqlite/session_message_index.sqlite by default.
Important: the script fails closed. If any relevant top-level repo thread cannot be fully recovered, it exits non-zero and prints Status: INCOMPLETE. In that case, do not synthesize a final "what should I work on next?" recommendation from the partial result.
Important: --include-git is now explicitly supplemental. It reports the repo's current state at digest time, not the target day's historical state. Use it to answer "what still appears local or unfinished now?", not "what definitely happened yesterday?"
When validating completeness, prefer a closed day such as yesterday after local midnight or an explicit historical date. An in-progress day can still be useful as a live format probe, and --last-hours N is useful for recent activity probes, but neither rolling windows nor in-progress days are as stable as a closed historical date for "all conversations recovered."
Resolve the repo path.
~/repo, let the script expand it.--allow-basename-fallback when you explicitly want broader, noisier coverage.Run the extractor before opening raw logs.
--include-git by default when the user wants "what should I do next" or "what landed vs not landed."--format markdown unless you explicitly need JSON.--last-hours X instead of trying to convert that into --date or --when..codex/worktrees/*/<repo-name>logs_1.sqlite request replay as a secondary recovery pathAGENTS.md / environment wrappersRead the digest and reconstruct workstreams.
COMPLETE.historical_evidence and candidate_next_actions as the starting point for synthesis.Escalate to raw artifacts only when needed.
INCOMPLETE, escalate to recovery/debugging, not synthesis.git status --shortgit log --oneline --decorate -n 20.agent/done plansAnswer decisively.
implemented_local_only as ambiguous: it often means work happened, but not necessarily that it landed.~/.codex unless CODEX_HOME is set.state_5.sqlite for thread inventory.--when, --date) and rolling recent windows (--last-hours).~/.codex/sessions~/.codex/archived_sessions~/.codex/scripts/sessionslogs_1.sqlite as a secondary recovery path when transcripts are missing.session_message_index.sqlite.history.jsonl or first_user_message as canonical coverage.The JSON payload now has a stable top-level schema_version.
Key top-level fields:
status: overall digest completeness (complete or incomplete)target_mode: calendar_day or rolling_hourstarget_window: normalized window metadata with label, start_at, end_at, and optional last_hoursrelevant_sessions: ordered list of repo-relevant top-level sessionshistorical_evidence: aggregate counts derived from target-day session evidencecandidate_next_actions: ranked unresolved follow-up candidates derived from the sessionstheme_summaries: workstream rollups with a current_state, supporting session chronology, and superseded-session hintscurrent_repo_state: optional current-state snapshot, only present when --include-git is usedEach relevant_sessions[] entry includes:
match_reason: why the repo matched (cwd_within_repo, codex_worktree_name_match, or low-confidence cwd_basename_match)match_confidence: high, medium, or lowinventory_reasons: why the session was included for the target day (created_on_day, state_updated_on_day, transcript_activity_on_day, log_activity_on_day)started_at_local: local-time mirror of started_atuser_messages: array of {ordinal, kind, text, source, turn_id}outcome: {status, confidence, evidence[]} heuristic thread classificationtheme: {key, title} lightweight workstream grouping hintpriority_signals: repeated urgency / verification / "what next?" hints that should shape synthesislow_signal_operational: true for housekeeping threads like plain pulls that should usually not become top recommendationsMinimal example:
{
"schema_version": 2,
"status": "complete",
"target_mode": "rolling_hours",
"target_window": {
"mode": "rolling_hours",
"label": "last 6 hours",
"start_at": "2026-04-01T12:00:00Z",
"end_at": "2026-04-01T18:00:00Z",
"timezone": "America/Los_Angeles",
"last_hours": 6
},
"relevant_sessions": [
{
"session_id": "thread-id",
"match_reason": "cwd_within_repo",
"match_confidence": "high",
"inventory_reasons": ["created_on_day", "transcript_activity_on_day"],
"user_messages": [
{
"ordinal": 1,
"kind": "user_request",
"text": "find the root cause",
"source": "rollout",
"turn_id": null
}
],
"outcome": {
"status": "investigation_only",
"confidence": "medium",
"evidence": ["thread emphasizes investigation/root-cause analysis without landing work"]
},
"theme": {
"key": "release_rollout",
"title": "Repair the rollout and hosted release-proof path"
}
}
],
"candidate_next_actions": [
{
"theme_key": "release_rollout",
"title": "Repair the rollout and hosted release-proof path",
"score": 91
}
],
"current_repo_state": {
"git": {
"note": "This is the current repo state at digest time..."
}
}
}
candidate_next_actions disagree with the repo handover or .agent/done docs.--date if completeness matters more than recency.repo_session_digest.py
development
Create an ExecPlan from a locked refactor decision, PRD, RFC, or detailed problem statement, following the repo's PLANS.md. Use when the user asks for an exec plan, execution plan, or ExecPlan, or wants a decided refactor turned into a step-by-step plan.
documentation
Update ARCHITECTURE.md after implementing an execution plan. Use when user asks to update architecture docs, sync architecture, refresh architecture after implementation, or mentions updating docs post-execplan.
tools
Analyze Codex rollout transcripts for one repository and time window, extract repo-scoped tool calls that failed, cluster repeated error patterns, and recommend the next agent/tooling improvements. Use when the user wants to inspect tool-call failures, operational friction, repeated command mistakes, patch failures, or prompt/tooling improvements based on recent Codex runs.
data-ai
Execute a pending execution plan from the .agent folder. Use when user asks to implement an execplan, execute the plan, run the pending plan, or mentions execplan-pending.md.