cchistory

作者 eckardt

Like the shell history command but for your Claude Code sessions.

107
Stars
5
Forks
TypeScript
语言
2026/8/24
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/eckardt/cchistory

快速入门

使用 cchistory 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

cchistory

npm version

Like the shell history command but for your Claude Code sessions.

Why cchistory?

When Claude Code runs shell commands, they don't appear in your shell history. This makes it hard to:

  • Re-run useful commands from past sessions
  • Build on previous work
  • Learn from command patterns Claude uses
  • Copy command sequences for documentation
$ cchistory | tail -5
  46  git status
  47  git pull origin main
  48  git log --oneline -5
  49  docker-compose up -d
  50  curl -I localhost:8080/health

📦 Installation

npm (recommended)

npm install -g cchistory

npx (try without installing)

npx cchistory --help

From source

git clone https://github.com/eckardt/cchistory
cd cchistory
npm install
npm run build
npm link

Usage

cchistory                    # Current project history
cchistory --global           # All projects
cchistory --list-projects    # See all available projects
cchistory --multiline        # Split multi-command shells onto separate lines
cchistory --follow           # Stream new commands live (like tail -f)
cchistory | grep docker      # Find Docker commands
cchistory | tail -5          # Last 5 commands
cchistory my-app | tail -10  # Last 10 from specific project
cchistory ~/code/my-app      # Project by full path

Follow mode

-f / --follow works like tail -f: cchistory prints the existing history and then stays open, printing new commands as Claude Code writes them. It keeps following across newly started sessions, and combines with the other flags and with pipes:

cchistory -f                 # Follow the current project
cchistory -f --global        # Follow every project at once
cchistory -f | grep git      # Watch for git commands as they happen

Press Ctrl-C to stop. While following, the live commands are printed in the order they arrive (matching tail -f file1 file2), rather than re-sorted by timestamp.

✨ Features

  • 🔍 Extract all Bash commands Claude executed across projects
  • 🗂️ Filter by specific project or search globally
  • 📊 Standard Unix tool compatibility (grep, awk, sort)
  • ⚡ Fast streaming parser for large conversation logs
  • 🚀 Zero-config - works with existing Claude Code setup

How It Works

Claude Code stores conversation history in ~/.claude/projects/. This tool:

  1. Finds your Claude projects
  2. Streams through conversation logs
  3. Extracts shell commands Claude executed
  4. Formats them like traditional shell history

📋 Example Output

$ cchistory --global | head -10
   1  [web-scraper    ] npm install puppeteer
   2  [web-scraper    ] mkdir src tests
   3  [api-project    ] docker-compose up -d
   4  [api-project    ] curl -X POST localhost:3000/api/test
   5  [frontend       ] npm run dev
   6  [frontend       ] git add .
   7  [backend        ] npm test
   8  [backend        ] git commit -m "fix: validation"
   9  [deployment     ] kubectl apply -f deployment.yaml
  10  [deployment     ] kubectl get pods

Advanced Usage

# Find all npm commands across projects
cchistory --global | grep npm

# Get last 20 Docker commands
cchistory --global | grep docker | tail -20

# Count commands by type
cchistory --global | sed 's/.*] //' | awk '{print $1}' | sort | uniq -c | sort -nr | head -10

Command Sources

Extracts commands from:

  • Bash tool usage: Commands Claude executes via the Bash tool
  • User "!" commands: Commands you run with ! command in Claude

Requirements

  • Node.js 20+
  • Claude Code with conversation history in ~/.claude/projects/

Note: Claude Code automatically cleans up conversation transcripts based on the cleanupPeriodDays setting (default: 30 days). Commands older than this period won't appear in cchistory output. You can adjust this retention period in Claude Code's settings if needed.

Options

cchistory [project-name]    # Show history for specific project (by name or path)
cchistory --global          # Show history from all projects
cchistory --list-projects   # List all available Claude projects
cchistory -m, --multiline   # Split multi-command shells onto separate lines
cchistory -f, --follow      # Keep running and print new commands as they happen
cchistory --include-failed  # Include failed command executions
cchistory --help            # Show usage info

Output Format

Each line shows:

[sequence] [project-name] command
  • sequence: Command number (oldest first)
  • project-name: Which Claude project ran the command
  • command: The actual shell command

When Claude runs several commands in one shell, they are shown on a single line in zsh history format with \n separating them.

Use -m / --multiline to break them onto separate lines instead. Each line keeps the parent's history index with a .N sub-index so it's clear they ran in the same shell:

1610.1  cd /Users/you/projects/foobar
1610.2  git add README.md
1610.3  git commit -m "yolo"

Note: splitting happens on the \n separator, so a command whose own text literally contains \n (e.g. printf 'a\nb') will also be broken at that point.

Unix Philosophy

cchistory does one thing well: extract shell commands. Use it with standard Unix tools:

  • grep for filtering
  • head/tail for limiting output
  • awk for field processing
  • sort/uniq for analysis
  • Pipe to files for documentation

常见问题

What is cchistory?

cchistory is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by eckardt. Like the shell history command but for your Claude Code sessions. It has 107 GitHub stars.

Is cchistory safe to use?

cchistory returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.

How do I install cchistory?

Clone the repository with "git clone https://github.com/eckardt/cchistory" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is cchistory written in?

cchistory is primarily written in TypeScript. It is open-source under eckardt on GitHub, so you can review or fork the full source.

Are there alternatives to cchistory?

Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh cchistory against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ui-ux-pro-max-skill

by nextlevelbuilder

12

An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.

119,92012,870Python
CLI 工具ai-skillsantigravity
查看详情

happy

by slopus

Mobile and Web client for Codex and Claude Code, with realtime voice, encryption and fully featured

23,4501,980TypeScript
CLI 工具
查看详情

claudecodeui

by siteboon

Use Claude Code, OpenCode, Cursor CLI, and Codex on mobile and web with CloudCLI (aka Claude Code UI). CloudCLI is a free open source webui/GUI that helps you manage your Claude Code session and projects remotely.

13,3941,866TypeScript
CLI 工具
查看详情

CRS-自建Claude Code镜像,一站式开源中转服务,让 Claude、OpenAI、Gemini、Droid 订阅统一接入,支持拼车共享,更高效分摊成本,原生工具无缝使用。

12,5471,869JavaScript
CLI 工具
查看详情

ccstatusline

by sirmalloc

🚀 Beautiful highly customizable statusline for Claude Code CLI with powerline support, themes, and more.

12,508545TypeScript
CLI 工具
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情