Skip to content

[WIP] Set up monorepo project structure for ContextLens#1

Closed
Copilot wants to merge 1 commit into
mainfrom
copilot/contextlens-setup-monorepo
Closed

[WIP] Set up monorepo project structure for ContextLens#1
Copilot wants to merge 1 commit into
mainfrom
copilot/contextlens-setup-monorepo

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

  • Create extension/ directory with VS Code extension shell
    • package.json (extension manifest)
    • tsconfig.json
    • src/extension.ts (activation + webview panel)
    • src/webviewProvider.ts (WebviewViewProvider)
  • Create webview/ directory with React/Vite frontend
    • package.json
    • tsconfig.json
    • vite.config.ts
    • index.html
    • src/main.tsx
    • src/App.tsx (bar chart + cost meter UI)
    • src/components/ContextBar.tsx
    • src/components/CostMeter.tsx
    • src/hooks/useWebSocket.ts
  • Create proxy/ directory with FastAPI proxy
    • requirements.txt
    • main.py (intercepts /v1/messages, pushes to WebSocket)
  • Create gemma/ directory with Gemma analyzer
    • requirements.txt
    • analyzer.py
  • Update .gitignore to exclude node_modules, dist, pycache, etc.
Original prompt

Please build the ContextLens project based on the following Product Requirements Document (PRD).

Set up the required monorepo project structure:

  • extension/ (VS Code extension)
  • webview/ (React/Vite frontend)
  • proxy/ (FastAPI proxy)
  • gemma/ (Gemma analyzer)

Focus on the Core MVP deliverables:

  1. The VS Code extension shell (extension/) that registers the Webview.
  2. The Vite React app (webview/) containing the basic UI for the bar chart and cost meter.
  3. The FastAPI proxy (proxy/) that intercepts /v1/messages and pushes to the WebSocket.

Here is the full PRD:

ContextLens — Product Requirements Document

Version: 1.0
Date: April 25, 2026
Target Event: BearHacks Hackathon (36 hours)
Team Size: 4


1. Product Overview

1.1 What It Is

ContextLens is a VS Code extension that visualizes, gates, and optimizes Claude Code's context window in real time. It intercepts every API call Claude Code makes, displays a live bar chart showing what is consuming tokens, and lets the developer trim, edit, or delete sections before the request is sent — reducing costs and preventing context window bloat.

1.2 One-Line Pitch

"DevTools Network Tab for LLM API calls — see what's in your context window, trim the waste, save 70% on every request."

... (Please refer to the full architectural and feature requirements to implement the baseline functionality).

Ensure you include the package.json, tsconfig.json, requirements.txt and base entry points for each service as outlined in section 8 (Project Structure) of the PRD.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: build this

Assistant: I've started a coding agent to build out the ContextLens MVP based on the PRD; please accept the tool call in the dialog to let it proceed.

This pull request was created from Copilot chat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants