From promptrail
Architecture guide for the Promptrail CLI. Use when the user asks about how Promptrail works, its data model, CLI commands, or wants to understand the tool before making changes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/promptrail:architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
CLI tool that reads Claude Code sessions and presents a timeline of prompts with per-prompt file attribution, diffs, search, and rollback.
CLI tool that reads Claude Code sessions and presents a timeline of prompts with per-prompt file attribution, diffs, search, and rollback.
promptrail timeline [--files] All prompts with file counts
promptrail diff <n|text> Diff for prompt #n or matching text
promptrail response <n|text> AI response for prompt #n or matching text
promptrail search <query> Full-text search across prompts and responses
promptrail rollback <n|text> Cherry revert prompt's changes
promptrail sessions List all sessions
Filters: --source claude (always use this), --model <substring>
Shortcuts: tl, d, r, rb, s
Claude Code JSONL at ~/.claude/projects/<encoded-workspace>/ is self-contained. Each session file has:
role: "human", content[].text contains the promptrole: "assistant" with content[] containing text blocks and tool_use blockstype: "tool_use" with name (Edit, Write, etc.) and input containing file_path, old_string, new_string, or contentNo SQLite or file watcher needed -- the JSONL has everything for prompts, file changes, and rollback.
| Tool Name | Purpose | Key Fields |
|---|---|---|
Edit | String replacement | file_path, old_string, new_string |
Write | File creation/overwrite | file_path, content |
MultiEdit | Multiple edits in one call | file_path, edits[] |
SessionReader.readAllTasks()
|-> Parse Claude Code JSONL (prompts + tool_use blocks for file changes)
|-> Returns Task[] sorted chronologically
Each Task has: id, prompt, createdAt, filesChanged, source, model
| File | Purpose |
|---|---|
src/cli/index.ts | CLI entry point, all commands |
src/core/session-reader.ts | Parses Claude Code sessions into Task[] |
src/core/selective-revert.ts | Cherry revert logic (exact string matching) |
src/models/types.ts | Shared interfaces (Task, FileChange, etc.) |
| Data | Path |
|---|---|
| Claude sessions | ~/.claude/projects/<workspace>/ |
| Shadow DB | .promptrail/promptrail.db in workspace root |
old_string/new_string from tool calls), not full file before/after snapshotsnpx claudepluginhub thisalihassan/promptrail --plugin promptrailSearches Claude Code session history using full-text search on summaries, commits, projects, and branches. Use for queries like 'find where I discussed X' or 'search for Y'.
Searches, recovers, and analyzes AI session histories across Claude Code, AI Studio, and Gemini CLI. Useful for recovering lost files after compaction, searching conversations, detecting corrections, and self-improvement workflows.
Expert in using Claude Code CLI for advanced configuration, hooks, MCPs, CLAUDE.md, workflows, sub-agents, and permissions to maximize productivity.