{"id":46706165,"url":"https://github.com/pppp606/cursor-efficiency","last_synced_at":"2026-03-09T08:11:47.910Z","repository":{"id":296561114,"uuid":"992365103","full_name":"pppp606/cursor-efficiency","owner":"pppp606","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-13T04:10:43.000Z","size":51,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-13T05:21:34.906Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/pppp606.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-29T03:25:12.000Z","updated_at":"2025-06-13T04:10:45.000Z","dependencies_parsed_at":"2025-06-01T03:38:19.449Z","dependency_job_id":null,"html_url":"https://github.com/pppp606/cursor-efficiency","commit_stats":null,"previous_names":["pppp606/cursor-efficiency"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pppp606/cursor-efficiency","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pppp606%2Fcursor-efficiency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pppp606%2Fcursor-efficiency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pppp606%2Fcursor-efficiency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pppp606%2Fcursor-efficiency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pppp606","download_url":"https://codeload.github.com/pppp606/cursor-efficiency/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pppp606%2Fcursor-efficiency/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30287503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-03-09T08:11:47.458Z","updated_at":"2026-03-09T08:11:47.900Z","avatar_url":"https://github.com/pppp606.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cursor-efficiency\n\nA CLI tool to report token usage, chat count, lines changed, and adoption rate for Cursor IDE.\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/pppp606/cursor-efficiency.git\ncd cursor-efficiency\n\nnpm install\nnpm run build\nnpm install -g .\n```\n\nThen you can run it using:\n```bash\ncursor-efficiency start\n# or\ncursor-efficiency end\n```\n\n## Usage\n\nThe tool provides two main commands:\n\n### Start Measurement\n\n```bash\ncursor-efficiency start\n```\n\nThis command begins the measurement process. It will:\n- Record the current git branch and commit SHA\n- Create a configuration file in your project directory\n\n### End Measurement\n\n```bash\ncursor-efficiency end\n```\n\nThis command ends the measurement and outputs a report. It supports the following options:\n\n- `-c, --include-chat-entries`: Include detailed chat entries in the output\n\n## Output Format\n\nThe tool outputs a JSON object with the following fields:\n\n```json\n{\n  \"branch\": \"string\",\n  \"startTime\": \"string (ISO format)\",\n  \"endTime\": \"string (ISO format)\",\n  \"usedTokens\": {\n    \"input\": \"number\",\n    \"output\": \"number\"\n  },\n  \"usageRequestAmount\": \"number\",\n  \"chatCount\": {\n    \"input\": \"number\",\n    \"output\": \"number\"\n  },\n  \"linesChanged\": \"number\",\n  \"proposedCodeCount\": \"number\",\n  \"adoptionRate\": \"number\",\n  \"chatEntries\": \"array (optional)\"\n}\n```\n\n### Field Descriptions\n\n- `startTime`: The timestamp when measurement started (ISO format)\n- `endTime`: The timestamp when measurement ended (ISO format)\n- `usedTokens`: Token usage statistics\n  - `input`: Number of tokens used in user inputs\n  - `output`: Number of tokens used in AI responses\n- `usageRequestAmount`: The calculated cost of API usage\n- `chatCount`: Number of chat interactions\n  - `input`: Number of user messages\n  - `output`: Number of AI responses\n- `git`\n  - `branch`: The name of the current Git branch during measurement\n  - `linesChanged`: Total number of lines changed in git commits between start and end time. This counts the actual committed changes, not just proposed changes. (only included when using `--include-chat-entries` option)\n  - `diff`: diff code (only included when using `--include-chat-entries` option)\n- `proposedCodeCount`: Number of code suggestions made by Cursor's AI\n- `adoptionRate`: Percentage of AI-suggested changes that were adopted\n- `chatEntries`: Detailed chat history (only included when using `--include-chat-entries` option)\n\n## Usage Scenario\n\nThe tool is designed to measure your coding efficiency with Cursor IDE. Here's a typical workflow:\n\n1. Start measurement before beginning your coding session:\n   ```bash\n   cursor-efficiency start\n   ```\n\n2. Work on your code using Cursor IDE, making commits as you go\n\n3. End measurement after completing your work and making final commits:\n   ```bash\n   cursor-efficiency end\n   ```\n\nThis will give you insights into:\n- How much code you've actually committed\n- Your interaction with Cursor's AI\n- The efficiency of your coding process\n\n## Important Notes\n\n1. The tool requires a git repository to be initialized in your project directory\n2. Make sure you have the necessary permissions to access Cursor's workspace storage\n\n## Examples of Using Logs\n\nBelow are two examples of how to utilize the generated logs.\n\n### 1. Passing Logs to an LLM for Individual Improvement\n\nUse the JSON-formatted log output from Cursor-efficiency as-is and feed it to an LLM to receive feedback on your coding process and AI interactions. Prepare a prompt like the following:\n\n```text\nReview the log of interactions with the coding AI and propose improvement points for the user.\n\n## Goals\n- Increase adoptionRate (the rate at which proposed code is accepted)\n- Reduce chatCount (the number of back-and-forth messages)\n- Reduce usageRequestAmount (the number of AI requests per session)\n\n### Logs\n{\n  \"startTime\": \"2025-06-01T09:00:00.000Z\",\n  \"endTime\": \"2025-06-01T10:30:00.000Z\",\n  \"usedTokens\": {\n    \"input\": 1200,\n    \"output\": 980\n  },\n  ...\n}\n```\n\n### 2. Collecting and Analyzing Team-wide Logs via Git Hooks\n\nHave every team member use Cursor-efficiency, and automatically collect logs at git push time to a central server or shared storage. This allows you to understand team-wide trends. One example workflow is as follows:\n\n#### 1. Add a Hook in the Local Repository\nPlace a script like the following in your project's `.git/hooks/pre-push` (or in your CI pipeline):\n\n```bash\n#!/bin/bash\n# Example pre-push hook (make sure this file is executable)\n\n# 1. Determine current branch and short commit SHA\nBRANCH=$(git rev-parse --abbrev-ref HEAD)\nSHA=$(git rev-parse --short HEAD)\nLOG_FILE=\"cursor_log_${BRANCH}_${SHA}.json\"\n\n# 2. End the Cursor-efficiency measurement (capture the log just before pushing)\ncursor-efficiency end -c \u003e \"$LOG_FILE\"\n\n# 3. Send the log to a shared storage or central server (e.g., internal server or S3)\n#    Use curl as an example; adjust as needed.\ncurl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d @\"$LOG_FILE\" \\\n  https://example.com/api/team-logs/upload\n\n# 4. If the upload succeeds, proceed with the push; otherwise, abort.\nif [ $? -ne 0 ]; then\n  echo \"Failed to upload log. Aborting push.\"\n  exit 1\nfi\n\nexit 0\n```\n\n#### 2. Aggregate and Analyze Logs on the Server\n\n- Import each member's log file (e.g., cursor_log_feature-add-new-api_ab12cd.json) into a centralized database (e.g., BigQuery, Elasticsearch).\n- Create dashboards to visualize metrics such as:\n  - Average token usage, average chat count, average adoption rate\n  - Trends by model or by project\n  - Time-series analysis (e.g., monthly adoption rate changes)\n- This makes it easy to share insights like \"Project X achieved a 60% adoption rate\" or \"Model Y yielded high efficiency,\" helping the entire team learn best practices.\n\n#### 3. **Establish a Regular Feedback Loop**\n\n- Based on the analysis, share reports in internal chat or meetings, such as \"Adoption rate improved from 50% to 65% last month\" or \"Model Z had the best token-to-output efficiency.\"\n- Team members can review these logs and reflect on their own prompt design and AI interaction patterns, continuously improving overall development efficiency.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpppp606%2Fcursor-efficiency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpppp606%2Fcursor-efficiency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpppp606%2Fcursor-efficiency/lists"}