Agent skill

Repo Context Ledger

by gviiisen in gviiisen/repo-context-ledger

Record every behavior-changing feature addition, fix, and adjustment as durable, evidence-based repository knowledge, then use that ledger to continue accurately across AI windows, tools, Git…

MITAuto-check passedAgent Workflows

Install Repo Context Ledger

skills CLI
$ npx skills add gviiisen/repo-context-ledger --skill repo-context-ledger -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gviiisen/repo-context-ledger repo-context-ledger --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gviiisen/repo-context-ledger.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/repo-context-ledger .claude/skills/repo-context-ledger && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
repo-context-ledger
GitHub stars
105
Token cost
~2.8k tokens
SKILL.md length
1,409 words
Files
13 (incl. scripts, references, assets)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Record every behavior-changing feature addition, fix, and adjustment as durable, evidence-based repository knowledge, then use that ledger to continue accurately across AI windows, tools, Git…

  • Works in 9 steps: Keep the session ID and epoch from… → Follow an existing accepted plan. Run… → Start once when behavior will change and… → …
  • Tasks that involve Codebase knowledge for agents
  • SKILL.md covers First decide what is new —…, Runtime, Plan only when routing is needed and Non-negotiable safety, plus 5 more sections
  • Runs Python scripts from its folder; calls python

What it does

Repo Context Ledger is an agent skill from gviiisen/repo-context-ledger. Record every behavior-changing feature addition, fix, and adjustment as durable, evidence-based repository knowledge, then use that ledger to continue accurately across AI windows, tools, Git collaboration, and pull requests. Use the deterministic runtime to route bounded context, isolate private drafts, publish verified change records, refresh stable feature knowledge, and keep native Codex, Claude, Cursor, Copilot, Grok, and other Agent entry points aligned without asking the user to run bookkeeping commands.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 16 other files, including scripts, reference files and assets (for example `agents/openai.yaml`, `assets/context-pack-template.md` and `assets/handoff-template.md`).

It sits in Agent Workflows, covering Codebase knowledge for agents, Domain-driven design and Accounting and bookkeeping. It works with Git. The repository describes itself as: 面向 AI 上下文管理的 Agent Skill:为 Codex 上下文管理、Cursor 上下文切换和 Claude 上下文管理提供跨窗口续接,用 Git 保存可验证的功能说明与变更记录。AI coding context management and agent handoffs. The licence is MIT.

When your agent uses it

  • Tasks that involve Codebase knowledge for agents
  • Tasks that involve Domain-driven design
  • Tasks that involve Accounting and bookkeeping

Example prompts

  • “/repo-context-ledger”

Requirements

  • Python 3

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Keep the session ID and epoch from start/resume; use status only when this task's identity or state needs resolving. Pass --session on…
  2. Follow an existing accepted plan. Run context/focus only for missing or changed background, not again for every ordinary-work turn. A…
  3. Start once when behavior will change and there is no suitable unfinished task: start --title "" --feature --workflow --tool . Reuse only a…
  4. Implement after verifying the routed boundary in code. Context docs guide where to look; they never justify reading too little code.
  5. Choose acceptance goals before verification. Reads, searches, file/configuration generation, preparation, and authorized deployment use…
  6. Prefer an exact repository preset when configured. If PRESET_TRUST_REQUIRED appears, review it and repeat with its exact printed…
  7. A single-session small fix lets finish collect evidence. With parallel sessions or a broad dirty tree, run evidence --path for this task's…
  8. Refresh the related Pack and spec when their facts or dependencies changed. Update only the draft's new differences and correct superseded…
  9. Remove unresolved template placeholders and finish once the bounded request is actually complete, not at every intermediate reply: finish…

What it can do on your machine

Read from SKILL.md and the folder at commit a0eeb90. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Repo Context Ledger loads about 2.8k tokens when it runs, and up to ~14k if it reads all its reference files. Until then it costs about 134 tokens; SKILL.md has 1,409 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~134
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~14k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from gviiisen/repo-context-ledger at commit a0eeb90, republished under its MIT licence (© gviiisen). 1,409 words, ~2,816 tokens.

Download SKILL.mdSave it as .claude/skills/repo-context-ledger/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.
name
repo-context-ledger
description
Record every behavior-changing feature addition, fix, and adjustment as durable, evidence-based repository knowledge, then use that ledger to continue accurately across AI windows, tools, Git collaboration, and pull requests. Use the deterministic runtime to route bounded context, isolate private drafts, publish verified change records, refresh stable feature knowledge, and keep native Codex, Claude, Cursor, Copilot, Grok, and other Agent entry points aligned without asking the user to run bookkeeping commands.

Repo Context Ledger

Turn behavior-changing feature work into durable, code-verified repository knowledge. Git-tracked Packs, specs, and completed Changes form the feature change ledger; cross-window and cross-Agent continuation are capabilities built on that shared source. Private vendor Memory is never read or synchronized.

First decide what is new — without a Ledger call

Judge new facts/effects from the current request, loaded conversation, known task and inspected code, not similar wording. Do this mentally: no classifier command, extra document, or automatic Git/Markdown rescan.

  • Routine question/recheck/operation with sufficient context: answer or execute the authorized request normally, without a new Ledger lifecycle. Do not skip a requested recheck or infer permission to repeat side effects.
  • Same known unfinished task: keep its session/epoch and background; add only new changes, findings, decisions and checks. Same-window "continue" does not require resume or a new session.
  • Similar work with new behavior/inputs/paths: reuse the method, not a previous pass. Keep a suitable unfinished task; after publication create a new change record and reference relevant history. Independent deliverables stay separate.
  • Missing identity/background: query only what is missing. Paused tasks and actual handovers need resume; lifecycle writes still validate ownership/epoch. Resolve stale state rather than guessing.

Proceed when scope/identity are clear, without announcing a classification checklist. Reuse results only while relevant code, inputs, environment and acceptance phase remain valid. Changed conditions and time-sensitive safety checks need fresh verification; never relabel an old pass as new. Investigate uncertain code boundaries.

Runtime

Resolve this Skill directory. Its runtime is scripts/ledger.py. After initialization use the repository entry:

text
python .context-ledger/ledger.py <command>

Use python3 when needed. --repo is optional; discovery walks upward to the nearest .context-ledger/config.json and stops at nested Git boundaries.

In runtime.mode: global, that entry is a small forwarder to the Codex Skill under CODEX_HOME/skills (or the user's .codex/skills); configuration and records remain repository-local. If the entry is absent, invoke this installed Skill's runtime with explicit --repo <project>. Never initialize or copy an old runtime just to execute a command. See global-runtime.md only for runtime installation/migration.

Plan only when routing is needed

When the decision above leaves task identity or required context unresolved, run:

text
python .context-ledger/ledger.py plan --query "<user request>" --tool <agent>

Follow the returned workflow-plan-v1 mode and next_action:

  • readonly: load bounded context only; never create a session.
  • small-fix: start one short session, edit the known boundary, verify, finish.
  • ordinary-change: route the Pack/spec, start one session, implement, verify, refresh stable knowledge, finish.
  • resume: resume only one uniquely selected accessible session and keep its new epoch.

Automatic classification is guidance, not permission. If requires_confirmation is true, clarify the workflow or select a session; never guess. start --workflow readonly|resume must fail. context returns the same nested Workflow Plan, and resume --query uses the same owned-session route.

Non-negotiable safety

  • Never read, pause, resume, checkpoint, finish, invalidate, or expose another principal's private task unless an explicit unexpired grant permits that exact access.
  • Never message, delegate to, steer, or interrupt another user-owned Agent task unless the user explicitly requests cross-task coordination.
  • The ledger isolates documentation sessions only. It does not lock, copy, merge, or coordinate source-code edits; leave code conflicts to the host Agent and Git.
  • Read only Context Bundle required_reads initially. Never recursively load docs/ai, docs/specs, or docs/changes. This is a starting route, not a cap: expand through every behavior-relevant caller, implementation, configuration, persistence, permission, concurrency, retry, test, and external boundary.
  • Prefer code and executed verification over specs, specs over Packs, and Git-tracked knowledge over private Agent Memory.
  • Do not create a handoff for read-only analysis, questions, or formatting-only work.
  • Do not ask the user to run ledger bookkeeping commands.
  • One bounded logical request gets one session and one completed Change. Archive once, but update the same draft when meaningful facts emerge. Before a context/window switch, and after a changed diagnosis, key decision, or relevant failed approach, preserve the useful explanation while it is fresh. Use private checkpoints for continuation, not a new Change per step; do not combine unrelated requests or independently deliverable work just to reduce record counts.
Show full SKILL.md (759 more words)Show less

Change lifecycle

  1. Keep the session ID and epoch from start/resume; use status only when this task's identity or state needs resolving. Pass --session on lifecycle writes; never guess or absorb another task.
  2. Follow an existing accepted plan. Run context/focus only for missing or changed background, not again for every ordinary-work turn. A known code boundary needs no repeated broad routing.
  3. Start once when behavior will change and there is no suitable unfinished task: start --title "<title>" --feature <feature> --workflow <small-fix|ordinary-change> --tool <agent>. Reuse only a genuinely related task; never reopen a completed record to hide a new change.
  4. Implement after verifying the routed boundary in code. Context docs guide where to look; they never justify reading too little code.
  5. Choose acceptance goals before verification. Reads, searches, file/configuration generation, preparation, and authorized deployment use ordinary tools, not a verify wrapper per operation. Run acceptance through verify once when first needed; do not run it bare and repeat it just for a Ledger entry. Group related checks with an existing reviewed project script/preset, preserving step results and failure exit codes. Keep pre-deployment and post-deployment goals separate. Independent checks may run concurrently only without shared mutable resources; use direct argv, not nested shell strings.
  6. Prefer an exact repository preset when configured. If PRESET_TRUST_REQUIRED appears, review it and repeat with its exact printed --trust-digest; never trust without reviewing. Ordinary operations and useful diagnostic observations belong in the same draft as such, not fabricated managed check results. Never replay a deployment, authorization, migration, or trade to obtain missing logging. See verification-presets.md for grouping and the optional tested script example.
  7. A single-session small fix lets finish collect evidence. With parallel sessions or a broad dirty tree, run evidence --path for this task's paths only.
  8. Refresh the related Pack and spec when their facts or dependencies changed. Update only the draft's new differences and correct superseded assumptions; retain useful earlier reasoning rather than rewriting unchanged background. A small-fix form still explains each meaningful change, its file/symbol references, and documentation rationale. Only Updated is generated; share common boundaries and verification rather than repeating them.
  9. Remove unresolved template placeholders and finish once the bounded request is actually complete, not at every intermediate reply: finish --spec <spec>, or --no-spec --reason "<why no stable behavior exists>". Keep a returned continuation epoch on every resumed write.

Read production-workflow.md for large repositories, verification concurrency, PR baselines, coverage gates, and derived-index timing. Read writing-quality.md before editing an evidence-v1 draft.

Small is a known low-risk boundary, not a line count. Independent behavior changes, permissions, persistence, money, concurrency, public contracts, or uncertain impact need ordinary investigation and records. Expand the same draft when scope grows; preserve its notes and evidence, rather than finishing early or starting over. finish --dry-run is optional; do not make it a mandatory extra step or loop through it while still writing. Before finish, reconcile meaningful diff changes against the record; passing structural checks is not proof of complete business explanations.

Initialize or upgrade

Run init --dry-run, review the exact plan, then run the same init only when its scope is correct. Preserve prose outside managed markers and all existing completed history. Confirm adapters check, manifest check, and doctor. See document-model.md for legacy layouts and where facts belong.

Cross-window continuation

Before switching Agents or windows, run checkpoint --summary "<state>" --next "<action>"; use pause only when suspending the task. In the new window run plan --query "continue <keywords>", then its explicit resume action. Resume increments the epoch; it does not create a replacement session.

"Continue" inside the same active window is not a handover. If the task and current epoch are already known, continue directly; resume only for an actual handover, paused task, or state recovery.

If several sessions are close matches, choose an explicit session. If only foreign work overlaps, use committed Pack/spec/Change guidance. Private unfinished state does not travel with clone, pull, or another computer.

Integration and recovery

  • Use doctor first for bounded read-only diagnosis. It never deletes locks or mutates Packs/sessions.
  • At PR/integration time run policy --base <ref> for aggregate delta-based checks. Use audit --history --policy as-recorded --fail-on unresolved only for controlled historical/release audits, never to unblock an unrelated session.
  • After merge, run sync --derived once on the configured default branch. Do not hand-edit generated indexes.
  • Keep unfinished drafts private. Publish only through finish; never persist secrets or machine-specific absolute paths.

Runtime development

Edit src/repo_context_ledger/runtime.py.tmpl and its ordered source fragments, not generated runtimes. Run python scripts/build_runtime.py and python scripts/build_runtime.py --check; .context-ledger/ledger.py and the Skill runtime must remain byte-identical standalone files.

© gviiisen, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 12 other files (scripts, references, assets) in skills/repo-context-ledger of gviiisen/repo-context-ledger.

  • SKILL.md
  • agents/openai.yaml
  • assets/context-pack-template.md
  • assets/handoff-template.md
  • assets/project-context-template.md
  • assets/spec-template.md
  • assets/verify-change.py
  • references/document-model.md
  • references/global-runtime.md
  • references/production-workflow.md
  • references/verification-presets.md
  • references/writing-quality.md
  • scripts/ledger.py

Open the folder on GitHubat commit a0eeb90

Compare with similar skills

Repo Context Ledger next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Repo Context Ledger compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Repo Context Ledger this skillgviiisen/repo-context-ledger105—~2.8kAutomated safety check: PassMIT
Badstephenleo/bmad-autonomous-development107—~7.7kAutomated safety check: PassMIT
ccc Semantic Code Searchcocoindex-io/cocoindex-code2.8k—~938Automated safety check: PassApache-2.0
Repomix Codebase Packeryamadashy/repomix29k—~1.3kAutomated safety check: NotesMIT
MCP Code Search Tool SelectionContext-Engine-AI/Context-Engine402—~1.3kAutomated safety check: PassMIT
PRP Workstream OrchestratorWirasm/prp2.3k—~3.5kAutomated safety check: PassMIT

Similar skills

  • Bad

    stephenleo/bmad-autonomous-development

    BMad Autonomous Development — orchestrates parallel story implementation pipelines.

    107 GitHub stars~7.7k tokensUpdated 5 mo ago
    Agent WorkflowsAuto-check passed
  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.8k GitHub stars~938 tokensUpdated 4 days ago
    Agent WorkflowsAuto-check passed
  • Repomix Codebase Packer

    yamadashy/repomix

    Packs a local directory or remote GitHub repository into one AI-friendly file with Repomix, then searches it to explore structure, find patterns and count tokens.

    29k GitHub stars~1.3k tokensUpdated today
    Agent WorkflowsAuto-check: notes
  • MCP Code Search Tool Selection

    Context-Engine-AI/Context-Engine

    Rules for choosing Qdrant-Indexer semantic search over grep or file reads when exploring code, debugging or asking where and why questions.

    402 GitHub stars~1.3k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • Coordinates several PRP workstreams in isolated Git worktrees from one session, verifying proof, holding merge gates and sequencing the merges.

    2.3k GitHub stars~3.5k tokensUpdated 9 days ago
    Agent WorkflowsAuto-check passed
  • MoAI Foundation Core

    modu-ai/moai-adk

    Reference for MoAI-ADK's core development principles: TRUST 5 quality gates, SPEC-first domain-driven workflow, agent delegation and token budgeting.

    1.2k GitHub stars~5k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

Works with

Questions about Repo Context Ledger

What does Repo Context Ledger do?

Record every behavior-changing feature addition, fix, and adjustment as durable, evidence-based repository knowledge, then use that ledger to continue accurately across AI windows, tools, Git…. Repo Context Ledger is an agent skill from gviiisen/repo-context-ledger. Record every behavior-changing feature addition, fix, and adjustment as durable, evidence-based repository knowledge, then use that ledger to continue accurately across AI windows, tools, Git collaboration, and pull requests.

When should I use Repo Context Ledger?

Repo Context Ledger fits situations like: tasks that involve Codebase knowledge for agents; tasks that involve Domain-driven design; tasks that involve Accounting and bookkeeping.

How do I install Repo Context Ledger in Claude Code?

Run `npx skills add gviiisen/repo-context-ledger --skill repo-context-ledger -a claude-code`. Or copy the skill folder (skills/repo-context-ledger in gviiisen/repo-context-ledger) into .claude/skills/repo-context-ledger in your project. Claude Code loads it when a task matches its description.

How do I install Repo Context Ledger in Codex?

Run `npx skills add gviiisen/repo-context-ledger --skill repo-context-ledger -a codex`. Or copy the skill folder (skills/repo-context-ledger in gviiisen/repo-context-ledger) into .agents/skills/repo-context-ledger in your project. Codex loads it when a task matches its description.

Can I use Repo Context Ledger in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gviiisen/repo-context-ledger --skill repo-context-ledger -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/repo-context-ledger, .gemini/skills/repo-context-ledger, .github/skills/repo-context-ledger and .opencode/skills/repo-context-ledger in your project.

What does Repo Context Ledger need to run?

Going by SKILL.md and its folder, Repo Context Ledger needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Repo Context Ledger access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Repo Context Ledger safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Repo Context Ledger use?

Repo Context Ledger is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Repo Context Ledger use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 11k tokens, read only when the agent opens those files.

What are the alternatives to Repo Context Ledger?

Skills that share tags, products or a category with Repo Context Ledger: Bad (stephenleo/bmad-autonomous-development, 107 stars), ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.8k stars), Repomix Codebase Packer (yamadashy/repomix, 29k stars) and MCP Code Search Tool Selection (Context-Engine-AI/Context-Engine, 402 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Repo Context Ledger?

gviiisen (a GitHub user) maintains it in gviiisen/repo-context-ledger, which has 105 GitHub stars. The repository was last updated on September 7, 2026.

Source: gviiisen/repo-context-ledger on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.