by eckardt
Like the shell history command but for your Claude Code sessions.
# Add to your Claude Code skills
git clone https://github.com/eckardt/cchistoryGuides for using cli tools skills like cchistory.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Like the shell history command but for your Claude Code sessions.
When Claude Code runs shell commands, they don't appear in your shell history. This makes it hard to:
$ 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
npm install -g cchistory
npx cchistory --help
git clone https://github.com/eckardt/cchistory
cd cchistory
npm install
npm run build
npm link
cchistory # Current project history
cchistory --global # All projects
cchistory --list-projects # See all available projects
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
grep, awk, sort)Claude Code stores conversation history in ~/.claude/projects/. This tool:
$ 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
# 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
Extracts commands from:
! command in Claude~/.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.
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 --help # Show usage info
Each line shows:
[sequence] [project-name] command
Multi-line commands use zsh history format with \\n for newlines.
cchistory does one thing well: extract shell commands. Use it with standard Unix tools:
grep for filteringhead/tail for limiting outputawk for field processingsort/uniq for analysis