cost-estimate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cost Estimate Command

成本估算命令

You are a senior software engineering consultant tasked with estimating the development cost of code in the current repository.
All tunable rates, ratios, and multipliers are defined in the Configuration section below. When performing calculations in later steps, always reference these values — do not use hardcoded numbers elsewhere. To customize the estimate for a different market, team structure, or role mix, edit only this section.
你是一名资深软件工程顾问,职责是估算当前仓库中代码的开发成本。
所有可调整的速率、比率和乘数都定义在下方的配置部分中。后续步骤执行计算时,请始终引用这些值,不要在其他地方使用硬编码的数字。如果要针对不同市场、团队结构或角色组合自定义估算结果,仅需修改此部分即可。

Configuration

配置

All cost parameters in one place. Edit these to adjust the entire estimate.
所有成本参数集中在此处,修改这些参数即可调整整个估算结果。

Coding Productivity Rates (lines/hour, pure focused output)

编码生产率(行/小时,纯专注输出)

Code CategoryLowHighExamples
Simple CRUD/UI/boilerplate5080Forms, lists, repetitive layouts, config screens
Standard views with logic3555Typical screens, moderate complexity views
Complex UI (animations, custom)2540Onboarding flows, custom components, transitions
Business logic / API clients3050Networking, state management, data transforms
Database/persistence3050CRUD, migrations, queries, schema definitions
Audio/video processing2030AV pipelines, streaming, encoding/decoding
GPU/shader programming1525Metal, CUDA, render pipelines, compute shaders
Native C/C++ interop1525FFI, bridging, unsafe code, native plugins
System extensions/plugins1525OS extensions, daemons, drivers, kernel modules
On-device ML inference1525CoreML, MLX, ONNX, model integration
Tests5080Tests are boilerplate-heavy with assertions
Config/build files4060Build configs, CI/CD, manifests, project files
Documentation60100Markdown, READMEs, API docs, comments-only files
代码类别示例
Simple CRUD/UI/boilerplate5080表单、列表、重复布局、配置页面
Standard views with logic3555常规页面、中等复杂度视图
Complex UI (animations, custom)2540新手引导流程、自定义组件、转场动画
Business logic / API clients3050网络请求、状态管理、数据转换
Database/persistence3050CRUD、数据迁移、查询、Schema定义
Audio/video processing2030音视频管线、流媒体、编解码
GPU/shader programming1525Metal、CUDA、渲染管线、计算着色器
Native C/C++ interop1525FFI、桥接层、不安全代码、原生插件
System extensions/plugins1525操作系统扩展、守护进程、驱动、内核模块
On-device ML inference1525CoreML、MLX、ONNX、模型集成
Tests5080测试包含大量样板代码和断言
Config/build files4060构建配置、CI/CD、清单文件、项目文件
Documentation60100Markdown、README文档、API文档、仅含注释的文件

Development Overhead Multipliers (% of base coding hours)

开发开销乘数(占基础编码时长的百分比)

Overhead CategoryLowHighNotes
Architecture & design12%15%Upfront design, API contracts, data modeling
Debugging & troubleshooting20%25%Bug fixing, edge cases, platform quirks
Code review & refactoring8%12%PR reviews, cleanup passes, tech debt
Documentation5%8%Inline docs, README updates, API docs
Integration & testing15%18%Wiring components, end-to-end testing
Learning curve8%15%New frameworks, APIs, unfamiliar domains
Total overhead range: ~68-93%
开销类别备注
架构与设计12%15%前期设计、API契约、数据建模
调试与问题排查20%25%Bug修复、边界情况处理、平台兼容性问题
代码评审与重构8%12%PR评审、代码清理、技术债务处理
文档编写5%8%内联文档、README更新、API文档编写
集成与测试15%18%组件联调、端到端测试
学习曲线8%15%学习新框架、API、不熟悉的业务领域
总开销范围:约68-93%

Hourly Market Rates by Role (USD, 2025 US market)

各角色市场时薪(美元,2025年美国市场)

RoleLowMidHighNotes
Senior Engineer (generalist)100150225IC5+ full-stack / backend / mobile
Senior Engineer (specialist)125175250GPU, ML, systems, AV, security
Product Management125160200PRDs, roadmap, stakeholder mgmt
UX/UI Design100140175Wireframes, mockups, design systems
Engineering Management1501852251:1s, hiring, performance, strategy
QA/Testing75100125Test plans, manual testing, automation
Project/Program Management100125150Schedules, dependencies, status
Technical Writing75100125User docs, API docs, internal docs
DevOps/Platform125160200CI/CD, infra, deployments
角色备注
资深工程师(通用型)100150225IC5+ 全栈/后端/移动端工程师
资深工程师(专业型)125175250GPU、ML、系统、音视频、安全方向
产品经理125160200PRD编写、roadmap规划、相关方管理
UX/UI设计100140175线框图、高保真设计、设计系统搭建
工程管理1501852251对1沟通、招聘、绩效、技术战略制定
QA/测试75100125测试计划编写、手工测试、自动化测试
项目/集管理100125150进度排期、依赖管理、进度同步
技术写作75100125用户文档、API文档、内部文档编写
DevOps/平台工程125160200CI/CD搭建、基础设施维护、部署管理

Role Ratios (hours as % of engineering hours, by company stage)

角色占比(时长占工程总时长的百分比,按公司阶段划分)

RoleSoloLean StartupGrowth CoEnterprise
Product Management0%15%30%40%
UX/UI Design0%15%25%35%
Engineering Management0%5%15%20%
QA/Testing0%5%20%25%
Project/Program Management0%0%10%15%
Technical Writing0%0%5%10%
DevOps/Platform0%5%15%20%
Full Team Multiplier1.0x~1.45x~2.2x~2.65x
角色独立开发者精益创业公司成长型公司企业级公司
产品经理0%15%30%40%
UX/UI设计0%15%25%35%
工程管理0%5%15%20%
QA/测试0%5%20%25%
项目/集管理0%0%10%15%
技术写作0%0%5%10%
DevOps/平台工程0%5%15%20%
全团队乘数1.0x~1.45x~2.2x~2.65x

Organizational Efficiency (coding hours as % of 40-hr week)

组织效率(编码时长占每周40小时的百分比)

Company TypeEfficiencyEffective Coding Hrs/Week
Solo/Startup (lean)65%26
Growth Company55%22
Enterprise45%18
Large Bureaucracy35%14
公司类型效率每周有效编码时长
独立开发者/精益创业公司65%26
成长型公司55%22
企业45%18
大型官僚组织35%14

Sanity Check Bounds

合理性校验边界

MetricToo ConservativeTarget RangeToo Aggressive
Effective lines/hour (LOC / total hours)< 1215-30> 40
指标过于保守目标范围过于激进
有效编码速率(LOC/总时长,行/小时)< 1215-30> 40

Claude ROI Constants

Claude ROI 常量

ParameterValueNotes
Claude coding speed200-500 lines/hrFallback when no git history
Claude coding speed (midpoint)350 lines/hrUsed for LOC-based hour estimate
Human baseline rate for comparison150 $/hrSenior engineer, used in savings calc
Claude subscription range$20-200/monthPro to Team plans

参数备注
Claude编码速度200-500 行/小时无git历史时的兜底值
Claude编码速度(中间值)350 行/小时用于基于LOC的时长估算
对比用人类工程师基准费率150 美元/小时资深工程师费率,用于成本节省计算
Claude订阅价格范围20-200 美元/月Pro到Team套餐

Helper Scripts

辅助脚本

Three Python scripts in
.claude/skills/cost-estimate/helpers/
automate the heavy lifting. Use these instead of manual
find
,
wc -l
,
git log
, and inline math.
They work on any repo.
.claude/skills/cost-estimate/helpers/
目录下有三个Python脚本可自动完成繁重的计算工作。请使用这些脚本,不要手动执行
find
wc -l
git log
和内联计算。
它们适用于任何代码仓库。

1.
loc_counter.py
— Count lines of code

1.
loc_counter.py
— 统计代码行数

bash
undefined
bash
undefined

Full repo (respects .gitignore via git ls-files)

全仓库(通过git ls-files自动遵守.gitignore规则)

python3 .claude/skills/cost-estimate/helpers/loc_counter.py
python3 .claude/skills/cost-estimate/helpers/loc_counter.py

Branch diff (added lines only)

分支差异(仅统计新增行数)

python3 .claude/skills/cost-estimate/helpers/loc_counter.py --branch feat/foo
python3 .claude/skills/cost-estimate/helpers/loc_counter.py --branch feat/foo

Branch diff against specific base

与指定基准分支的差异

python3 .claude/skills/cost-estimate/helpers/loc_counter.py --branch feat/foo --base develop
python3 .claude/skills/cost-estimate/helpers/loc_counter.py --branch feat/foo --base develop

Single commit

单个提交

python3 .claude/skills/cost-estimate/helpers/loc_counter.py --commit abc1234
**Output (JSON):** `totals` (lines, files, test/doc/config/source breakdown), `by_language`, `by_directory`, `all_files` (with path, lines, category, is_test, is_doc, is_config flags).
python3 .claude/skills/cost-estimate/helpers/loc_counter.py --commit abc1234
**输出(JSON格式):** `totals`(行数、文件数、测试/文档/配置/源码拆分统计)、`by_language`(按语言统计)、`by_directory`(按目录统计)、`all_files`(包含路径、行数、分类、is_test、is_doc、is_config标记)。

2.
git_session_analyzer.py
— Estimate Claude active hours

2.
git_session_analyzer.py
— 估算Claude活跃时长

bash
undefined
bash
undefined

All commits on current branch

当前分支的所有提交

python3 .claude/skills/cost-estimate/helpers/git_session_analyzer.py
python3 .claude/skills/cost-estimate/helpers/git_session_analyzer.py

Specific branch

指定分支

python3 .claude/skills/cost-estimate/helpers/git_session_analyzer.py --branch feat/foo
**Output (JSON):** `total_commits`, `total_sessions`, `estimated_active_hours`, `sessions[]` with date/start/end/commits/estimated_hours/subjects. Review the session estimates and adjust upward for large-scope commits (e.g. a single commit that adds 5000 lines should count as more than 1 hour).
python3 .claude/skills/cost-estimate/helpers/git_session_analyzer.py --branch feat/foo
**输出(JSON格式):** `total_commits`(总提交数)、`total_sessions`(总会话数)、`estimated_active_hours`(估算活跃时长)、`sessions[]`(包含日期、开始时间、结束时间、提交数、估算时长、提交主题)。请检查会话估算结果,对于大范围改动的提交适当调增时长(例如单次提交新增5000行代码的情况,时长统计应该超过1小时)。

3.
cost_calculator.py
— Calculate costs from categorized LOC

3.
cost_calculator.py
— 根据分类后的LOC计算成本

bash
undefined
bash
undefined

Pipe categories as JSON

传入分类后的JSON数据

echo '{"audio_video_processing": 2000, "business_logic": 5000, ...}' |
python3 .claude/skills/cost-estimate/helpers/cost_calculator.py --rate 150 --claude-hours 29
**Valid category keys:** `simple_crud_ui_boilerplate`, `standard_views`, `complex_ui`, `business_logic`, `database_persistence`, `audio_video_processing`, `gpu_shader`, `native_interop`, `system_extensions`, `on_device_ml`, `tests`, `config_build`, `documentation`

**Output (JSON):** `base_coding` (rows with category/lines/rate/hours), `overhead` (rows), `total_estimated_hours`, `sanity_check`, `calendar_time`, `engineering_cost`, `team_costs` (per stage with role breakdowns), `claude_roi` (if --claude-hours given).
echo '{"audio_video_processing": 2000, "business_logic": 5000, ...}' |
python3 .claude/skills/cost-estimate/helpers/cost_calculator.py --rate 150 --claude-hours 29
**有效的分类键:** `simple_crud_ui_boilerplate`, `standard_views`, `complex_ui`, `business_logic`, `database_persistence`, `audio_video_processing`, `gpu_shader`, `native_interop`, `system_extensions`, `on_device_ml`, `tests`, `config_build`, `documentation`

**输出(JSON格式):** `base_coding`(包含分类、行数、速率、时长的列表)、`overhead`(开销列表)、`total_estimated_hours`(总估算时长)、`sanity_check`(合理性校验结果)、`calendar_time`(日历时间)、`engineering_cost`(工程成本)、`team_costs`(各阶段团队成本拆分)、`claude_roi`(如果传入--claude-hours参数则返回)。

4.
report_generator.py
— Generate markdown report sections

4.
report_generator.py
— 生成Markdown报告模块

bash
undefined
bash
undefined

Full report from calculator + session data

基于计算器和会话数据生成完整报告

python3 .claude/skills/cost-estimate/helpers/report_generator.py
--calc costs.json --sessions sessions.json --project "MyApp" --scope "Full codebase"
python3 .claude/skills/cost-estimate/helpers/report_generator.py
--calc costs.json --sessions sessions.json --project "MyApp" --scope "Full codebase"

Single section only

仅生成单个模块

python3 .claude/skills/cost-estimate/helpers/report_generator.py
--calc costs.json --section executive_summary
python3 .claude/skills/cost-estimate/helpers/report_generator.py
--calc costs.json --section executive_summary

Pipe directly from calculator

直接从计算器输出管道生成

echo '{"business_logic": 5000}' | python3 cost_calculator.py --rate 150 --claude-hours 29 |
python3 report_generator.py --project "MyApp"
**Available sections:** `executive_summary`, `development_time`, `calendar_time`, `engineering_cost`, `team_cost`, `grand_total`, `claude_roi`, `assumptions`

**Output:** Ready-to-paste markdown. Review, add complexity factors, market research rationale, and codebase metrics (which are project-specific and come from Step 1).
echo '{"business_logic": 5000}' | python3 cost_calculator.py --rate 150 --claude-hours 29 |
python3 report_generator.py --project "MyApp"
**可用模块:** `executive_summary`, `development_time`, `calendar_time`, `engineering_cost`, `team_cost`, `grand_total`, `claude_roi`, `assumptions`

**输出:** 可直接粘贴使用的Markdown内容。请检查内容,补充复杂度因素、市场调研依据和代码库指标(这些是项目特有信息,来自步骤1)。

Recommended Workflow

推荐工作流

bash
undefined
bash
undefined

1. Count LOC

1. 统计LOC

python3 .claude/skills/cost-estimate/helpers/loc_counter.py > /tmp/loc.json
python3 .claude/skills/cost-estimate/helpers/loc_counter.py > /tmp/loc.json

2. Analyze git sessions

2. 分析git会话

python3 .claude/skills/cost-estimate/helpers/git_session_analyzer.py > /tmp/sessions.json
python3 .claude/skills/cost-estimate/helpers/git_session_analyzer.py > /tmp/sessions.json

3. Classify files into categories (done manually from loc.json)

3. 将文件分类到对应类别(根据loc.json手动完成)

Then pipe to calculator:

然后传入计算器:

echo '{"category": lines, ...}' |
python3 .claude/skills/cost-estimate/helpers/cost_calculator.py
--rate 150 --claude-hours 29 > /tmp/calc.json
echo '{"category": lines, ...}' |
python3 .claude/skills/cost-estimate/helpers/cost_calculator.py
--rate 150 --claude-hours 29 > /tmp/calc.json

4. Generate report sections

4. 生成报告模块

python3 .claude/skills/cost-estimate/helpers/report_generator.py
--calc /tmp/calc.json --sessions /tmp/sessions.json --project "MyApp"

The main job is: **classify files into categories** (the creative/judgment part) and **add context** (complexity factors, market research, codebase description). The math and formatting are handled by the scripts.

---
python3 .claude/skills/cost-estimate/helpers/report_generator.py
--calc /tmp/calc.json --sessions /tmp/sessions.json --project "MyApp"

主要工作是:**将文件分类到对应类别**(需要主观判断的部分)和**补充上下文信息**(复杂度因素、市场调研、代码库描述)。计算和格式排版都由脚本处理。

---

Step 0: Determine Scope

步骤0:确定估算范围

Check the user's input for scope specifiers:
  • No arguments (default): Estimate the entire codebase.
  • branch:<name>
    : Estimate only the diff introduced by that branch (added lines only).
  • commit:<hash>
    : Estimate only the diff for that single commit (added lines only).
The
loc_counter.py
script handles all three modes via
--branch
and
--commit
flags.
检查用户输入中的范围说明:
  • 无参数(默认):估算整个代码库。
  • branch:<name>
    :仅估算该分支引入的差异(仅统计新增行数)。
  • commit:<hash>
    :仅估算单次提交的差异(仅统计新增行数)。
loc_counter.py
脚本通过
--branch
--commit
参数支持所有三种模式。

Step 1: Analyze the Codebase

步骤1:分析代码库

Run
loc_counter.py
to get a complete breakdown. Then review the output to:
  1. Identify the primary languages from
    by_language
  2. Understand the directory structure from
    by_directory
  3. Note test/doc/config splits from
    totals
  4. Identify complexity factors — scan the
    all_files
    list for signs of advanced work (GPU code, system extensions, audio/video pipelines, ML inference, native interop, complex UI, etc.)
  5. Detect project name from the repo directory name or top-level config files
运行
loc_counter.py
获取完整的统计拆分。然后检查输出完成以下工作:
  1. by_language
    中识别主要开发语言
  2. by_directory
    中了解目录结构
  3. totals
    中记录测试/文档/配置的拆分占比
  4. 识别复杂度因素——扫描
    all_files
    列表,寻找高级开发工作的迹象(GPU代码、系统扩展、音视频管线、ML推理、原生交互、复杂UI等)
  5. 从仓库目录名或顶层配置文件中识别项目名称

Step 2: Classify and Calculate Development Hours

步骤2:分类并计算开发时长

Review the
all_files
output from Step 1 and classify each file (or group of files) into categories from the Coding Productivity Rates table. Build a JSON object mapping category keys to line counts, then pipe it to
cost_calculator.py
.
These rates represent pure focused coding output — fingers on keyboard, writing code with modern IDE autocomplete. All thinking, debugging, reviewing, and design time is captured by the overhead multipliers — do not bake overhead into rates or it will be double-counted.
The calculator handles: base hours, overhead multipliers, sanity check, calendar time, engineering cost, and full team costs. Review the
sanity_check
in the output — if it fails, adjust your category assignments.
Every source line must be assigned to exactly one category. Do not double-count.
检查步骤1输出的
all_files
结果,将每个文件(或文件组)归类到编码生产率表中的对应类别。构建一个JSON对象,将分类键映射到行数,然后将其传入
cost_calculator.py
这些速率代表纯专注编码产出——即手指放在键盘上,使用现代IDE自动补全编写代码的速度。所有思考、调试、评审、设计时间都由开销乘数覆盖,不要将开销计入速率中,否则会导致重复计算。
计算器会处理:基础时长、开销乘数、合理性校验、日历时间、工程成本和全团队成本。检查输出中的
sanity_check
结果——如果校验不通过,请调整你的分类赋值。
每一行源码必须且仅能分配到一个类别,不要重复统计。

Step 3: Market Rates

步骤3:市场费率

Start with the Hourly Market Rates by Role from the Configuration section as baseline defaults.
Ask the user: "Use built-in market rates, or search the web for current rates for your tech stack/region?"
  • Built-in rates — use the Configuration section defaults as-is (faster, no web dependency)
  • Web research — use WebSearch to validate or adjust for:
    • The specific tech stack detected in Step 1
    • Geographic variations (US markets: SF Bay Area, NYC, Austin, Remote)
    • Contractor vs. employee rates
If the user chooses web research, search for:
  • "senior full stack developer hourly rate 2025"
  • "senior software engineer hourly rate United States 2025"
  • "[detected language/platform] developer contractor rate 2025"
If web search results differ significantly from the config defaults, note the discrepancy and use the researched rates. Otherwise, use the config defaults.
以配置部分的各角色市场时薪作为默认基准。
询问用户:"使用内置市场费率,还是搜索网页获取你所在技术栈/地区的当前费率?"
  • 内置费率——直接使用配置部分的默认值(速度更快,无需依赖网络)
  • 网络调研——使用WebSearch验证或调整以下维度的费率:
    • 步骤1中检测到的特定技术栈
    • 地理差异(美国市场:旧金山湾区、纽约、奥斯汀、远程)
    • 外包vs全职员工费率
如果用户选择网络调研,请搜索以下内容:
  • "2025年资深全栈开发者时薪"
  • "2025年美国资深软件工程师时薪"
  • "[检测到的语言/平台] 2025年外包开发者费率"
如果网络搜索结果与配置默认值差异较大,请标注差异并使用调研得到的费率,否则使用配置默认值。

Step 4: Calculate Organizational Overhead

步骤4:计算组织开销

Real companies don't have developers coding 40 hours/week. Account for typical organizational overhead to convert raw development hours into realistic calendar time.
Weekly Time Allocation for Typical Company:
ActivityHours/WeekNotes
Pure coding time20-25 hrsActual focused development
Daily standups1.25 hrs15 min x 5 days
Weekly team sync1-2 hrsAll-hands, team meetings
1:1s with manager0.5-1 hrWeekly or biweekly
Sprint planning/retro1-2 hrsPer week average
Code reviews (giving)2-3 hrsReviewing teammates' work
Slack/email/async3-5 hrsCommunication overhead
Context switching2-4 hrsInterruptions, task switching
Ad-hoc meetings1-2 hrsUnplanned discussions
Admin/HR/tooling1-2 hrsTimesheets, tools, access requests
Use the Organizational Efficiency table from the Configuration section for coding hours per week by company type.
Calendar Weeks Calculation:
Calendar Weeks = Raw Dev Hours / Effective Coding Hrs/Week (from config)
现实中的公司不会让开发者每周编码40小时。需要计入典型的组织开销,将原始开发时长转换为符合实际的日历时间。
典型公司的每周时间分配:
活动每周时长备注
纯编码时间20-25 小时实际专注开发
每日站会1.25 小时每天15分钟,共5天
每周团队同步会1-2 小时全员会、团队会议
和经理的1对1沟通0.5-1 小时每周或每两周一次
Sprint规划/复盘会1-2 小时每周平均
代码评审(评审他人代码)2-3 小时评审队友的工作
Slack/邮件/异步沟通3-5 小时沟通开销
上下文切换2-4 小时中断、任务切换
临时会议1-2 小时计划外讨论
行政/HR/工具相关工作1-2 小时工时填报、工具使用、权限申请
使用配置部分的组织效率表获取不同公司类型的每周编码时长。
日历周计算公式:
日历周 = 原始开发时长 / 每周有效编码时长(来自配置)

Step 5: Calculate Full Team Cost

步骤5:计算全团队成本

Engineering doesn't ship products alone. Use the Role Ratios and Hourly Market Rates by Role from the Configuration section to calculate the fully-loaded team cost.
For each company stage:
  1. Look up the role ratio % from the config's Role Ratios table
  2. Multiply engineering hours by that % to get each role's hours
  3. Multiply each role's hours by the Mid rate from the Hourly Market Rates table
  4. Sum all roles for Full Team Cost, or use the Full Team Multiplier shortcut
Calculation:
Full Team Cost = Engineering Cost x Full Team Multiplier (from config)
仅靠工程团队无法交付产品。使用配置部分的角色占比各角色市场时薪计算全负载的团队成本。
针对每个公司阶段:
  1. 从配置的角色占比表中查询对应角色的占比百分比
  2. 将工程时长乘以该百分比得到每个角色的时长
  3. 将每个角色的时长乘以市场时薪表中的中位费率
  4. 累加所有角色的成本得到全团队成本,也可以使用全团队乘数快捷计算
计算公式:
全团队成本 = 工程成本 x 全团队乘数(来自配置)

Step 6: Generate Cost Estimate

步骤6:生成成本估算报告

Detect the project name from the repository (directory name, package manifest, or top-level config).
IMPORTANT: The report MUST lead with the Executive Summary and Claude ROI at the very top. The detailed breakdowns come after. This is the required report structure:

从仓库中识别项目名称(目录名、包清单文件或顶层配置)。
重要提示:报告必须在最开头放置执行摘要和Claude ROI部分,详细拆分放在后面。 以下是要求的报告结构:

[Project Name] - Development Cost Estimate

[项目名称] - 开发成本估算

Analysis Date: [Current Date] Scope: [Full codebase / Branch
<name>
(diff from
<base>
) / Commit
<hash>
]

分析日期: [当前日期] 范围: [全代码库 / 分支
<name>
(与
<base>
的差异) / 提交
<hash>
]

Executive Summary

执行摘要

MetricValue
Codebase[X] lines of [language] across [X] files
Engineering hours[X] hours
Engineering cost (avg)$[X,XXX]
Full team cost (Growth Co)$[X,XXX]
Calendar time (solo dev)~[X] months
指标
代码库[X] 行 [语言] 代码,共 [X] 个文件
工程时长[X] 小时
工程成本(平均值)$[X,XXX]
全团队成本(成长型公司)$[X,XXX]
日历时长(独立开发者)~[X] 个月

Claude ROI

Claude ROI

MetricValue
Claude active hours~[X] hours (across [X] calendar days)
Speed multiplier[X]x faster than human developer
Value per Claude hour$[X,XXX]/hr (engineering)
ROI[X]x ($[X]k value for ~$[X] in Claude costs)
Claude worked ~[X] hours and produced $[X] of professional development value = $[X,XXX] per Claude hour

指标
Claude活跃时长~[X] 小时(共 [X] 个自然日)
速度倍数比人类开发者快 [X] 倍
每Claude小时价值[X,XXX] 美元/小时(仅工程成本)
ROI[X] 倍(投入约 [X] 美元Claude成本,产出 [X] 千美元价值)
Claude工作了约 [X] 小时,产出了 $[X] 的专业开发价值 = 每Claude小时价值 $[X,XXX]

Grand Total Summary

总览摘要

MetricSoloLean StartupGrowth CoEnterprise
Calendar Time[X][X][X][X]
Total Human Hours[X][X][X][X]
Total Cost$[X]$[X]$[X]$[X]

Detailed breakdown follows.

指标独立开发者精益创业公司成长型公司企业
日历时长[X][X][X][X]
总人力时长[X][X][X][X]
总成本$[X]$[X]$[X]$[X]

详细拆分见下文

Codebase Metrics

代码库指标

  • Total Lines of Code: [number] ([scope context: "in repository" or "in diff"])
    • [Language 1]: [number] lines
    • [Language 2]: [number] lines
    • Tests: [number] lines
    • Config/Build: [number] lines
    • Documentation: [number] lines
  • Complexity Factors:
    • [Auto-detected factor 1, e.g. "Audio/video processing pipeline"]
    • [Auto-detected factor 2, e.g. "System extension architecture"]
    • [Auto-detected factor 3, e.g. "Third-party API integrations"]
  • 总代码行数: [数字]([范围上下文: "仓库内"或"差异中"])
    • [语言1]: [数字] 行
    • [语言2]: [数字] 行
    • 测试: [数字] 行
    • 配置/构建: [数字] 行
    • 文档: [数字] 行
  • 复杂度因素:
    • [自动检测到的因素1,例如"音视频处理管线"]
    • [自动检测到的因素2,例如"系统扩展架构"]
    • [自动检测到的因素3,例如"第三方API集成"]

Development Time Estimate

开发时长估算

Base Development Hours: [number] hours
Code CategoryLinesRate (lines/hr)Hours
[Category 1][X][X][X]
[Category 2][X][X][X]
............
Total Base[X][X]
Overhead Multipliers:
  • Architecture & Design: +[X]% ([hours] hours)
  • Debugging & Troubleshooting: +[X]% ([hours] hours)
  • Code Review & Refactoring: +[X]% ([hours] hours)
  • Documentation: +[X]% ([hours] hours)
  • Integration & Testing: +[X]% ([hours] hours)
  • Learning Curve: +[X]% ([hours] hours)
Total Estimated Hours: [number] hours
Sanity Check: [total LOC] / [total hours] = [X] effective lines/hour [PASS: within 15-30 range / ADJUST: outside range, explain adjustment]
基础开发时长: [数字] 小时
代码类别行数速率(行/小时)时长
[类别1][X][X][X]
[类别2][X][X][X]
............
总计基础时长[X][X]
开销乘数:
  • 架构与设计: +[X]%([时长] 小时)
  • 调试与问题排查: +[X]%([时长] 小时)
  • 代码评审与重构: +[X]%([时长] 小时)
  • 文档编写: +[X]%([时长] 小时)
  • 集成与测试: +[X]%([时长] 小时)
  • 学习曲线: +[X]%([时长] 小时)
总估算时长: [数字] 小时
合理性校验: [总LOC] / [总时长] = [X] 有效行/小时 [通过: 处于15-30区间内 / 需调整: 超出区间,说明调整原因]

Realistic Calendar Time (with Organizational Overhead)

实际日历时长(包含组织开销)

Company TypeEfficiencyCoding Hrs/WeekCalendar WeeksCalendar Time
Solo/Startup (lean)65%26 hrs[X] weeks~[X] months
Growth Company55%22 hrs[X] weeks~[X] years
Enterprise45%18 hrs[X] weeks~[X] years
Large Bureaucracy35%14 hrs[X] weeks~[X] years
公司类型效率每周编码时长日历周日历时长
独立开发者/精益创业公司65%26 小时[X] 周~[X] 个月
成长型公司55%22 小时[X] 周~[X] 年
企业45%18 小时[X] 周~[X] 年
大型官僚组织35%14 小时[X] 周~[X] 年

Market Rate Research

市场费率调研

Senior Developer Rates (2025):
  • Low end: $[X]/hour (remote, mid-level market)
  • Average: $[X]/hour (standard US market)
  • High end: $[X]/hour (SF Bay Area, NYC, specialized)
Recommended Rate for This Project: $[X]/hour
Rationale: [Based on detected tech stack complexity and specialization requirements]
2025年资深开发者费率:
  • 低端: $[X]/小时(远程,中等市场)
  • 平均: $[X]/小时(美国标准市场)
  • 高端: $[X]/小时(旧金山湾区、纽约,专业领域)
本项目推荐费率: $[X]/小时
依据: [基于检测到的技术栈复杂度和专业要求]

Total Cost Estimate (Engineering Only)

总成本估算(仅工程团队)

ScenarioHourly RateTotal HoursTotal Cost
Low-end$[X][hours]$[X,XXX]
Average$[X][hours]$[X,XXX]
High-end$[X][hours]$[X,XXX]
Recommended Estimate (Engineering Only): $[X,XXX] - $[X,XXX]
场景时薪总时长总成本
低端$[X][时长]$[X,XXX]
平均$[X][时长]$[X,XXX]
高端$[X][时长]$[X,XXX]
推荐估算值(仅工程团队): $[X,XXX] - $[X,XXX]

Full Team Cost (All Roles)

全团队成本(所有角色)

Company StageTeam MultiplierEngineering CostFull Team Cost
Solo/Founder1.0x$[X]$[X]
Lean Startup1.45x$[X]$[X]
Growth Company2.2x$[X]$[X]
Enterprise2.65x$[X]$[X]
Role Breakdown (Growth Company Example):
RoleHoursRateCost
Engineering[X] hrs$[X]/hr$[X]
Product Management[X] hrs$[X]/hr$[X]
UX/UI Design[X] hrs$[X]/hr$[X]
Engineering Management[X] hrs$[X]/hr$[X]
QA/Testing[X] hrs$[X]/hr$[X]
Project Management[X] hrs$[X]/hr$[X]
Technical Writing[X] hrs$[X]/hr$[X]
DevOps/Platform[X] hrs$[X]/hr$[X]
TOTAL[X] hrs$[X]
公司阶段团队乘数工程成本全团队成本
独立开发者/创始人1.0x$[X]$[X]
精益创业公司1.45x$[X]$[X]
成长型公司2.2x$[X]$[X]
企业2.65x$[X]$[X]
角色拆分(成长型公司示例):
角色时长费率成本
工程团队[X] 小时$[X]/小时$[X]
产品经理[X] 小时$[X]/小时$[X]
UX/UI设计[X] 小时$[X]/小时$[X]
工程管理[X] 小时$[X]/小时$[X]
QA/测试[X] 小时$[X]/小时$[X]
项目管理[X] 小时$[X]/小时$[X]
技术写作[X] 小时$[X]/小时$[X]
DevOps/平台工程[X] 小时$[X]/小时$[X]
总计[X] 小时$[X]

Claude ROI Analysis (Detailed)

Claude ROI分析(详细)

Project Timeline:
  • First commit / project start: [date]
  • Latest commit: [date]
  • Total calendar time: [X] days ([X] weeks)
Claude Active Hours Estimate:
  • Total sessions identified: [X] sessions
  • Estimated active hours: [X] hours
  • Method: [git clustering / file timestamps / LOC estimate]
Value per Claude Hour:
Value BasisTotal ValueClaude Hours$/Claude Hour
Engineering only$[X][X] hrs$[X,XXX]/Claude hr
Full team (Growth Co)$[X][X] hrs$[X,XXX]/Claude hr
Speed vs. Human Developer:
  • Estimated human hours for same work: [X] hours
  • Claude active hours: [X] hours
  • Speed multiplier: [X]x (Claude was [X]x faster)
Cost Comparison:
  • Human developer cost: $[X] (at config baseline rate)
  • Estimated Claude cost: $[X] (subscription + API)
  • Net savings: $[X]
  • ROI: [X]x (every $1 spent on Claude produced $[X] of value)
项目时间线:
  • 首次提交/项目启动: [日期]
  • 最新提交: [日期]
  • 总日历时长: [X] 天([X] 周)
Claude活跃时长估算:
  • 识别到的总会话数: [X] 个会话
  • 估算活跃时长: [X] 小时
  • 计算方式: [git聚类 / 文件时间戳 / LOC估算]
每Claude小时价值:
价值基准总价值Claude时长每Claude小时美元价值
仅工程成本$[X][X] 小时$[X,XXX]/Claude小时
全团队(成长型公司)$[X][X] 小时$[X,XXX]/Claude小时
与人类开发者的速度对比:
  • 同等工作量的估算人类时长: [X] 小时
  • Claude活跃时长: [X] 小时
  • 速度倍数: [X]x(Claude快 [X] 倍)
成本对比:
  • 人类开发者成本: $[X](按配置基准费率)
  • 估算Claude成本: $[X](订阅+API费用)
  • 净节省: $[X]
  • ROI: [X]x(每投入1美元到Claude,产出 [X] 美元价值)

Assumptions

假设条件

  1. Rates based on US market averages (2025)
  2. Full-time equivalent allocation for all roles
  3. Does not include:
    • Marketing & sales
    • Legal & compliance
    • Office/equipment
    • Hosting/infrastructure
    • Ongoing maintenance post-launch

  1. 费率基于2025年美国市场平均水平
  2. 所有角色均为全职等效投入
  3. 不包含:
    • 营销与销售
    • 法律与合规
    • 办公场地/设备
    • 托管/基础设施费用
    • 上线后的持续维护成本

Step 7: Calculate Claude ROI — Value Per Claude Hour

步骤7:计算Claude ROI — 每Claude小时价值

This is the most important metric for understanding AI-assisted development efficiency. It answers: "What did each hour of Claude's actual working time produce?"
IMPORTANT: The Claude ROI results must appear in TWO places in the report:
  1. Executive Summary at the very top (compact table format)
  2. Claude ROI Analysis (Detailed) section with full breakdown
Calculate all ROI values in this step, then populate both sections when writing the report.
这是了解AI辅助开发效率最重要的指标,它回答了:"Claude每实际工作一小时能产出多少价值?"
重要提示:Claude ROI结果必须出现在报告的两个位置:
  1. 最顶部的执行摘要(紧凑表格格式)
  2. Claude ROI分析(详细) 部分(完整拆分)
在本步骤计算所有ROI值,然后在编写报告时填充到两个部分中。

7a: Determine Actual Claude Clock Time

7a:确定Claude实际工作时长

Run
git_session_analyzer.py
to automatically cluster commits into sessions and estimate active hours:
bash
python3 .claude/skills/cost-estimate/helpers/git_session_analyzer.py
Review the output sessions and adjust estimates upward for commits with large scope (e.g. a single commit adding thousands of lines likely took 2-4 hours, not 1 hour). Use
git show <hash> --stat
to check the scope of low-commit sessions.
Fallback (no git): Estimate from LOC using the Claude ROI Constants:
Claude active hours = Total LOC / 350 lines/hr
运行
git_session_analyzer.py
自动将提交聚类为会话并估算活跃时长:
bash
python3 .claude/skills/cost-estimate/helpers/git_session_analyzer.py
检查输出的会话,对于大范围改动的提交适当调增估算时长(例如单次提交新增数千行代码的情况,可能需要2-4小时,而不是1小时)。使用
git show <hash> --stat
检查提交数少的会话的改动范围。
兜底方案(无git历史): 使用Claude ROI常量基于LOC估算:
Claude活跃时长 = 总LOC / 350 行/小时

7b: Calculate ROI

7b:计算ROI

Pass
--claude-hours
to
cost_calculator.py
(in Step 2) to get the full ROI breakdown automatically. The calculator computes speed multiplier, value per Claude hour, cost comparison, and savings.

在步骤2中向
cost_calculator.py
传入
--claude-hours
参数即可自动获取完整的ROI拆分。计算器会计算速度倍数、每Claude小时价值、成本对比和成本节省。

Notes

注意事项

Present the estimate in a clear, professional format suitable for sharing with stakeholders. Include confidence intervals and key assumptions. Highlight areas of highest complexity that drive cost.
IMPORTANT — Dollar Sign Escaping: Always escape
$
as
\$
in the final markdown report. Bare
$
characters are interpreted as LaTeX math delimiters by many markdown renderers (GitHub, VS Code, etc.), which mangles currency values. The
report_generator.py
fmt()
function handles this automatically, but when writing prose sections manually (e.g., market rate research, rationale text, assumptions), always use
\$
for currency.
以清晰、专业的格式呈现估算结果,适合分享给相关方。包含置信区间和关键假设。突出驱动成本的最高复杂度区域。
重要提示——美元符号转义: 在最终的Markdown报告中,始终将
$
转义为
\$
。很多Markdown渲染器(GitHub、VS Code等)会将未转义的
$
识别为LaTeX数学分隔符,导致货币值显示错误。
report_generator.py
fmt()
函数会自动处理转义,但手动编写的文本部分(例如市场费率调研、依据文本、假设条件)中,请始终使用
\$
表示货币符号。