opportunity-cost

opportunity-cost is a skill for Claude Code, Codex from kangarooking/duan-yongping-skill. It costs 159 tokens per session (2,687 once invoked), scanned A, original, MIT.

An investment decision framework based on opportunity cost: what your money could do in another investment today. It treats keeping an asset as choosing to buy it again at its current price, regardless of your original purchase price.

In plain words
What is it for?
Use it when deciding whether to sell, hold, take profits, cut losses, or switch between assets, especially when comparing a current holding with a better possible investment.
Why use it?
It removes purchase-price anchoring and avoids selling merely because an asset is profitable or holding because it is losing money. Decisions instead compare the asset with available alternatives and its future prospects.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when deciding whether to sell, hold, take profits, cut losses, or switch between assets, especially when comparing a current holding with a better possible investment.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kangarooking/duan-yongping-skill/opportunity-cost
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kangarooking/duan-yongping-skill --skill opportunity-cost
Clone the repo
git clone --depth 1 https://github.com/kangarooking/duan-yongping-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for opportunity-cost

README.md
[![agentmods](https://agentmods.dev/badge/skills/kangarooking/duan-yongping-skill/opportunity-cost/github.svg)](https://agentmods.dev/skills/kangarooking/duan-yongping-skill/opportunity-cost)
Your own site
<a href="https://agentmods.dev/skills/kangarooking/duan-yongping-skill/opportunity-cost"><img src="https://agentmods.dev/badge/skills/kangarooking/duan-yongping-skill/opportunity-cost/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for opportunity-cost

Your own site · 80×15
<a href="https://agentmods.dev/skills/kangarooking/duan-yongping-skill/opportunity-cost"><img src="https://agentmods.dev/badge/skills/kangarooking/duan-yongping-skill/opportunity-cost.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 159 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,687 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00159 $0.02687
Opus 5 $0.00079 $0.01344
Sonnet 5 $0.00032 $0.00537
Haiku 4.5 $0.00016 $0.00269

Measured 11d ago against content hash ff47c108705f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

opportunity-cost scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

investment-logic/opportunity-cost/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

机会成本决策框架(含持有=买入)

R — 原文 (Reading)

"每天的收盘价就是我们的机会成本,没有卖就等于买了,否则可以买其他。" "无论什么时候卖都不要和买的成本联系起来。该卖的理由可能有很多,唯一不该用的理由就是'我已经赚钱了'。" "理论上讲持有=买入其实不是一个观点而是一个事实。" "投资投什么其实是基于机会成本的。"

— 段永平, 第五章 估值逻辑 · 第5-6节


I — 方法论骨架 (Interpretation)

  1. 持有=买入是一个事实,不是观点。 你今天没有卖出某只股票,等同于你按今天的市价重新买入了一遍。你的钱不是"被套在里面",而是你主动选择了当前价格继续持有。
  2. 成本是沉没的。 买入价格与卖出决策无关。不管你50元买的还是100元买的,今天的决策基准只有一个:当前价格下,这只股票是否仍然是你最好的选择。
  3. 机会成本是买卖的统一标准。 卖出不是因为"赚够了"或"亏怕了",而是因为找到了更好的替代选项。"够不够便宜"由你自己的机会成本决定——你还能在哪里获得更高的长期回报。
  4. 从10年后看回来。 短期股价波动造成的焦虑,用10年视角来过滤。如果10年后这家公司仍然很强,今天的涨跌无关紧要。
  5. "不卖"不等于"永远不卖"。 发现买错了立刻卖、找到明显更好的替代则换仓,但绝不能因为浮盈浮亏而决策。

A1 — 书中的应用 (Past Application)

案例 1: "没有卖就等于买了"——忠旺换茅台

  • 问题: 公司同事们买了中国忠旺(约3块),段永平实地调研后判断商业模式一般、企业文化一般,建议卖出换成茅台或苹果。
  • 方法论的使用: 大部分人听了建议很快换了,但有人不舍得卖,总觉得"会有机会的"——这是典型的沉没成本陷阱(不願承认已有的亏损)。
  • 结论: "一转眼这么多年过去了……,机会成本刚刚的。"忠旺跌到1.46块,而茅台、苹果同期涨幅巨大。
  • 结果: 不换的人不仅亏了本金,更损失了本可以投资好公司的巨大机会成本。

案例 2: 持有网易8-9年的100倍回报

  • 问题: 网易从约1块涨到100多块,过程中每天都有"止盈"诱惑。
  • 方法论的使用: 段永平"可能每天都会被卖价所诱惑",但用"卖股票和成本无关"的道理抵抗住。判断标准只有"公司及其业务的未来现金流",不看买入成本、不看PE/PB。网易涨到20-30倍时他还继续追加。
  • 结论: 卖网易不是因为"赚够了",而是"需要换GE和Yahoo"——机会成本驱动,而非止盈逻辑。
  • 结果: 100倍回报。

案例 3: 达美航空的反思——"卖了苹果去买航空"

  • 问题: 段永平用多出来的现金买了1%达美航空。
  • 方法论的使用: 用持有=买入视角反思——"从买入=持有或者持有=买入的角度看,我当时买入航空公司,其实等于卖了苹果去买入航空公司"。10年视角看,这不是好决策。
  • 结论: "看来是自己内心的投机小心思躁动了一下。"持有航空"难受"因为"不知道时间到底站在哪一边",而持有苹果"股价怎么掉都不会介意"。
  • 结果: 跟随巴菲特卖出航空公司,承认生意模式判断有误。

A2 — 触发场景 (Future Trigger) ★

用户会在什么情境下需要这个 skill?

  1. 止盈/止损纠结: 用户持有某只股票已经赚了(或亏了)一定比例,在犹豫要不要卖,思考的依据是浮盈浮亏比例而非公司价值。
  2. 换仓犹豫: 用户发现了一个可能更好的标的,但因为当前持仓"还没赚回来"或"已经赚了舍不得卖",迟迟不做决策。
  3. 持仓焦虑: 用户因为市场波动而对现有持仓感到不安,频繁关注股价,但没有从公司基本面和机会成本角度思考过。

语言信号 (用户的话里出现这些就应激活)

  • "我已经赚了X%了,该不该止盈"
  • "这只股票还亏着,舍不得割肉"
  • "卖了怕涨、不卖怕跌" / "不知道该不该换"

与相邻 skill 的区分

  • dcf-valuation 的区别: DCF skill 解决"这家公司值多少钱",本 skill 解决"在当前价格下,持有它是不是我最好的选择"。DCF 给出价值判断,机会成本做出买卖决策。
  • ownership-mindset 的区别: 企业所有者视角解决"买什么"(用什么心态看待股票),本 skill 解决"什么时候买卖"(用什么标准做决策)。
  • equanimity-mindset 的区别: 平常心 skill 管情绪管理,本 skill 管决策逻辑。两者常同时触发,但本 skill 提供的是可执行的决策框架,不是情绪安抚。

Read the full file on GitHub · 137 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 137 lines · 159 tokens per session scan A ff47c108705f

Subscribe to this mod's changes

opportunity-cost is a skill published in the GitHub repository kangarooking/duan-yongping-skill (48 stars, last pushed 4mo ago), licensed MIT. It adds 159 tokens to every session and 2,687 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories