Skip to content

Test Claude Projects without copy-pasting. Local workbench for prompt engineering, agent testing, and workflow iteration. Direct Claude.ai access via cookie auth, 20+ prompt templates, web fetch/search tools, file uploads. Stop switching tabs to test your prompts.

Notifications You must be signed in to change notification settings

SEMalytics/claude_project_chat

Repository files navigation

Prompt Engineering Workbench | Claude Projects

A powerful workbench for testing and refining Claude-powered workflows, agents, and prompts.

⚠️ SECURITY WARNING: This tool is designed for local development only. Do NOT expose it to your network or the internet without adding proper authentication. It has no built-in access controls and anyone who can reach the server can use your API credentials and access your conversations.

Why This Tool?

Claude Projects lets you create custom AI assistants with specific instructions and knowledge bases. But testing those workflows requires switching between the Claude.ai interface, copying prompts, and manually iterating.

This workbench solves that by giving you:

⚠️ Note: This tool uses cookie-based authentication to access Claude.ai directly because the Claude Projects API is currently in beta and not publicly available. Once Anthropic releases the official Projects API, this tool can be updated to use proper API authentication instead of browser cookies. Until then, this is a practical workaround for teams who need to test their Projects programmatically.

  • Direct access to your Claude Projects - Test your agents with their full knowledge bases
  • Reusable prompt templates - Build, save, and iterate on prompts with variables
  • Tool execution - Claude can fetch web pages and search the web during analysis
  • Progress visibility - See what Claude is doing in real-time

Use Cases

Mode Best For
Projects Testing customer-facing agents, workflows with knowledge bases, complex multi-step prompts
API Simple prompt templating, quick iterations, no knowledge base needed

Features

Core Features

  • Dual Connection Modes - Use official API or direct Claude.ai web access
  • Mode Selector - Switch between API and Projects mode in Settings (when both configured)
  • Claude Projects Support - Access your Claude Projects with their knowledge bases
  • Project Selector - Switch between multiple Claude Projects on the fly
  • Configuration-driven - Works with any Claude Project by editing YAML config
  • 20+ Built-in Templates - Analysis, research, content creation, and more

Tool Execution

  • Web Fetch - Claude can fetch and analyze web pages automatically
  • Web Search - DuckDuckGo (default) or Google Custom Search integration
  • Progress Tracking - Visual progress bar with tool execution stats
  • Real-time Feedback - See fetches and searches as they happen

File & Content

  • File upload support - PDF, DOCX, TXT, MD (configurable)
  • Drag & drop uploads - Easy file handling
  • URL content fetching - Optionally fetch and analyze web content

UI/UX

  • Template System - Dynamic prompt builder with variable inputs
  • Conversation history - Maintains context within sessions
  • New Chat button - Start fresh conversations within projects
  • Settings modal - Manage projects, templates, and connection settings
  • Progress indicators - Animated progress bar during processing
  • Responsive design - Works on desktop and mobile

Connection Modes

Projects Mode (Recommended for Agent Testing)

Connect directly to Claude.ai using your browser session cookie. This is the primary use case for testing customer workflows and agents.

Why use Projects mode:

  • Test agents with their full knowledge bases and custom instructions
  • Validate complex workflows before deploying
  • Iterate on project configurations with real feedback
  • Access project-specific conversations and context

Header displays: Prompt Engineering Workbench | Claude Projects

API Mode (Simple Prompt Templating)

Use the standard Anthropic API for direct Claude access. Best for users who just need prompt templating without project features.

Why use API mode:

  • Simple prompt engineering and iteration
  • No knowledge base or custom instructions needed
  • Direct API access for testing raw prompts
  • Lower friction for quick experiments

Header displays: Prompt Engineering Workbench | Claude AI

Switching Modes

If you have both an API key and a Claude.ai cookie configured, you can switch between modes:

  1. Click the Settings (gear icon) in the header
  2. In the Connection section, you'll see mode toggle buttons
  3. Click Projects or API to switch modes
  4. The UI will update automatically (header title, project selector visibility)

Quick Start

1. Clone and Navigate

git clone https://github.com/SEMalytics/claude_project_chat.git
cd claude_project_chat

2. Run Setup (Recommended)

The easiest way to get started:

./setup.sh

This script will:

  • Check Python version (requires 3.9+)
  • Create a fresh virtual environment
  • Install all dependencies
  • Create .env from .env.example if needed

3. Manual Setup (Alternative)

If you prefer to set up manually:

# Remove any existing venv (if reinstalling)
rm -rf venv

# Create fresh virtual environment
python3 -m venv venv

# Install dependencies using venv's pip directly
./venv/bin/pip install --upgrade pip
./venv/bin/pip install -r requirements.txt

Important: Always use ./venv/bin/pip and ./venv/bin/python to ensure you're using the virtual environment's Python, not your system Python.

4. Configure Environment

# Copy example env file
cp .env.example .env

# Edit .env with your credentials
nano .env  # or: code .env, vim .env, etc.

For Claude.ai Web Client (Recommended):

# Get this from your browser's DevTools (see instructions below)
CLAUDE_COOKIE=sessionKey=sk-ant-sid01-xxx...

# Optional: Start in a specific conversation
CLAUDE_CONVERSATION_ID=your-conversation-uuid

Getting Your Claude Cookie:

  1. Open claude.ai and log in
  2. Open DevTools (F12 or Cmd+Option+I)
  3. Go to Network tab
  4. Click any request to claude.ai
  5. Find the Cookie header in Request Headers
  6. Copy the entire cookie string (starts with sessionKey=)

For Official Anthropic API:

ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
CLAUDE_PROJECT_ID=your-project-uuid-here

Optional: Google Custom Search (for web search tool)

By default, web search uses DuckDuckGo (no API key needed). For Google Custom Search:

# Get API key from: https://console.cloud.google.com/apis/credentials
GOOGLE_SEARCH_API_KEY=your-google-api-key

# Create search engine at: https://programmablesearchengine.google.com/
GOOGLE_SEARCH_CX=your-search-engine-id

5. Run the Server

# Using venv python directly (recommended)
./venv/bin/python app.py

# OR activate venv first, then run
source venv/bin/activate  # macOS/Linux
python app.py

You should see:

==================================================
  Prompt Engineering Workbench | Claude Projects

==================================================

  Server starting at http://127.0.0.1:5001
  Press Ctrl+C to stop

6. Open in Browser

Navigate to: http://127.0.0.1:5001

7. Enable Projects (First Time)

  1. Click the Settings (gear icon) in the header
  2. In "Active Projects", check the projects you want to use
  3. Click Save Changes
  4. Use the project dropdown in the header to switch projects

Configuration

Project Settings (project_config.yaml)

Edit this file to customize the interface:

# Project Identity
project:
  name: "My Project"
  description: "Description here"

# UI Customization
ui:
  title: "Chat Title"
  subtitle: "Subtitle text"
  primary_color: "#3b82f6"

# Features
features:
  file_upload: true
  url_fetching: true
  multi_file: true

# File Settings
files:
  allowed_extensions: [pdf, docx, txt, md]
  max_size_mb: 10
  max_files: 5

# Custom Prompts (for Simple Input mode)
prompts:
  - id: "general_chat"
    label: "General Chat"
    template: "{user_input}"
    requires_files: false
    placeholder: "Ask anything..."

Custom Templates (custom_prompts.yaml)

Create your own templates that persist across updates:

templates:
  - id: my_custom_template
    name: "My Custom Analysis"
    description: "Describe what this does"
    category: analysis
    template: |
      Analyze the following for [focus_area]:

      [content]
    variables:
      - name: focus_area
        label: "Focus Area"
        type: text
        required: true
      - name: content
        label: "Content to Analyze"
        type: textarea
        required: true

Project Structure

claude_project_chat/
├── app.py                   # Flask server with API routes
├── config.py                # Configuration loader
├── project_config.yaml      # Project-specific settings
├── custom_prompts.yaml      # Your custom templates (gitignored)
├── requirements.txt         # Python dependencies
├── .env                     # API keys/cookies (gitignored)
├── .env.example             # Example environment file
├── static/
│   ├── css/styles.css       # Custom styles
│   ├── js/
│   │   ├── app.js           # Main frontend JavaScript
│   │   └── prompt-builder.js # Template UI + Project Manager
│   └── uploads/             # Temporary file storage
├── templates/
│   └── index.html           # Chat interface template
└── utils/
    ├── __init__.py
    ├── claude_client.py     # Official Anthropic API wrapper
    ├── claude_web_client.py # Claude.ai web client (cookie auth)
    ├── tool_handler.py      # Tool execution handler
    ├── file_processor.py    # File handling
    ├── url_fetcher.py       # URL content fetching
    ├── prompt_templates.py  # 20+ built-in templates
    └── prompt_compiler.py   # Template compilation

API Endpoints

Endpoint Method Description
/ GET Main chat interface
/api/chat POST Send message to Claude
/api/upload POST Upload file
/api/fetch-url POST Fetch URL content
/api/templates GET Get all templates
/api/prompts GET Get legacy prompts
/api/session/{id} GET Get session history
/api/session/{id} DELETE Clear session
/api/config GET Get project config
/api/client-status GET Check connection mode and available options
/api/switch-mode POST Switch between API and Web modes
/api/update-cookie POST Update Claude.ai cookie
/api/projects GET List available projects
/api/projects/set-active POST Switch active project
/api/conversations GET List conversations
/api/conversations/new POST Start new conversation

Built-in Template Categories

  • Analysis - SWOT, competitive, gap analysis
  • Research - Literature review, market research, trend analysis
  • Content - Blog posts, social media, email campaigns
  • Technical - Code review, documentation, architecture
  • Business - Business plans, proposals, reports
  • Creative - Brainstorming, storytelling, naming

Troubleshooting

Cookie Authentication Issues

"Access denied (403)"

  • Your cookie has expired. Get a fresh one from claude.ai DevTools
  • Update via Settings modal or edit .env directly

Projects not showing

  1. Click Settings (gear icon)
  2. Click "Refresh Projects"
  3. Enable the projects you want
  4. Save Changes

API Issues

"ANTHROPIC_API_KEY is required"

  • Check that .env file exists and contains your API key
  • Ensure the key starts with sk-ant-

File Upload Issues

  • Check file extension is in allowed_extensions
  • Verify file size is under max_size_mb
  • Ensure static/uploads/ directory exists

Module Not Found

# Activate virtual environment
source venv/bin/activate

# Reinstall dependencies
pip install -r requirements.txt

Pip Installation Issues

If pip installs to wrong location:

# Use venv binaries directly
./venv/bin/pip install -r requirements.txt
./venv/bin/python app.py

Development

Format Code

pip install black flake8
black .
flake8 .

Run Tests

pip install pytest
pytest

Security Notes

  • API keys and cookies are stored in .env (not committed to git)
  • Runs locally on 127.0.0.1 by default
  • Uploaded files are stored temporarily in static/uploads/
  • Cookie-based auth uses your Claude.ai session - keep it secure
  • Consider adding authentication for production use

Credits & Acknowledgments

This project uses and was inspired by several open-source projects:

Libraries Used

Inspiration

Built With

License

MIT License - Use freely for your projects.


Note: This is an unofficial tool and is not affiliated with Anthropic. Use responsibly and in accordance with Anthropic's terms of service.


About SEMalytics

This tool is built by SEMalytics—making AI development workflows practical.

Related Projects:

  • Forge — AI code generation with 12-agent review system
  • KnowledgeForge — Multi-agent orchestration methodology
  • Concept Clarity — Message clarity measurement system

Learn more at SEMalytics →


Built by SEMalytics · AI tools that ship.

About

Test Claude Projects without copy-pasting. Local workbench for prompt engineering, agent testing, and workflow iteration. Direct Claude.ai access via cookie auth, 20+ prompt templates, web fetch/search tools, file uploads. Stop switching tabs to test your prompts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •