Back to .md Directory

Claude Code Instructions

Defines which files to modify and which to preserve in a Flask chatbot repo with two parallel versions.

May 2, 2026
0 downloads
1 views
ai llm prompt claude openai gemini
View source

What this file does

Defines which files to modify and which to preserve in a Flask chatbot repo with two parallel versions.

When to use it

  • You maintain a project with original and trimmed codebases side by side
  • You want to prevent an AI assistant from editing reference files
  • You need clear boundaries between active development files and archived implementations
  • You onboard a new developer to a repo with parallel file versions

Assumes this stack

FlaskPythonOpenAIHTML

Claude Code Instructions

This document provides instructions for Claude Code when working on this repository.

Project Overview

This is a multi-model AI chatbot built with Flask. The project has two parallel versions:

  1. Original files - Full-featured version supporting multiple LLM providers
  2. New files (*_new.*) - Trimmed version supporting only OpenAI o3 and o1-pro models

File Structure

Original Files (DO NOT MODIFY)

FilePurpose
app.pyOriginal backend with all models (GPT-4o, GPT-4.1, o3, o4-mini, o3-mini, o1-pro, Claude, Gemini)
templates/index.htmlOriginal frontend with full model selection
templates/index2.htmlOriginal file viewer

New Files (Active Development)

FilePurpose
app_new.pyTrimmed backend - only o3 and o1-pro models
templates/index_new.htmlTrimmed frontend - only o3 and o1-pro in dropdown
templates/index2_new.htmlFile viewer for new version

Critical Rules

1. Preserve Original Files

NEVER modify the following files:

  • app.py
  • templates/index.html
  • templates/index2.html

These files serve as reference implementations. All new development should occur in the *_new.* files.

2. When Making Changes

  • All backend changes go in app_new.py
  • All frontend changes go in templates/index_new.html or templates/index2_new.html
  • If you need to reference original implementation, read from app.py or templates/index.html

3. Running the Application

To run the new trimmed version:

python app_new.py

To run the original full version:

python app.py

Current State of New Files

app_new.py

  • Supported models: o3, o1-pro only
  • API: OpenAI Responses API (non-streaming)
  • Both models use: store=True, reasoning={"effort": "high"}
  • Removed: Anthropic client, Gemini client, Claude thinking flag
  • Default model: o3

templates/index_new.html

  • Model dropdown: Only o3 and o1-pro options
  • Removed: Claude Extended Thinking checkbox
  • Streaming: Hardcoded to false (both models use non-streaming)

Adding New Features

When adding new functionality:

  1. First check if similar functionality exists in the original files
  2. Implement changes only in the *_new.* files
  3. Test thoroughly before considering backporting to original files
  4. Document any new endpoints or features in this file

API Endpoints (New Version)

EndpointMethodDescription
/GETMain chat interface
/get-tokenGETGenerate unique session token
/streamGETProcess prompt and return response
/select_modelPOSTChange active model
/savePOSTSave conversation
/autosavePOSTAuto-save conversation
/loadGETLoad previous conversation
/resetPOSTReset conversation
/shutdownPOSTShutdown server
/filecontentsGETFile viewer interface
/open_folderPOSTOpen folder picker
/load_selectionPOSTLoad selected files
/update-math-renderPOSTToggle math rendering

Notes

  • The new version removes all streaming logic since both o3 and o1-pro use the OpenAI Responses API which returns complete responses
  • Session management and conversation persistence work identically to the original
  • File viewer functionality is preserved unchanged

What's inside

4 sections: project overview, file structure table, 3 critical rules, API endpoint table with 14 routes

Change this for your project

  • Replace file names like app.py, app_new.py, templates/index_new.html with your own parallel file names
  • Replace model names o3, o1-pro with the models your trimmed version supports
  • Replace the API endpoint table with your own routes

Where it goes

Use as the system prompt for your model call, or as the base instructions in your agent framework.

Worth borrowing

  • Separating reference files from active files with a DO NOT MODIFY rule
  • Using a table to map each file to its purpose for quick orientation

Related Documents