context-bank
v1.1.1
Published
A CLI tool to standardise AI context in projects.
Maintainers
Readme
🏦 Context Bank
The git init for AI Context.
Standardize, persist, and evolve your project's AI context with a single command.
Works with Cursor, Windsurf, GitHub Copilot, Gemini CLI, Claude Code, Codex CLI, OpenCode, and Aider — built on the cross-tool AGENTS.md standard.
⚡ The Problem
Every time you start a new chat with an AI Code Editor, you face the same friction:
- ❌ Amnesia: "Wait, are we using Tailwind or CSS Modules? I forgot."
- ❌ Token Waste: Manually pasting huge documentation files burns your quota.
- ❌ Inconsistency: Cursor follows one rule, while Copilot suggests something else.
🚀 The Solution
Context Bank creates a standardized, self-evolving brain for your project.
It generates a structured .ai directory that acts as a Single Source of Truth (SSOT) for all your AI tools.
📦 Installation & Usage
Prerequisites
You need Node.js 18+ installed on your machine. (Most developers already have this. If not, download it here.)
Quick Start
Go to your project root (any language: Python, Go, C#, Node, etc.) and run:
npx context-bank initThat's it! 🚀
✨ Key Features
🧠 1. Self-Evolving Rules
Instead of static .txt files, Context Bank sets up a living rules.md.
- Dynamic Learning: The AI is instructed to update its own rules when you state a preference.
- Example: You tell the AI "I prefer arrow functions". The AI updates
.ai/rules.md. Next time, it remembers.
💾 2. Smart Memory (Token Saver)
Stop feeding the AI your entire chat history. Context Bank uses "State Management":
active-context.md(Short-term): Tracks the current task. (e.g., "Fixing the login bug").roadmap.md(Mid-term): Planned, in-progress, and completed features.architecture.md(Structural): Directory layout, data flow, and key design decisions.story.md(Long-term): Logs major milestones and architectural decisions.- The Benefit: You can start a fresh chat, point the AI to
active-context.md, and resume work instantly without reading 10k tokens of history.
🔌 3. Universal Tool Support
One brain, multiple interfaces. The init command automatically configures pointers for:
| Tool | Support Type | Integration Method |
|------|--------------|-------------------|
| Cursor | Native ✅ | .cursor/rules/ (+ reads AGENTS.md) |
| Windsurf | Native ✅ | .windsurf/rules/ (+ reads AGENTS.md) |
| GitHub Copilot | Native ✅ | .github/copilot-instructions.md (+ reads AGENTS.md) |
| Claude Code | Native ✅ | CLAUDE.md (imports AGENTS.md) |
| Codex CLI | Native ✅ | AGENTS.md |
| OpenCode | Native ✅ | reads AGENTS.md (falls back to CLAUDE.md) |
| Gemini CLI | Native ✅ | GEMINI.md + project .gemini/settings.json |
| Aider (CLI) | Native ✅ | CONVENTIONS.md (wired via .aider.conf.yml) |
🌐
AGENTS.mdis the cross-tool open standard (agents.md, governed by the Agentic AI Foundation). Context Bank writes a richAGENTS.mdas the canonical instruction file — Codex, Cursor, Copilot, Windsurf, Jules, Zed and others read it natively, andCLAUDE.mdimports it via@AGENTS.md. All of them ultimately point to your.ai/rules.md.
🤖 Smart CLI Integration
Context Bank wires up CLI tools two ways:
Project-scoped (preferred). No global state — the config lives in your repo:
- Gemini CLI: writes
.gemini/settings.json(context.fileName) soAGENTS.md,GEMINI.md, and.ai/rules.mdload automatically for this project. - Aider: writes
.aider.conf.ymlwithread: CONVENTIONS.md(Aider does not auto-loadCONVENTIONS.mdotherwise).
Global handshake (opt-in). For Gemini CLI and Codex CLI, if a global config is detected, Context Bank asks permission to add a Generic Context Rule to ~/.gemini/GEMINI.md / ~/.codex/AGENTS.md. Once enabled, the CLI will automatically check for .ai/rules.md in ANY folder you work in.
🛠️ For Unsupported Tools
If your tool isn't listed above, just start your session with this Magic Prompt:
"I am starting a session. Please read
.ai/rules.mdfor project standards and.ai/active-context.mdfor the current state. Update these files if plans change."
📂 Generated Structure
When you run the command, your project gets this power-pack:
my-project/
├── .ai/
│ ├── rules.md # 🧠 The Master Brain (SSOT)
│ ├── active-context.md # 📝 Current focus & next steps
│ ├── roadmap.md # 🗺️ Planned & completed features
│ ├── architecture.md # 🏗️ Structure & design decisions
│ └── story.md # 📜 Project history & decisions
├── AGENTS.md # 🌐 Cross-tool standard (Codex, Cursor, Copilot, …)
├── CLAUDE.md # 🔗 Claude Code (imports AGENTS.md)
├── GEMINI.md # 🔗 Pointer for Gemini CLI
├── CONVENTIONS.md # 🔗 Pointer for Aider
├── .cursor/rules/context-bank.mdc # 🔗 Rules for Cursor
├── .windsurf/rules/context-bank.md # 🔗 Rules for Windsurf
├── .github/copilot-instructions.md # 🔗 Pointer for Copilot
├── .gemini/settings.json # ⚙️ Auto-loads context for Gemini CLI
├── .aider.conf.yml # ⚙️ Wires CONVENTIONS.md into Aider
├── .claude/settings.json # ⚙️ Stop-hook reminder to update .ai/ files
└── .gitattributes # 🔀 Branch-aware merge strategies for .ai/🤝 Contributing
Contributions are welcome! Whether it's a new template or a bug fix.
- Fork the repo
- Create your branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
MIT © Kadir Esen
