Context Bank
Prerequisites & Dependencies
- Python 3.10+ (for JSON/Markdown materialization)
- No external runtime dependencies; pure-Python file I/O
Execution Steps
Scan transcript ground truth: Before any major edit or session pause, extract the following from the current conversation:
- Verified file paths (absolute, with
file:linereferences confirmed) - Decided invariants (design decisions, rejected approaches with rationale)
- Active TODOs and their status
- Open risks or indeterminate states
- Verified file paths (absolute, with
Write CONTEXT_BANK.md: Create/overwrite
CONTEXT_BANK.mdat the repository root with structured sections:# Verified File Paths# Decided Invariants# Active TODOs# Open Risks# Session Decisions
Write context-bank.json: Serialize the same data to
context-bank.jsonfor machine consumption by subagents.On reload: Prioritize
CONTEXT_BANK.mdcontents over the decaying transcript when resuming work. Flag any transcript references that conflict with the bank as potentially stale.Periodic compaction: Run
context-bank compactto collapse older entries (older than N turns) while preserving decision rationale and file:line anchors.
Output Format
CONTEXT_BANK.md:
# Context Bank (auto-generated)
## Verified File Paths
- `path/to/file.py:42` — verified import pattern
- `path/to/other.ts:11` — confirmed type contract
## Decided Invariants
- **Decision**: Use X over Y
- **Rationale**: Y caused [specific failure] in prior session
- **Rejected**: [any alternative considered]
## Active TODOs
- [ ] TODO description — owner, due
## Open Risks
- Risk: X may break under Y conditions
- Status: being investigated
## Session Decisions
- 2026-09-11: Agreed to use verify-orchestrator for all completion claims
context-bank.json:
{
"verified_paths": ["path/to/file.py:42"],
"invariants": {"decision": "Use X over Y", "rationale": "Y caused failure"},
"todos": [{"text": "TODO description", "owner": "agent", "status": "open"}],
"risks": [{"description": "Risk: X may break under Y", "status": "open"}],
"decisions": ["2026-09-11: Agreed to use verify-orchestrator"]
}
Windows PowerShell Notes
- Use
Set-Contentwith-Encoding UTF8NoBOMwhen writingCONTEXT_BANK.mdto avoid BOM contamination - Verify file paths use forward slashes or escaped backslashes in PowerShell quotes