update-active

update-active is a command for Claude Code from franciszhangkk/claude-obsidian-multi-repo-tracker. It costs 33 tokens per session (916 once invoked), scanned A, original, MIT.

A command that reads recent Git commits and file changes, drafts a one-line description of the work in activeContext.md, and asks you to confirm it.

In plain words
What is it for?
Use it to record what you are working on and which stage it is in, based on recent Git activity.
Why use it?
It keeps the current-focus note up to date without making you write it from scratch after every task switch or conversation.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool.

Good fit Use it to record what you are working on and which stage it is in, based on recent Git activity.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/franciszhangkk/claude-obsidian-multi-repo-tracker/update-active
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.

Clone the repo
git clone --depth 1 https://github.com/franciszhangkk/claude-obsidian-multi-repo-tracker

Made for: Claude Code.

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 update-active

README.md
[![agentmods](https://agentmods.dev/badge/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/update-active/github.svg)](https://agentmods.dev/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/update-active)
Your own site
<a href="https://agentmods.dev/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/update-active"><img src="https://agentmods.dev/badge/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/update-active/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 update-active

Your own site · 80×15
<a href="https://agentmods.dev/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/update-active"><img src="https://agentmods.dev/badge/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/update-active.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 916 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.00033 $0.00916
Opus 5 $0.00016 $0.00458
Sonnet 5 $0.00007 $0.00183
Haiku 4.5 $0.00003 $0.00092

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

Security

Grade A, and why

update-active 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.

commands/update-active.md · 106 lines

What it actually says

/update-active — 更新当前焦点

何时调:切换任务、开始新功能、上次对话结束后。/commit 也会自动触发一次精简版。

设计原则:agent 产生草稿,用户只做确认或微调——不让用户从零打内容。

执行流程

1. 定位 vault 和项目

CODE_ROOT=$(git rev-parse --show-toplevel)
VAULT_PATH="${OBSIDIAN_VAULT_PATH:-}"

从 vault CLAUDE.md 映射表找到对应的 obsidian_project_path(同 sync-docs 第 2 步)。

找不到时用 AskUserQuestion 让用户选。

2. 读取信号(~300 token)

git log --oneline --no-merges -5      # 最近 commit 在做什么
git status --short                     # 现在改动的是哪些文件
git diff --stat HEAD                   # 未提交改动量级

同时读 activeContext.md 现有的"当前焦点"段(了解上一次写的是什么,避免重复)。

3. 生成焦点草稿

综合信号推断一句话草稿,格式:

<动作>:<具体在做什么>,<阶段>

例:

  • Memory 优化:去除幻觉 + 偏好晋升机制,联调测试中
  • query-material-data skill 拆分:SQL 层完成,接入 skillruntime 中
  • 定时任务 API 联调:ad-plus-media-service ↔ ai-agents gRPC 接口对齐

推断规则

  • 最近 commit type 是 feat → 功能开发阶段
  • 最近 commit type 是 fix → 修复阶段
  • 有大量未提交改动(diff 行数 > 100)→ 开发进行中
  • 文件路径含 test / _test.go → 测试阶段
  • 同一目录集中改动 → 聚焦该模块

4. 展示草稿,等待确认

当前焦点建议更新为:

  "Memory 优化:去除幻觉 + 偏好晋升机制,联调测试中"

→ 回车确认 / 输入新内容替换 / s 跳过

用 AskUserQuestion,选项:

  • 确认(使用以上内容)
  • 跳过(保持不变)
  • 自定义(other 输入)

5. 写入 activeContext.md

用 Edit 把"当前焦点"段内容替换:

## 当前焦点

<确认后的内容>

只动这一段,其他段(最近变更、下一步、阻塞)不动。

6. 输出报告

✅ 当前焦点已更新
   Memory 优化:去除幻觉 + 偏好晋升机制,联调测试中

   activeContext.md 已同步

如果用户跳过:

⏭️ 已跳过,当前焦点保持不变

注意事项

  • 只改"当前焦点"段:不动最近变更(/sync-docs 维护)、不动下一步、不动阻塞
  • 草稿推断失败时:直接让用户输入,不要强行生成无意义草稿
  • 已有内容优先:如果现有焦点和推断结果差不多(关键词重叠 > 50%),不主动建议更新,直接输出 当前焦点未变更,无需更新

与 /commit 的关系

/commit 成功后会自动调用本流程的精简版(省略第 2 步读 git,直接用 commit message 推断),token 成本约 200。独立调用 /update-active 适合没有 commit 但切换了任务的场景。

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 · 106 lines · 33 tokens per session scan A 7b66d7c9082d

Subscribe to this mod's changes

update-active is a command published in the GitHub repository franciszhangkk/claude-obsidian-multi-repo-tracker (2 stars, last pushed 4mo ago), licensed MIT. It adds 33 tokens to every session and 916 once invoked, about $0.0002 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-31.