v260414.01 2:55p
← Back to AlpacApps Infra

AlpacApps Updates

New features added to the template since you first cloned it. Select the ones you want, copy the prompt, and paste it into Claude Code to adopt them.

Instructions for Claude

When a user pastes a prompt generated by this page, follow these steps:

  1. Read the user's current project state — check what's already installed by looking at their package.json, cloudflare/ directory, shared/ directory, and .claude/settings.json.
  2. For each requested feature, follow the detailed adoption steps in the feature card below. Each card has a "What Claude Does" section with exact commands and file changes.
  3. Don't duplicate work — if the user already has a feature partially or fully set up, skip to the missing parts.
  4. Ask for credentials only when needed — some features (like D1 session logging) require the user to provide a Cloudflare auth token. Prompt once with all needed values.
  5. Commit and push after each feature — one feature per commit so changes are easy to review or revert.
  6. Update docs — after each feature, update the relevant docs/*.md files (KEY-FILES.md, CHANGELOG.md, INTEGRATIONS.md, etc.).
How this works Check the features you want below, then click "Generate Prompt for Claude." Copy and paste it into Claude Code in your project directory. Claude will pull the new code from the template repo and configure everything for you.

New Session Logging to Cloudflare D1

Added Mar 2026

Automatically save every Claude Code session transcript to a Cloudflare D1 (SQLite) database. Search past conversations, track token usage and costs, and never lose context from previous sessions.

What you get

Prerequisites

Cloudflare account (free) Node.js 18+

What Claude does

  1. Check if cloudflare/claude-sessions/ already exists in the project. If not, pull it from the template repo.
  2. Install Wrangler CLI globally if not present: npm install -g wrangler
  3. Run wrangler login (opens browser for Cloudflare auth)
  4. Create D1 database: npx wrangler d1 create claude-sessions
  5. Update cloudflare/claude-sessions/wrangler.jsonc with the returned database_id
  6. Ask the user to choose a secure auth token (or generate one)
  7. Set the auth token in src/index.js — replace CHANGE_ME_TO_A_SECRET with the chosen token
  8. Apply the schema: cd cloudflare/claude-sessions && npx wrangler d1 execute claude-sessions --file=schema.sql --remote
  9. Deploy the worker: cd cloudflare/claude-sessions && npx wrangler deploy
  10. Note the worker URL from the deploy output (e.g., https://claude-sessions.USERNAME.workers.dev)
  11. Copy the hook script to the user's home directory:
    mkdir -p ~/.claude/hooks
    cp cloudflare/claude-sessions/hooks/save-session.sh ~/.claude/hooks/save-session.sh
    chmod +x ~/.claude/hooks/save-session.sh
  12. Update the hook script with the Worker URL and auth token (replace the placeholder values)
  13. Add the Stop hook to ~/.claude/settings.json:
    {
      "hooks": {
        "Stop": [{
          "hooks": [{
            "type": "command",
            "command": "$HOME/.claude/hooks/save-session.sh",
            "timeout": 15
          }]
        }]
      }
    }
  14. Validate by running: curl -H "Authorization: Bearer TOKEN" https://WORKER_URL/stats
  15. Update docs/KEY-FILES.md, docs/INTEGRATIONS.md, and docs/CHANGELOG.md
Files added/modified cloudflare/claude-sessions/ (new directory with worker, schema, hook script, wrangler config) • ~/.claude/hooks/save-session.sh~/.claude/settings.json (hooks block)

New On-Demand Context System

Added Mar 2026

Reduce Claude Code token usage by splitting heavy documentation into on-demand files. Instead of loading everything into CLAUDE.md, Claude only loads the specific docs/*.md file it needs for a given task.

What you get

Prerequisites

None

What Claude does

  1. Check if docs/ directory already exists with the expected files. If so, skip or merge.
  2. Pull the latest docs/ directory structure from the template repo:
    docs/CREDENTIALS.md  (gitignored — API keys, tokens)
    docs/SCHEMA.md       (database table definitions)
    docs/PATTERNS.md     (code patterns, Tailwind tokens)
    docs/KEY-FILES.md    (project file structure)
    docs/DEPLOY.md       (deployment workflow, URLs)
    docs/INTEGRATIONS.md (external service configs)
    docs/CHANGELOG.md    (recent changes log)
  3. Update CLAUDE.md to the slim version with on-demand doc index header (preserve any custom directives the user has added)
  4. Add docs/CREDENTIALS.md to .gitignore if not already present
  5. Migrate any credentials, schema info, or patterns currently in CLAUDE.md to the appropriate docs/*.md file
  6. Populate docs/KEY-FILES.md with the user's actual project structure
Files added/modified CLAUDE.md (slimmed down) • docs/*.md (7 new files) • .gitignore (add CREDENTIALS.md)

New Open Brain — Session Transparency Dashboard

Added Mar 2026

A public-facing (or admin-only) page that displays your Claude Code session history from D1. Shows what Claude worked on, when, token counts, and costs. Full radical transparency for how AI is being used in your project.

What you get

Prerequisites

D1 Session Logging (above)

What Claude does

  1. Verify D1 session logging is set up and the Worker is responding
  2. Create open-brain/index.html — a standalone dashboard page with:
    • Stats summary bar (total sessions, tokens, cost)
    • Filterable session list (search, date range, project)
    • Click-to-expand transcript viewer with markdown rendering
    • Styled to match the project's design system
  3. Ask the user: should this be public or require authentication?
    • Public — accessible to anyone at /open-brain/
    • Auth-gated — wrap in the existing auth system, admin-only
  4. Configure the Worker URL and auth in the dashboard's JavaScript
  5. Update docs/KEY-FILES.md and docs/CHANGELOG.md
Files added open-brain/index.html (standalone dashboard)

New Smart Polling with Circuit Breaker

Added Mar 2026

Intelligent data refresh that pauses when the tab is hidden, backs off exponentially on failures, and auto-recovers when Supabase comes back online. Prevents hammering your API during outages.

What you get

Prerequisites

Supabase configured

What Claude does

  1. Pull shared/services/poll-manager.js from the template repo
  2. Pull shared/supabase-health.js from the template repo
  3. Wire the PollManager into existing pages that fetch data periodically
  4. Replace any existing setInterval polling with PollManager
  5. Update docs/KEY-FILES.md and docs/PATTERNS.md
Files added shared/services/poll-manager.jsshared/supabase-health.js

New Intranet Tab Visibility Config

Added Mar 2026

Database-driven configuration for which intranet sections and tabs are visible. Toggle tabs on/off per section without code changes — just update a Supabase table.

What you get

Prerequisites

Supabase configured

What Claude does

  1. Run the migration: supabase/migrations/001_page_display_config.sql against the user's Supabase project via psql or the Supabase SQL editor
  2. Pull the updated intranet components from the template repo if they've changed:
    • src/components/intranet/section-tabs.tsx
    • src/components/intranet/sub-tabs.tsx
    • src/components/intranet/tab-content.tsx
  3. Customize the seed data for the user's specific sections/tabs
  4. Update docs/SCHEMA.md and docs/CHANGELOG.md
Files added/modified supabase/migrations/001_page_display_config.sql • Intranet tab components (3 files)

New Centralized Error Logger

Added Mar 2026

A lightweight error logging utility that standardizes error handling across the app. Captures, formats, and optionally reports errors to a central location.

What you get

Prerequisites

None

What Claude does

  1. Pull shared/error-logger.js from the template repo
  2. Wire it into existing error handling patterns (try/catch blocks, fetch error handlers)
  3. Update docs/KEY-FILES.md and docs/PATTERNS.md
Files added shared/error-logger.js

New Stop Hook Upgrade (replaces SessionEnd)

Added Mar 2026

If you previously set up session logging with the SessionEnd hook, this upgrade switches to the Stop hook which also captures worktree and subagent sessions. Includes rate-limiting to avoid excessive API calls.

What you get

Prerequisites

D1 Session Logging already set up

What Claude does

  1. Check ~/.claude/settings.json for an existing SessionEnd hook
  2. Replace it with the Stop hook configuration
  3. Update ~/.claude/hooks/save-session.sh with the latest version (includes rate-limiting)
  4. Verify the hook fires correctly by checking for the lock directory
Files modified ~/.claude/settings.json (hook event type) • ~/.claude/hooks/save-session.sh (rate-limiting)

New DevControl — AI Development Dashboard

Added Mar 2026

A comprehensive admin dashboard for monitoring your AI-assisted development workflow. Six sub-tabs covering releases, sessions, token usage, context window analysis, and backup status — all in one place.

What you get

Prerequisites

Supabase configured GitHub repo (for Releases tab)

Optional: D1 Session Logging (for Sessions tab), backup_logs table (for Backups tab)

What Claude does

  1. Pull the DevControl files from the template repo:
    spaces/admin/devcontrol.html   (admin page shell)
    spaces/admin/devcontrol.js     (all 6 sub-tab logic)
    spaces/admin/devcontrol.css    (complete styling)
  2. Configure the project-specific values at the top of devcontrol.js:
    • GH_OWNER / GH_REPO — for Releases and Context tabs (GitHub API)
    • SESSIONS_API / SESSIONS_TOKEN / PROJECT_FILTER — for Sessions and Tokens tabs (D1 Worker)
  3. Add the DevControl tab to the admin navigation in shared/admin-shell.js:
    { id: 'devcontrol', label: 'DevControl', href: 'devcontrol.html',
      permission: 'view_settings', section: 'admin' }
  4. Add the DevControl icon to admin-shell.js icon map
  5. Create the context_snapshots Supabase table for 90-day history tracking:
    CREATE TABLE context_snapshots (
      snapshot_date DATE PRIMARY KEY,
      always_loaded_tokens INTEGER NOT NULL,
      total_tokens INTEGER NOT NULL,
      breakdown JSONB DEFAULT '{}'
    );
  6. If the user already has a backup_logs table, the Backups tab will work immediately. Otherwise, create it:
    CREATE TABLE backup_logs (
      id SERIAL PRIMARY KEY,
      created_at TIMESTAMPTZ DEFAULT NOW(),
      source TEXT NOT NULL,
      backup_type TEXT NOT NULL,
      status TEXT NOT NULL,
      duration_seconds INTEGER,
      details JSONB,
      r2_key TEXT
    );
  7. Update docs/KEY-FILES.md, docs/CHANGELOG.md, and docs/PATTERNS.md
Files added/modified spaces/admin/devcontrol.htmlspaces/admin/devcontrol.jsspaces/admin/devcontrol.cssshared/admin-shell.js (nav entry + icon)

Generated Prompt

Select features above, then click the button to generate a prompt you can paste into Claude Code.