branch-context
v0.2.0
Published
<a name="TOC"></a>
Readme
🎯 Overview
Command-line interface for Branch Context, a per-branch context folder for AI agents and humans. Sets up Git hooks, manages templates, and keeps _branch/context.md in sync with the active branch.
🚀 Quick Start
npm i -g branch-contextThen, inside any Git repo:
bctx initThis creates .bctx/ and installs the post-checkout / post-commit hooks. _branch/context.md is now always pointed at the active branch's context.
🧰 Commands
bctx init # set up .bctx/ and Git hooks
bctx sync # refresh commit/file summaries
bctx status # check setup health and list branch contexts
bctx base # get/set base branch
bctx template [name] # apply a template (e.g. fix, feature)
bctx prune # archive contexts of deleted branches
bctx agents status # show indexed AI session pointers for the branch
bctx uninstall # remove .bctx/ and hooksbctx agents status indexes local Codex, Claude Code, and Pi sessions for the current branch.
For branch-scoped Pi sessions, install the Pi package from GitHub:
pi install git:github.com/lucasvtiradentes/branch-contextIt records the current Git branch into new Pi session files via pi.appendEntry().
⚙️ Configuration
Default .bctx/config.json:
{
"default_base_branch": "origin/main",
"sound": true,
"commit_description": false,
"branches_folder": ".bctx/branches",
"templates_folder": ".bctx/templates"
}