-
-
Read the fine print before it reads you. ClauseClear provides instant contract auditing and protect students from junk fees.
-
One-click sample presets: Test real-world predatory leases, sneaky internship IP traps, and gym contracts instantly
-
Paste any lease, employment contract or NDA directly into the clean audit interface for instant analysis.
-
Zero-API-key offline mode: 100% private local heuristic NLP engine that catches legal traps right in your browser.
-
Bring Your Own Key: Connect models like Google Gemini 3.5 Flash for advanced legal reasoning with instant live key validation.
-
Instant fairness scoring: Clear 0-100 score, predator-level risk warning, and immediate hidden fee calculation.
-
Dual-column review feed: Split view synchronizing red-flagged clause cards with your original document text.
-
One-click verbatim locator: Tap Locate in Text to jump directly to the exact offending paragraph in your contract.
-
Worst-case scenario breakdown: Explains real-world legal fallout and provides balanced, fairer substitute wording.
-
True Cost Simulator: Unmasks mandatory fees, showing how an advertised $950/mo lease actually costs $1,055/month.
-
Interactive What-If switchboard: Toggle real disputes like breaking a lease early or broken AC to reveal liabilities.
-
Missing protections audit: Flags essential statutory tenant rights that the contract quietly omitted.
-
Polite counter-offer email generator: Ready-to-send pushback emails negotiating unfair terms collaboratively.
-
Signable Rider A Addendum: Clean formal contract amendment ready to attach and sign alongside your agreement.
-
Internship IP trap detector: Protects student inventors by flagging clauses claiming ownership of personal projects.
Inspiration
Every semester, millions of university students, first-time renters and young interns sign legally binding 15-page contracts without truly understanding the fine print. Whether moving into off-campus housing, accepting a summer software internship or joining a local gym, students are routinely exploited by buried legal traps:
- 68% of student renters sign leases containing unlawful unannounced landlord entry clauses, non-refundable carpet cleaning deductions, or $350+ repair deductibles.
- Over 40% of student interns unknowingly sign overbroad Intellectual Property (IP) assignment clauses that grant corporate employers ownership over their personal university coursework, hackathon creations, and side projects.
- Deceptive Junk Fees & Auto-Renewals: Advertised "$950/mo" apartments quietly tack on mandatory smart-lock, valet trash, and portal surcharges that add +$1,260/year, while 90-day certified-mail cancellation windows trap students into automatic renewals.
Hiring a traditional contract lawyer costs $250 to $500 per hour, which is completely out of reach for students. Meanwhile, pasting a lease into a generic AI chatbot produces walls of generic text, hallucinated quotes, and zero financial math. I built ClauseClear to give every student an interactive, deterministic contract auditing engine that reads the fine print before it reads them.
What It Does
ClauseClear is an open-source, privacy-first contract auditing and financial transparency workspace tailored specifically for students and first-time renters.
- Deterministic 0–100 Fairness Score: Evaluates agreements across 6 core categories (Financial Liability, Termination & Renewal, Privacy & Entry, Maintenance & Repairs, IP & Ownership, and Liability & Waivers). Using an explicit mathematical risk rubric, the engine starts at a base score of $100$ and applies weighted deductions: $$S_{\text{final}} = \max\left(5, \min\left(100, 100 - 18C - 8W - 4M\right)\right)$$ where $C$ is the number of Critical Red Flags ($-18\text{ pts}$), $W$ is the number of Warnings ($-8\text{ pts}$), and $M$ is the number of omitted statutory protections ($-4\text{ pts}$).
- Bi-Directional Split-Pane Document Viewer: Links every flagged clause card directly to its exact verbatim substring inside a paper-styled contract viewer. Clicking "Locate" on any card smoothly scrolls the contract to the exact sentence and pulses it; clicking any highlighted phrase in the contract expands its plain-English translation, worst-case scenario, and replacement wording.
- Missing Protections Detector: Instead of only flagging bad text that is present, ClauseClear identifies crucial statutory protections the counterparty conveniently left out (e.g., 24-Hour Notice of Entry, 21-Day Itemized Deposit Return, or Academic & Hackathon IP Carve-Outs) and provides copy-pasteable protective clauses.
- "True Cost" Financial Liability Simulator: Unbundles advertised base rent from mandatory monthly add-ons and one-time move-in fees, converting abstract surcharges into relatable student benchmarks (e.g., "Enough for 27 grocery runs"): $$\text{Annual Hidden Surcharge} = 12 \times \left(\text{Monthly}{\text{true}} - \text{Monthly}{\text{advertised}}\right) + \text{Fees}_{\text{upfront}}$$ It also features interactive "What-If" switches so students can stress-test conditional penalties (like a $350 plumbing deductible or a 4-day late fee) and watch their 12-month worst-case liability bar update in real time.
- 1-Click 3-Tone Counter-Offer Drafter & Binding Rider A: Generates ready-to-send negotiation emails in three distinct tones (Collaborative / Polite Student, Firm Tenant, and Legal / Statutory Citation) alongside a formal, signable Schedule of Contract Amendments (Rider A) complete with superseded clauses, binding replacement text, and signature blocks.
How I Built It
I engineered ClauseClear with a Resilient Tri-Engine Architecture so that it works effortlessly in full-stack cloud environments, on zero-server static hosts (GitHub Pages), and 100% offline:
- Frontend & State Management: Built with Next.js 14 (App Router), React 18, TypeScript, and Tailwind CSS. I used Zustand (
use-audit-store.ts) for reactive global state management synchronizing the split-pane document viewer, filter tabs, financial simulator toggles, and counter-offer drawer. - Engine 1 — Server-Side Cloud AI (
/api/analyze&/api/negotiate): Powered by Google Gemini (gemini-3.5-flashdefault, with user-selectable Flash, Flagship, and Lite tiers) and the Vercel AI SDK (generateObject) enforcing strict Zod runtime schemas (ContractAuditResultSchema). - Engine 2 — Client-Direct Browser REST Engine (
src/lib/gemini-browser.ts): Because static exports (output: 'export') on GitHub Pages do not run a Node.js server, I built a browser-native Gemini REST client with CORS support that queries Google'sv1beta/modelsendpoint, resolves the best active model for a user's BYOK key, and executes structured JSON audits directly from the browser. - Engine 3 — Deterministic Local NLP Heuristic Engine (
src/lib/heuristic-analyzer.ts): A zero-dependency, in-memory client-side analyzer featuring 25 domain-specific legal trap rules, negation awareness (hasUnnegated), exemption carve-outs, and multi-currency financial extraction ($,RM,MYR,£,€). It guarantees instant, zero-latency audits with no API key required. - Automated CI/CD: Configured with GitHub Actions (
.github/workflows/deploy.yml) to compile and deploy the static export directly to GitHub Pages on every push.
Challenges I Ran Into
- Guaranteed Verbatim Substring Highlighting: LLMs occasionally paraphrase quotes or alter punctuation, which breaks substring matching in a split-pane highlighter. I solved this on the AI path via strict system prompting and case-insensitive interval fallback in
document-viewer.tsx, and on the heuristic path by building an offset-tracked sentence segmenter (Seg { start, end, text }) where everyexactQuoteis constructed viarawText.slice(seg.start, seg.end)—mathematically guaranteeing a 100% verbatim match. - Static Hosting vs. Live AI Execution: Deploying to GitHub Pages via Next.js
output: 'export'disables server-side/api/*routes. I overcame this by designing a self-healing failover pipeline inupload-zone.tsxandnegotiation-drawer.tsx: if the server route is unreachable, the client seamlessly routes tocallGeminiAuditDirectly(if a user API key is saved inlocalStorage) or fails over in 0ms toanalyzeCustomTextHeuristically. - Preventing False Positives on Negated Clauses: A naive regex scanner flags
"Landlord shall not enter without 24 hours notice"as a violation because it sees"enter"and"without". I wrote a lookbehind negation detector (hasUnnegated) and an exemption matcher (r.exempt) inheuristic-analyzer.tsso protective clauses are accurately celebrated as Fair / Safe Terms rather than false alarms.
What I Learned
- Deterministic + Generative Hybrid Design: Combining LLM reasoning with deterministic mathematical scoring (
scoring.ts) and regex/AST heuristics yields a far more trustworthy legal tool than relying on raw LLM chat completions alone. - Designing for Emotional Friction: Students often avoid negotiating leases because they fear sounding confrontational or losing their housing spot. Giving them a Collaborative ("Polite Student") tone alongside a formal Rider A attachment bridges the gap between social tact and binding contract law.
- Cross-Jurisdictional Nuances: Auditing student leases taught me how similar predatory patterns appear globally, from RUBS utility markups and California Civil Code § 1954 entry rules in the US to owners shifting statutory property taxes (Cukai Taksiran and Cukai Tanah) onto student tenants in Malaysia.
Scope, Simulated Functionality & Transparency Notice
- 1-Click Judge Mode Presets: The three sample cards (Oakwood Student Commons Lease, NextGen Startup Contributor Agreement, and IronPeak Fitness Club Membership) load pre-computed benchmark audits (
src/lib/sample-contracts.ts) so judges can inspect the full workspace in 0ms without needing an API key or sample document. - Custom Contract Auditing (Dual Online/Offline Modes): Pasting any custom contract text into the Your contract box executes a real, live audit. Without an API key, it runs locally via my 25-rule
analyzeCustomTextHeuristicallyNLP engine; with a free Google Gemini API key configured in the top-right AI Engine Settings modal, it executes live generative AI analysis via Google Gemini. - Legal Disclaimer: ClauseClear is an educational transparency and consumer-advocacy tool, not formal legal counsel or attorney representation.
Tools, Credits & AI Assistance Disclosure
Technologies & Libraries Used
- Core Framework: Next.js 14, React 18, TypeScript
- Styling & Motion: Tailwind CSS, Lucide React Icons,
canvas-confetti, Google Fonts (Bricolage Grotesque,Inter,JetBrains Mono,Newsreader) - State & Validation: Zustand (
persistmiddleware), Zod - AI & SDKs: Google Gemini API (
@ai-sdk/google, VercelaiSDK, and direct RESTv1beta/models)
AI Assistance & Originality Disclosure
- My Original Contributions: I conceived the ClauseClear product architecture, designed the 6-pillar student risk rubric and deterministic scoring formula (
scoring.ts), authored the 25-rule offset-tracked heuristic engine (heuristic-analyzer.ts), built the bi-directional split-pane highlighter (document-viewer.tsx), created the True Cost financial simulator (true-cost-sim.tsx), and engineered the Tri-Engine static/cloud failover pipeline. - How AI Tools Were Used: During development, I used AI coding assistants, powered by Gemini 3.8 Flash model, to help draft realistic predatory contract benchmark texts (
sample-contracts.ts), refine complex regular expressions for financial fee extraction, and review TypeScript schema alignments and UI accessibility attributes (aria-*roles and keyboard navigation). All code was reviewed, tested and integrated by me.
Built With
- github
- github-actions
- google-gemini
- next.js
- react
- tailwindcss
- typescript
- vercel-ai-sdk
- zod
- zustand


Log in or sign up for Devpost to join the conversation.