By Emasoft
Exports current session segment (since last compaction) with system-reminder stripping -- main conversation, subagent transcripts, sidechains, and debug logs in structured markdown
Automatically exports the full chat transcript before every compaction event, preserving conversation history that would otherwise be summarized and lost.
The export captures four layers of conversation data:
~/.claude/debug/<session_id>.txt (if debug mode was active), interleaved into the main conversation by timestamp.A PreCompact hook fires before every compaction (manual via /compact or automatic when the context window fills). The hook runs a Python script that:
<session_id>/subagents/<details> sectionsThe export is saved to .claude/chat_history/export-YYYYMMDD-HHMMSS.md in the current working directory.
The hook is defined in hooks/hooks.json:
{
"hooks": {
"PreCompact": [
{
"matcher": "auto|manual",
"hooks": [
{
"type": "command",
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/pre_compact_export.py"
}
]
}
]
}
}
The script receives hook input via stdin (JSON with session_id, transcript_path, etc.) and writes the export file.
Files are saved as:
.claude/chat_history/export-20260212-193045.md
.claude/chat_history/export-20260213-104512.md
Each export contains:
## USER / ## ASSISTANT headings and timestamps<details> sections (subagent Tasks are expanded by default)Install from the Emasoft marketplace. Use --scope user to install for all Claude Code instances, or --scope global for all projects.
# Add Emasoft marketplace (first time only)
claude plugin marketplace add emasoft-plugins --url https://github.com/Emasoft/emasoft-plugins
# Install plugin (--scope user = all Claude Code instances, recommended for utility plugins)
claude plugin install emasoft-chat-history@emasoft-plugins --scope user
# RESTART Claude Code after installing (required!)
Utility plugins are installed once with --scope user and become available to all Claude Code instances.
This is a utility plugin — it provides pre-compaction chat export hooks. No --agent flag needed; just start Claude Code normally and chat history will be automatically exported before context compaction.
--plugin-dir loads a plugin directly from a local directory without marketplace installation. Use only during plugin development.
claude --plugin-dir ./OUTPUT_SKILLS/emasoft-chat-history
match-free syntax, compatible with 3.10+)emasoft-chat-history/
.claude-plugin/
plugin.json # Plugin manifest
hooks/
hooks.json # PreCompact hook configuration
scripts/
pre_compact_export.py # Main export script (674 lines)
LICENSE
README.md
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub emasoft/emasoft-plugins --plugin emasoft-chat-historyTask distribution, agent coordination, progress monitoring - executes plans via subagents. Requires AI Maestro for inter-agent messaging.
Comprehensive validation, management, and standardization suite for Claude Code plugins and marketplaces. Includes 190+ validation rules, plugin lifecycle management, marketplace operations, health checks, security auditing, GitHub repo validation, plugin/marketplace repo scaffolding, and standardization tooling. Features severity hierarchy, --strict mode, language-aware token estimation, and universal plugin/marketplace templates.
GHE (GitHub-Elements) - Automated project management for Claude Code using GitHub Issues as persistent memory with orchestrated DEV/TEST/REVIEW workflow.
Portable utility tools for Claude Code plugin marketplaces. Includes release automation and markdown TOC generation.
Per-operation token usage reporter for Claude Code 2.1.108+. Shows token counts, cost estimates, tool + skill + agent attribution, cache invalidation detection, worktree sub-agent breakdown, compact_boundary markers, CLAUDE.md reload events, and file activity when agents complete. Only outputs in debug mode (claude --debug).
Session log archiver: saves conversations as Markdown or JSON for easy review
Continuous memory for Claude Code. Extracts, summarizes, and compresses conversations into tiered daily logs. Claude remembers what you did yesterday.
Session transcript timeline viewer for Claude Code and Codex agent sessions
Memory compression system for Claude Code - persist context across sessions
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.