Brewcode Overview

Brewcode is a plugin for Claude Code that turns single sessions into an infinite task pipeline with automatic context handoff between sessions. The name is a nod to brewing: skills (recipes) define what to brew, agents (brewers) do the work, and hooks (processes) manage the lifecycle.

Key Features

infinity

Infinite context

Automatic knowledge transfer between sessions via KNOWLEDGE.jsonl and the handoff mechanism. Tasks continue after compaction without losing progress.

terminal

15 skills (recipes)

Full cycle: from project analysis (/brewcode:setup) to task execution (/brewcode:start) and code review (/brewcode:standards-review).

users

13 agents (brewers)

Specialized agents: developer, tester, reviewer, architect, skill-creator, agent-creator, and coordinators.

settings

8 hooks (processes)

Lifecycle hooks for context management: knowledge injection, grepai integration, exit blocking when a task is still active.

search

Semantic search

Integration with grepai — AI-powered code search via Ollama + bge-m3. Auto-start, reminders, configurator.

shield

Code quality

Standards-review, convention analysis, secrets-scan, text-optimize. Rules are automatically synced to .claude/rules/.

Architecture

Brewcode works as a layer on top of Claude Code through the hook system. The plugin has no external runtime — all context is managed through built-in Claude Code events.

                         Brewcode Plugin
  ┌──────────────────────────────────────────────────────────┐
  │                                                          │
  │   Skills (recipes)            Agents (brewers)           │
  │   ┌──────────────┐          ┌──────────────────┐         │
  │   │ setup, spec  │          │ developer, tester │         │
  │   │ plan, start  │ ──────>  │ reviewer, architect│         │
  │   │ convention,. │          │ coordinator, ...  │         │
  │   └──────────────┘          └──────────────────┘         │
  │          │                          │                     │
  │          v                          v                     │
  │   Hooks (processes)           Templates + Knowledge      │
  │   ┌──────────────┐          ┌──────────────────┐         │
  │   │ session-start│          │ PLAN.md.template  │         │
  │   │ pre-task     │ <──────> │ KNOWLEDGE.jsonl   │         │
  │   │ pre-compact  │          │ SPEC.md.template  │         │
  │   │ stop         │          │ artifacts/        │         │
  │   └──────────────┘          └──────────────────┘         │
  │                                                          │
  └──────────────────────────────────────────────────────────┘

Task execution flow

PLAN.md --> phases (phases/) --> agents execute --> hooks manage
   │                               │                     │
   │  Phase Registry               │  Task API           │  SessionStart
   │  (phase table)                │  (create/update)    │  PreToolUse
   │                               │                     │  PostToolUse
   v                               v                     │  PreCompact
artifacts/{P}-{N}{T}/          KNOWLEDGE.jsonl            │  Stop
{AGENT}_output.md              (knowledge accumulation)   v
                                                    handoff (auto)

Plugin structure

brewcode/
├── .claude-plugin/
│   └── plugin.json                    # Plugin manifest
├── hooks/
│   ├── hooks.json                     # Binding 8 hooks to events
│   ├── session-start.mjs              # Session initialization
│   ├── grepai-session.mjs             # Auto-start grepai watch
│   ├── pre-task.mjs                   # Knowledge injection into agents
│   ├── grepai-reminder.mjs            # grepai reminder
│   ├── post-task.mjs                  # Session binding, 2-step protocol
│   ├── pre-compact.mjs               # Knowledge compaction, handoff
│   ├── stop.mjs                       # Exit blocking
│   ├── forced-eval.mjs                # Skill activation (84%)
│   └── lib/
│       ├── utils.mjs                  # I/O, lock files, configuration
│       └── knowledge.mjs             # KNOWLEDGE.jsonl operations
├── agents/                            # 13 agents
│   ├── developer.md                   # Feature implementation (opus)
│   ├── tester.md                      # Testing (sonnet)
│   ├── reviewer.md                    # Code review (opus)
│   ├── architect.md                   # Architecture (opus)
│   ├── skill-creator.md               # Skill creation (opus)
│   ├── agent-creator.md               # Agent creation (opus)
│   ├── hook-creator.md                # Hook creation (opus)
│   ├── text-optimizer.md              # Text optimization (sonnet)
│   ├── bash-expert.md                 # Bash scripts (opus)
│   ├── bc-coordinator.md              # Task coordinator (haiku)
│   ├── bc-knowledge-manager.md        # Knowledge manager (haiku)
│   ├── bc-grepai-configurator.md      # grepai configurator (opus)
│   └── bc-rules-organizer.md          # Rules organizer (sonnet)
├── skills/                            # 15 skills
│   ├── setup/                         # Project analysis, templates
│   ├── spec/                          # Specification creation
│   ├── plan/                          # Plan creation
│   ├── start/                         # Task execution
│   ├── convention/                    # Convention analysis
│   ├── rules/                         # Rule extraction
│   ├── grepai/                        # Semantic search
│   ├── install/                       # Dependency installation
│   ├── teardown/                      # Cleanup
│   ├── text-optimize/                 # Text optimization
│   ├── text-human/                    # Code humanization
│   ├── standards-review/              # Standards review
│   ├── skills/                        # Skill management
│   ├── agents/                        # Agent management
│   └── secrets-scan/                  # Secrets scanning
└── templates/                         # Rule templates

Target project structure

After running /brewcode:setup and /brewcode:start, the following appears in your project:

{PROJECT}/
└── .claude/
    └── tasks/
        ├── cfg/
        │   ├── brewcode.config.json    # Plugin configuration
        │   └── brewcode.state.json     # Execution state
        ├── templates/                  # Adapted templates
        │   ├── PLAN.md.template
        │   ├── SPEC.md.template
        │   └── phase*.template
        ├── logs/
        │   └── brewcode.log            # Hook log
        ├── sessions/
        │   └── {session_id}.info       # Session information
        └── {TS}_{NAME}_task/           # Task directory
            ├── PLAN.md                 # Execution plan
            ├── SPEC.md                 # Specification
            ├── KNOWLEDGE.jsonl         # Accumulated knowledge
            ├── phases/                 # Phase files
            │   ├── 1-create-entity.md
            │   ├── 1V-verify-entity.md
            │   └── FR-final-review.md
            ├── artifacts/              # Agent reports
            │   ├── FINAL.md
            │   └── {P}-{N}{T}/
            ├── backup/                 # Backups
            └── .lock                   # Session lock file

Components in detail

15 skills (recipes) cover the full task lifecycle. See the Skills section for details.

GroupSkillsPurpose
Core cyclesetup, spec, plan, startTask creation and execution
Qualitystandards-review, convention, rules, secrets-scanCode analysis and review
Utilitiesgrepai, install, teardown, text-optimize, text-human, skills, agentsTools and configuration

13 agents (brewers) with different models and specializations. See the Agents section for details.

RoleAgentsModel
Implementationdeveloper, tester, architectopus/sonnet
Reviewrevieweropus
Creationskill-creator, agent-creator, hook-creatoropus
Optimizationtext-optimizer, bash-expertsonnet/opus
Coordinationbc-coordinator, bc-knowledge-manager, bc-grepai-configurator, bc-rules-organizerhaiku/sonnet/opus

8 hooks (processes) manage the lifecycle through Claude Code events. See the Hooks section for details.

EventHooksPurpose
UserPromptSubmitforced-evalSkill activation
SessionStartsession-start, grepai-sessionInitialization
PreToolUsepre-task, grepai-reminderContext injection
PostToolUsepost-taskSession binding
PreCompactpre-compactKnowledge handoff
StopstopExit blocking
  • Installation/brewcode:install

    Install dependencies: brew, coreutils, jq, optionally grepai.

  • Project setup/brewcode:setup

    Analyze the project and generate adapted templates.

  • Specification/brewcode:spec

    Parallel codebase research, SPEC.md creation.

  • Plan/brewcode:plan

    Phase generation, quorum review, requirements tracing.

  • Execution/brewcode:start

    Launch the task with infinite context and automatic handoff.

Next steps

Check out Skills for a detailed description of all 15 skills, or go to Workflow for a deep dive into the full task execution cycle.