A command-line tool that extracts and displays shell commands executed during Claude Code sessions, similar to the shell history command.
cchistory is a command-line utility that retrieves and formats shell commands executed during Claude Code sessions, presenting them in a traditional shell history format. It solves the problem of Claude Code commands not appearing in the user's shell history, enabling users to re-run, analyze, and document past command sequences. The tool works by parsing conversation logs stored by Claude Code and outputting commands in a way compatible with standard Unix tools.
Developers and engineers who use Claude Code for coding assistance and need to track, reuse, or analyze shell commands run during their sessions. It is particularly useful for those who work across multiple projects and want to maintain a searchable command history.
Developers choose cchistory because it provides seamless integration with existing Unix workflows through piping and standard tools like grep and awk, requires zero configuration with existing Claude Code setups, and efficiently handles large conversation logs with a fast streaming parser. Its unique selling point is bridging the gap between AI-assisted coding sessions and traditional shell history management.
Like the shell history command but for your Claude Code sessions.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Output is designed to work with standard tools like grep and awk, as shown in examples where users pipe cchistory to filter or sort commands.
It works automatically with existing Claude Code setups by reading conversation logs from ~/.claude/projects/, requiring no additional setup.
Uses a fast streaming parser to handle large conversation logs without performance bottlenecks, ensuring quick command retrieval.
Extracts commands from both Claude's Bash tool usage and user-initiated '!' commands, covering all shell interactions in sessions.
History is limited by Claude Code's cleanup settings; commands older than the retention period (default 30 days) are permanently lost, as noted in the README.
Only works with Claude Code and cannot integrate with other AI assistants or system-wide shell history, making it a niche tool.
Requires Node.js 20+ for installation and use, which may not be present in minimal or restricted environments, adding a dependency barrier.