npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-export-history

v1.0.1

Published

Auto export Claude Code conversations to Markdown files on /clear, /export-history, and session end

Readme

Claude Export History

npm version License: MIT

Auto export Claude Code conversations to Markdown files.

Perfect for keeping records of your AI coding sessions, sharing solutions, or reviewing past conversations.

Features

| Feature | Description | |---------|-------------| | Three trigger ways | /clear, /export-history, and session end (terminal close) | | Non-blocking | Async export for commands, sync for session end | | Customizable output | Environment variable for custom directory | | Language support | English/Chinese output via environment variable | | Clean Markdown format | Structured, readable output files | | Easy install | npm install or Claude Code plugin command |

Quick Start

Install via npm

npm install -g claude-export-history

The plugin will auto-install hooks into your Claude Code settings.

Install via Claude Code Plugin Marketplace

Add the marketplace once:

claude plugin marketplace add https://github.com/xuanweiH/claude-export-history

Then install the plugin:

claude plugin install claude-export-history@claude-export-history-marketplace

Manual Install from a Local Clone

git clone https://github.com/xuanweiH/claude-export-history.git
claude plugin marketplace add ./claude-export-history
claude plugin install claude-export-history@claude-export-history-marketplace

Usage

| Command | Action | |---------|--------| | /clear | Clear session + auto export conversation | | /export-history | Export current session (no clear) | | Close terminal | Auto export on session end |

Output Example

File: ~/Desktop/ai_history_md/2026-05-20-Fix-authentication-bug.md

English output (EXPORT_HISTORY_LANG="en"):

# Fix authentication bug in login flow

> Exported:2026-05-20 13:32:27
> Project:rn-weiliaoke

---

### User

Help me fix the authentication bug in login page

---

### Claude

Let me analyze and fix this issue...

---

*Export time: 2026-05-20 13:32:27*

Chinese output (EXPORT_HISTORY_LANG="zh"):

# Fix authentication bug in login flow

> 导出时间:2026-05-20 13:32:27
> 项目:rn-weiliaoke

---

### 用户

Help me fix the authentication bug in login page

---

### Claude

Let me analyze and fix this issue...

---

*导出时间: 2026-05-20 13:32:27*

Configuration

Custom Output Directory

# Set custom directory
export EXPORT_HISTORY_DIR="$HOME/Documents/chat-history"

# Or add to ~/.zshrc or ~/.bashrc
echo 'export EXPORT_HISTORY_DIR="$HOME/Documents/chat-history"' >> ~/.zshrc

Language Setting (English/Chinese)

# English (default)
export EXPORT_HISTORY_LANG="en"

# Chinese
export EXPORT_HISTORY_LANG="zh"

# Permanent setting
echo 'export EXPORT_HISTORY_LANG="zh"' >> ~/.zshrc

Disable Specific Hooks

Edit ~/.claude/settings.json:

{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "/clear",
        "hooks": [],
        "description": "Override: disable export on /clear"
      }
    ]
  }
}

Project Structure

claude-export-history/
├── hooks/
│   └── hooks.json              # Hook configuration
├── scripts/
│   ├── hooks/
│   │   ├── export.py           # Core export script
│   │   ├── user-prompt-export.sh
│   │   └── auto-export.sh
│   ├── install.js              # npm postinstall script
│   └── uninstall.js            # npm postuninstall script
├── skills/export-history/
│   └── SKILL.md                # Skill definition
├── package.json                # npm package info
├── README.md                   # This file
├── INSTALL.md                  # Detailed install guide
└── LICENSE                     # MIT License

Requirements

  • Node.js >= 16.0.0
  • Python 3.x
  • Claude Code CLI

Claude Plugin Marketplace

This repository includes:

  • .claude-plugin/plugin.json - Claude Code plugin manifest
  • .claude-plugin/marketplace.json - marketplace catalog entry using the published npm package

Contributing

Contributions welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE file.

Links


Made with love for Claude Code users