CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
CLAUDE.md
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| fc1817a | 1 | # gluecron |
| 2 | ||
| 3 | AI-native code intelligence platform — git hosting, automated CI, and green ecosystem enforcement. | |
| 4 | ||
| d0bc8c2 | 5 | ## Section 0 — SESSION START PROTOCOL (mandatory) |
| 6 | ||
| 7 | Every session begins by loading memory. Do these in order: | |
| 8 | ||
| 9 | 1. Read `.memory/project-state.md` — current status snapshot | |
| 10 | 2. Read `.memory/last-session.md` — what was just built, what's next | |
| 11 | 3. Read `.memory/open-questions.md` — anything needing owner input | |
| 12 | 4. Run `git log --oneline -5` — verify branch state | |
| 13 | 5. Run `bun test 2>&1 | tail -3` — verify tests pass | |
| 14 | ||
| 15 | If any file is missing, note it and proceed. Never ask the user to provide context you can read from these files. | |
| 16 | ||
| 17 | ## Section 1 — HARD RULES | |
| 18 | ||
| 19 | ### Rule 1: Never forget context | |
| 20 | - Session memory lives in `.memory/`. Read it. Use it. Update it. | |
| 21 | - If you don't know something, check memory files before asking. | |
| 22 | - Cross-session continuity is non-negotiable. | |
| 23 | ||
| 24 | ### Rule 2: Never sit idle | |
| 25 | - This is a revenue-generating product. Idle time = lost revenue. | |
| 26 | - See something broken? Fix it. See a gap? Build it. Finished a task? Start the next one. | |
| 27 | - Prioritize: Security fixes > broken functionality > performance > new features > polish. | |
| 28 | - When in doubt, build. The worst outcome is sitting idle. | |
| 29 | ||
| 30 | ### Rule 3: Never ship broken code | |
| 31 | - `bun test` must pass before every commit. | |
| 32 | - Run tests after every change. If tests break, fix them immediately. | |
| 33 | - Commit and push frequently. Small, focused commits. | |
| 34 | - Every user-facing failure mode has a fallback — no 500s reach the UI. | |
| 35 | ||
| 36 | ## Section 2 — SESSION END PROTOCOL (mandatory) | |
| 37 | ||
| 38 | Before the session ends or context compacts: | |
| 39 | ||
| 40 | 1. Update `.memory/last-session.md` with: what was built, what was fixed, branch state, what's next | |
| 41 | 2. Update `.memory/project-state.md` if architecture changed | |
| 42 | 3. Append new decisions to `.memory/decisions-log.md` | |
| 43 | 4. Update `.memory/open-questions.md` if new questions arose | |
| 44 | 5. Commit memory files with message: `chore: update session memory` | |
| 45 | ||
| 46 | ## Section 3 — Agent Policy — NEVER IDLE | |
| 9837657 | 47 | |
| 48 | **This is a revenue-generating product. Idle time = lost revenue.** | |
| 49 | ||
| 50 | Every session must ship value. The rules: | |
| 51 | ||
| 52 | 1. **See something broken? Fix it.** Don't report it and wait — fix it, commit, push. | |
| 53 | 2. **See a missing feature that would advance the platform? Build it.** Don't ask permission for obvious improvements. | |
| 54 | 3. **Finished a task? Start the next one.** Audit the codebase for gaps, performance issues, missing tests, broken flows. Always have the next thing queued. | |
| 55 | 4. **Run tests after every change.** `bun test` must pass before pushing. If tests break, fix them immediately. | |
| 56 | 5. **Commit and push frequently.** Small, focused commits. Don't batch 10 features into one push. | |
| 57 | 6. **Prioritize by impact:** Security fixes > broken functionality > performance > new features > polish. | |
| 58 | 7. **When in doubt, build.** The worst outcome is sitting idle. The second worst is asking "should I?" when the answer is obviously yes. | |
| 59 | ||
| d0bc8c2 | 60 | ## Section 4 — READ FIRST — every session |
| 9ab6971 | 61 | |
| 62 | **`BUILD_BIBLE.md` is mandatory reading for every Claude agent before any code changes.** | |
| 63 | ||
| 64 | It contains: | |
| 65 | - Agent policy (do-not-undo rule, continuous-build rule) | |
| 66 | - GitHub parity scorecard (what's shipped vs missing) | |
| 67 | - Numbered build plan (Blocks A–H) | |
| 68 | - Locked components that cannot be altered without owner permission | |
| 69 | - Session workflow | |
| 70 | ||
| 71 | Do not skip it. Do not refactor locked files. Do not stop mid-block. | |
| 72 | ||
| d0bc8c2 | 73 | ## Section 5 — Stack |
| fc1817a | 74 | |
| 75 | - **Runtime:** Bun | |
| 76 | - **Framework:** Hono (with JSX for server-rendered views) | |
| 77 | - **Database:** Drizzle ORM + Neon (PostgreSQL) | |
| 78 | - **Git:** Smart HTTP protocol via git CLI subprocesses | |
| 79 | ||
| d0bc8c2 | 80 | ## Section 6 — Development |
| fc1817a | 81 | |
| 82 | ```bash | |
| 83 | bun install # install dependencies | |
| 84 | bun dev # start dev server (hot reload) | |
| 85 | bun test # run tests | |
| 86 | bun run db:migrate # run database migrations | |
| 87 | ``` | |
| 88 | ||
| d0bc8c2 | 89 | ## Section 7 — Architecture |
| fc1817a | 90 | |
| 91 | ``` | |
| 92 | src/ | |
| 43de941 | 93 | index.ts Entry point (Bun server) |
| 94 | app.tsx Hono app composition + error handlers | |
| 95 | lib/ | |
| 96 | config.ts Environment config (getters, reads env at access time) | |
| 97 | auth.ts Password hashing (bcrypt), session tokens | |
| 98 | highlight.ts Syntax highlighting (highlight.js, 40+ languages) | |
| 99 | markdown.ts Markdown rendering (GFM + syntax highlighting) | |
| fc1817a | 100 | db/ |
| 43de941 | 101 | schema.ts Drizzle schema (all tables) |
| 102 | index.ts Lazy DB connection (proxy pattern) | |
| 103 | migrate.ts Migration runner | |
| fc1817a | 104 | git/ |
| 43de941 | 105 | repository.ts Git operations (tree, blob, commits, diff, branches, blame, search, raw) |
| 106 | protocol.ts Smart HTTP protocol (pkt-line, service RPC) | |
| fc1817a | 107 | hooks/ |
| 43de941 | 108 | post-receive.ts GateTest + Crontech webhooks on push |
| 109 | middleware/ | |
| 110 | auth.ts softAuth + requireAuth middleware | |
| fc1817a | 111 | routes/ |
| 43de941 | 112 | git.ts Git HTTP endpoints (clone/push) |
| 113 | api.ts REST API (repo CRUD, setup) | |
| 114 | auth.tsx Register, login, logout (web + API) | |
| 115 | web.tsx Web UI (file browser, commits, diffs, search, blame, raw) | |
| 116 | issues.tsx Issue tracker (CRUD, comments, close/reopen) | |
| 117 | pulls.tsx Pull requests (create, review, merge, close) | |
| 118 | editor.tsx Web file editor (create/edit via git plumbing) | |
| 119 | compare.tsx Branch comparison (diff + commit list) | |
| 120 | settings.tsx User settings (profile, SSH keys) | |
| 121 | repo-settings.tsx Repository settings (description, visibility, delete) | |
| 122 | webhooks.tsx Webhook management + delivery engine | |
| 123 | fork.ts Repository forking | |
| 124 | explore.tsx Explore/discover public repos | |
| 125 | tokens.tsx Personal access tokens | |
| 126 | contributors.tsx Contributor list + commit activity graph | |
| fc1817a | 127 | views/ |
| 43de941 | 128 | layout.tsx HTML shell + CSS (dark theme) + auth-aware nav |
| 129 | components.tsx UI components (file table, commit list, diff viewer, etc.) | |
| fc1817a | 130 | ``` |
| 131 | ||
| 43de941 | 132 | ## Database Schema |
| 133 | ||
| 134 | - `users` — accounts with bcrypt password hashing | |
| 135 | - `sessions` — cookie-based auth sessions (30 day expiry) | |
| 136 | - `repositories` — repos with fork tracking, star/fork/issue counts | |
| 137 | - `stars` — user-repo star relationships | |
| 138 | - `issues` — issue tracker with open/closed state | |
| 139 | - `issue_comments` — threaded comments on issues | |
| 140 | - `labels` + `issue_labels` — issue categorization | |
| 141 | - `pull_requests` — PRs with base/head branches, open/closed/merged state | |
| 142 | - `pr_comments` — PR comments with AI review flag + file/line annotations | |
| 143 | - `activity_feed` — event log for repos | |
| 144 | - `webhooks` — registered webhook URLs with HMAC secret + event filtering | |
| 145 | - `api_tokens` — personal access tokens with SHA-256 hashing | |
| 146 | - `repo_topics` — repository tags for discoverability | |
| 147 | - `ssh_keys` — user SSH public keys | |
| 148 | ||
| fc1817a | 149 | ## Integrations |
| 150 | ||
| 151 | - **GateTest:** POST `https://gatetest.ai/api/scan/run` on every `git push` | |
| 152 | - **Crontech:** POST `https://crontech.ai/api/trpc/tenant.deploy` on push to main | |
| 43de941 | 153 | - **Webhooks:** POST to registered URLs on push/issue/PR/star events with HMAC signatures |
| fc1817a | 154 | |
| 155 | ## Environment Variables | |
| 156 | ||
| 157 | See `.env.example` for required variables. Key ones: | |
| 158 | - `DATABASE_URL` — Neon PostgreSQL connection string | |
| 159 | - `GIT_REPOS_PATH` — directory for bare git repos (default: `./repos`) | |
| 160 | - `PORT` — HTTP port (default: 3000) | |
| d0bc8c2 | 161 | |
| 162 | ## Section 8 — ESCAPE HATCHES | |
| 163 | ||
| 164 | User can override any rule at any time: | |
| 165 | ||
| 166 | - `just do X` — skip memory protocol and just do the thing | |
| 167 | - `rule check` — agent re-reads CLAUDE.md and confirms compliance | |
| 168 | - `memory check` — agent reads all .memory/ files and summarizes current state | |
| 169 | - `skip tests` — commit without running tests (use sparingly) | |
| 170 | - `stop` — end the session immediately, update memory first | |
| 171 | ||
| 172 | ## Section 9 — DRIFT PREVENTION | |
| 173 | ||
| 174 | Every 10 tool calls, silently verify: | |
| 175 | 1. Am I still following the hard rules? | |
| 176 | 2. Has the conversation drifted from the build plan? | |
| 177 | 3. Are tests still passing? | |
| 178 | ||
| 179 | If drift is detected, self-correct without being asked. If tests are failing, fix before continuing. | |
| 180 | ||
| 181 | ## Section 10 — COMPETITIVE INTELLIGENCE | |
| 182 | ||
| 183 | The mission: **annihilate GitHub**. Continuously evaluate: | |
| 184 | - What does GitHub charge enterprise prices for that we ship free? | |
| 185 | - What is GitHub slow at that we can make instant? | |
| 186 | - What manual workflow can we automate with AI? | |
| 187 | - What's missing from every code hosting platform that developers wish existed? | |
| 188 | ||
| 189 | Every session should advance at least one competitive advantage. |