{"id":30811849,"url":"https://github.com/eckardt/cchistory","last_synced_at":"2025-09-09T04:03:36.434Z","repository":{"id":297815794,"uuid":"997973157","full_name":"eckardt/cchistory","owner":"eckardt","description":"Like the shell history command but for your Claude Code sessions.","archived":false,"fork":false,"pushed_at":"2025-08-19T08:17:13.000Z","size":461,"stargazers_count":29,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T10:40:56.246Z","etag":null,"topics":["bash","claude","claude-code","cli","shell","shell-history","terminal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eckardt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-07T15:44:23.000Z","updated_at":"2025-08-19T08:17:13.000Z","dependencies_parsed_at":"2025-07-19T20:31:23.098Z","dependency_job_id":"83ec6b2f-f78b-4abb-8073-2f05d31f301d","html_url":"https://github.com/eckardt/cchistory","commit_stats":null,"previous_names":["eckardt/claude-history","eckardt/cchistory"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/eckardt/cchistory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckardt%2Fcchistory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckardt%2Fcchistory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckardt%2Fcchistory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckardt%2Fcchistory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eckardt","download_url":"https://codeload.github.com/eckardt/cchistory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckardt%2Fcchistory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273868135,"owners_count":25182423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","claude","claude-code","cli","shell","shell-history","terminal"],"created_at":"2025-09-06T07:00:42.210Z","updated_at":"2025-09-06T07:02:44.024Z","avatar_url":"https://github.com/eckardt.png","language":"TypeScript","funding_links":[],"categories":["Tooling 🧰","AI Coding Agents","HarmonyOS","Code \u0026 Developer Tools"],"sub_categories":["General","Claude Code","Windows Manager"],"readme":"# cchistory\n\n[![npm version](https://badge.fury.io/js/cchistory.svg)](https://badge.fury.io/js/cchistory)\n\nLike the shell `history` command but for your Claude Code sessions.\n\n\u003cdiv\u003e\n  \u003cimg src=\"https://github.com/eckardt/cchistory/blob/main/docs/demo.gif?raw=true\"\u003e\n\u003c/div\u003e\n\n## Why cchistory?\n\nWhen Claude Code runs shell commands, they don't appear in your shell history. This makes it hard to:\n- Re-run useful commands from past sessions\n- Build on previous work\n- Learn from command patterns Claude uses\n- Copy command sequences for documentation\n\n```bash\n$ cchistory | tail -5\n  46  git status\n  47  git pull origin main\n  48  git log --oneline -5\n  49  docker-compose up -d\n  50  curl -I localhost:8080/health\n```\n\n## 📦 Installation\n\n### npm (recommended)\n```bash\nnpm install -g cchistory\n```\n\n### npx (try without installing)\n```bash\nnpx cchistory --help\n```\n\n### From source\n```bash\ngit clone https://github.com/eckardt/cchistory\ncd cchistory\nnpm install\nnpm run build\nnpm link\n```\n\n## Usage\n\n```bash\ncchistory                    # Current project history\ncchistory --global           # All projects\ncchistory --list-projects    # See all available projects\ncchistory | grep docker      # Find Docker commands  \ncchistory | tail -5          # Last 5 commands\ncchistory my-app | tail -10  # Last 10 from specific project\ncchistory ~/code/my-app      # Project by full path\n```\n\n## ✨ Features\n\n- 🔍 Extract all Bash commands Claude executed across projects\n- 🗂️ Filter by specific project or search globally  \n- 📊 Standard Unix tool compatibility (`grep`, `awk`, `sort`)\n- ⚡ Fast streaming parser for large conversation logs\n- 🚀 Zero-config - works with existing Claude Code setup\n\n## How It Works\n\nClaude Code stores conversation history in `~/.claude/projects/`. This tool:\n\n1. Finds your Claude projects\n2. Streams through conversation logs  \n3. Extracts shell commands Claude executed\n4. Formats them like traditional shell history\n\n## 📋 Example Output\n\n```bash\n$ cchistory --global | head -10\n   1  [web-scraper    ] npm install puppeteer\n   2  [web-scraper    ] mkdir src tests\n   3  [api-project    ] docker-compose up -d\n   4  [api-project    ] curl -X POST localhost:3000/api/test\n   5  [frontend       ] npm run dev\n   6  [frontend       ] git add .\n   7  [backend        ] npm test\n   8  [backend        ] git commit -m \"fix: validation\"\n   9  [deployment     ] kubectl apply -f deployment.yaml\n  10  [deployment     ] kubectl get pods\n```\n\n## Advanced Usage\n\n```bash\n# Find all npm commands across projects\ncchistory --global | grep npm\n\n# Get last 20 Docker commands\ncchistory --global | grep docker | tail -20\n\n# Count commands by type\ncchistory --global | sed 's/.*] //' | awk '{print $1}' | sort | uniq -c | sort -nr | head -10\n```\n\n## Command Sources\n\nExtracts commands from:\n- **Bash tool usage**: Commands Claude executes via the Bash tool\n- **User \"!\" commands**: Commands you run with `! command` in Claude\n\n## Requirements\n\n- Node.js 20+ \n- Claude Code with conversation history in `~/.claude/projects/`\n\n**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](https://docs.anthropic.com/en/docs/claude-code/settings) if needed.\n\n## Options\n\n```\ncchistory [project-name]    # Show history for specific project (by name or path)\ncchistory --global          # Show history from all projects  \ncchistory --list-projects   # List all available Claude projects\ncchistory --help            # Show usage info\n```\n\n## Output Format\n\nEach line shows:\n```\n[sequence] [project-name] command\n```\n\n- **sequence**: Command number (oldest first)\n- **project-name**: Which Claude project ran the command\n- **command**: The actual shell command\n\nMulti-line commands use zsh history format with `\\\\n` for newlines.\n\n## Unix Philosophy\n\n`cchistory` does one thing well: extract shell commands. Use it with standard Unix tools:\n\n- `grep` for filtering\n- `head`/`tail` for limiting output  \n- `awk` for field processing\n- `sort`/`uniq` for analysis\n- Pipe to files for documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feckardt%2Fcchistory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feckardt%2Fcchistory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feckardt%2Fcchistory/lists"}