The Ledger
The Ledger is Gangsta Agents' institutional memory. It persists across sessions, ensuring that lessons learned aren't lost when your AI session ends.
gangsta:the-ledgerLocation:docs/gangsta/ in your project rootWhat the Ledger Contains
Insights
Successful patterns, non-obvious approaches, and domain knowledge worth preserving.
Examples:
- "The payment gateway requires idempotency keys for all POST requests"
- "React Query's
useSuspenseQueryworks better thanuseQueryfor this project's SSR setup" - "The database migration system doesn't support column renames — always add + remove instead"
Fails
Documented mistakes — approaches that caused rework, confusion, or wasted effort.
Examples:
- "Don't use
anyin TypeScript configs — it bypasses the type checker in ways that aren't obvious" - "The external API rate-limits to 100 req/min, not 1000 as the docs claim"
- "Running tests in parallel on this project causes flaky failures due to shared database state"
Constitution
Accumulated rules that the team has agreed upon — project-specific extensions of Omerta.
Examples:
- "All database queries must use the QueryBuilder, never raw SQL"
- "Feature flags must be in the
config/features.ymlfile, not hardcoded" - "Every PR must include a test for the happy path and at least one error path"
File Structure
The Ledger lives in your project at docs/gangsta/:
docs/gangsta/
├── insights/
│ └── 2026-04-15-payment-idempotency.md
├── fails/
│ └── 2026-04-10-parallel-test-flakiness.md
├── constitution/
│ └── rules.md
├── {heist-name}/ # open Heists
│ ├── checkpoints/
│ │ ├── 01-reconnaissance.md
│ │ ├── 02-the-grilling.md
│ │ └── ...
│ ├── recon/
│ │ └── 2026-04-15-recon-dossier.md
│ ├── specs/
│ │ └── 2026-04-15-contract.md
│ └── plans/
│ └── 2026-04-15-execution-plan.md
├── vault/ # The Vault: completed Heists
│ └── {heist-name}/
└── boneyard/ # The Boneyard: killed Heists
└── {heist-name}/
The Vault and the Boneyard
A closed Heist leaves the top level of docs/gangsta/, so only open work sits next to the Ledger. Insights, Fails and the Constitution stay where they are: they are the living memory, the Vault is the record.
| Final checkpoint | Destination |
|---|---|
phase: laundering, status: completed | docs/gangsta/vault/{heist-name}/ |
status: killed | docs/gangsta/boneyard/{heist-name}/ |
Laundering moves the Heist when the Don closes it: git mv into the Vault (or the Boneyard), references to the old path updated, the move included in the final commit.
The session-start hook sweeps closed Heists that were left behind, in Claude Code, Cursor and Copilot CLI:
- moves them with
git mvand rewritesdocs/gangsta/{heist-name}/references in Markdown and YAML files underdocs/gangsta/; - stages the change and never commits it — the agent tells the Don what moved and offers to commit;
- skips a Heist with uncommitted changes, or whose destination already exists;
- reads checkpoints written as
.md,.yamlor.yml.
Set GANGSTA_AUTO_VAULT=0 in your environment to turn the sweep off. Resuming a Heist never looks in the Vault or the Boneyard.
When to Write to the Ledger
The Ledger is updated during two key moments:
During The Delivery
The final Heist phase (gangsta:laundering) includes a Ledger update step. The Consigliere reviews what worked, what failed, and what rules should be added to the constitution.
During Conversations
After any significant exchange outside a Heist — if the Don shares domain knowledge or if an approach is discovered that's worth preserving — offer to write a Ledger entry:
- If yes: write the entry using the Ledger format
- If no: drop it — never ask again for the same topic in the same session
- Never write a Ledger entry without explicit Don approval
Proactive Memory Capture
Gangsta Agents encourages proactive memory capture:
| Situation | Action |
|---|---|
| Non-obvious approach discovered | Offer to save as Insight |
| Don shares domain knowledge | Offer to save as Insight |
| Creative solution to a constraint | Offer to save as Insight |
| Don rejects an approach | Offer to save as Fail |
| Approach causes rework | Offer to save as Fail |
| Repeated mistake pattern | Offer to save as Fail |
Why the Ledger Matters
Without institutional memory, every session starts from zero. The Ledger ensures:
- Insights compound — Successful patterns are reused, not rediscovered
- Fails aren't repeated — Documented mistakes prevent future waste
- Constitution grows — Project-specific rules accumulate over time
- New sessions are informed — Any agent can read
docs/gangsta/and understand the project's history