Claude Code Instructions
Defines which files to modify and which to preserve in a Flask chatbot repo with two parallel versions.
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
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:
- Original files - Full-featured version supporting multiple LLM providers
- New files (
*_new.*) - Trimmed version supporting only OpenAI o3 and o1-pro models
File Structure
Original Files (DO NOT MODIFY)
| File | Purpose |
|---|---|
app.py | Original backend with all models (GPT-4o, GPT-4.1, o3, o4-mini, o3-mini, o1-pro, Claude, Gemini) |
templates/index.html | Original frontend with full model selection |
templates/index2.html | Original file viewer |
New Files (Active Development)
| File | Purpose |
|---|---|
app_new.py | Trimmed backend - only o3 and o1-pro models |
templates/index_new.html | Trimmed frontend - only o3 and o1-pro in dropdown |
templates/index2_new.html | File viewer for new version |
Critical Rules
1. Preserve Original Files
NEVER modify the following files:
app.pytemplates/index.htmltemplates/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.htmlortemplates/index2_new.html - If you need to reference original implementation, read from
app.pyortemplates/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-proonly - 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
o3ando1-prooptions - Removed: Claude Extended Thinking checkbox
- Streaming: Hardcoded to
false(both models use non-streaming)
Adding New Features
When adding new functionality:
- First check if similar functionality exists in the original files
- Implement changes only in the
*_new.*files - Test thoroughly before considering backporting to original files
- Document any new endpoints or features in this file
API Endpoints (New Version)
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Main chat interface |
/get-token | GET | Generate unique session token |
/stream | GET | Process prompt and return response |
/select_model | POST | Change active model |
/save | POST | Save conversation |
/autosave | POST | Auto-save conversation |
/load | GET | Load previous conversation |
/reset | POST | Reset conversation |
/shutdown | POST | Shutdown server |
/filecontents | GET | File viewer interface |
/open_folder | POST | Open folder picker |
/load_selection | POST | Load selected files |
/update-math-render | POST | Toggle 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.htmlwith your own parallel file names - Replace model names
o3,o1-prowith 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
Character Persona
Defines a Fallout 2 roleplay persona for an LLM agent: charming rogue with social-first combat and moral code.
How to implement tool use
Explains how to define, configure, and control tool use with the Anthropic API, including model selection, tool definitions, output control, and parallel calls.
Gemini by Example
Collects 20+ Gemini API code examples covering text, images, audio, video, PDFs, agents, and token counting.
Claude Tool Use (Function Calling) Documentation
Teaches how to define and use Claude tool use (function calling) with Python, including schema rules, execution patterns, and best practices.