Claude Code for Hoppscotch (2026)
The Setup
You are using Hoppscotch as your API testing platform — the open-source Postman alternative. Claude Code can generate API requests, collections, and test scripts for Hoppscotch, but it formats output for Postman or cURL instead of Hoppscotch’s collection format and misses Hoppscotch-specific features like environments and pre-request scripts.
What Claude Code Gets Wrong By Default
-
Generates Postman collection JSON format. Claude exports API collections in Postman’s
v2.1format. Hoppscotch uses its own JSON format for collections and cannot directly import Postman files without conversion. -
Uses Postman’s
pm.*scripting API. Claude writes pre-request and test scripts withpm.environment.set()andpm.response.json(). Hoppscotch uses a different scripting API withpw.*functions. -
Ignores Hoppscotch’s environment variable syntax. Claude uses
{{variable}}which looks correct but Hoppscotch processes variables differently in headers vs body. Claude does not distinguish between these contexts. -
Creates separate cURL commands instead of collections. Claude generates individual cURL commands for testing. Hoppscotch organizes requests into collections with shared auth, environments, and test flows.
The CLAUDE.md Configuration
# Hoppscotch API Testing
## Tool
- API Client: Hoppscotch (self-hosted or hoppscotch.io)
- Collections: JSON format in .hoppscotch/ directory
- CLI: @hoppscotch/cli for CI/CD API testing
- Environments: dev, staging, prod variable sets
## Hoppscotch Rules
- Use Hoppscotch collection format, NOT Postman format
- Pre-request scripts use pw.* API (pw.env.set, pw.env.get)
- Test scripts use pw.expect() assertions
- Variables use <<variable>> in some contexts
- Auth tokens stored in environment variables, not hardcoded
- Collections exported as JSON for version control
## Conventions
- Collections in .hoppscotch/collections/ directory
- Environments in .hoppscotch/environments/ directory
- Base URL in environment variable: {{baseUrl}}
- Auth token in environment: {{authToken}}
- Run CI tests: hopp test -e environment.json collection.json
- One collection per API domain (users, projects, billing)
Workflow Example
You want to create API tests for a new endpoint. Prompt Claude Code:
“Create a Hoppscotch collection for the /api/projects CRUD endpoints. Include environment variables for the base URL and auth token, add pre-request scripts to set the auth header, and write test assertions for status codes and response shapes.”
Claude Code should produce a Hoppscotch-format JSON collection with GET, POST, PUT, DELETE requests, environment files with baseUrl and authToken variables, pre-request scripts using pw.env.get("authToken") to set the Authorization header, and test scripts using pw.expect() assertions.
Common Pitfalls
-
CLI collection format mismatch. Claude generates collection JSON that works in the Hoppscotch web UI but fails with
@hoppscotch/cli. The CLI expects exported collection format — re-export from the UI or ensure the JSON matches the CLI schema. -
Environment variable scoping. Claude sets variables in pre-request scripts expecting them to persist across requests. Hoppscotch environment variables set via
pw.env.set()persist for the session but may not save to the environment file. Use global environments for persistent values. -
Self-hosted auth configuration. Claude configures Hoppscotch requests against a self-hosted instance but forgets that self-hosted Hoppscotch may need CORS headers from your API. Add your Hoppscotch instance origin to the API’s allowed origins list.
Related Guides
Try it: Paste your error into our Error Diagnostic for an instant fix.
- Claude Code API Endpoint Testing Guide
- Claude Code API Contract Testing Guide
- Building a REST API with Claude Code Tutorial
Related Articles
- Claude Code for Workspace Indexing Workflow Tutorial
- Claude Code For Redwood JS — Complete Developer Guide
- Claude Code Enterprise Disaster Recovery Workflow Planning
- Claude Code For Jmh Benchmark — Complete Developer Guide
- Claude Code Workflow for Turkish Developer Teams
- Claude Code Git Lfs Large Files — Complete Developer Guide
- Claude Code for Astro Integrations Workflow Guide
- Claude Code for ARIA Live Regions Workflow Guide
Common Questions
How do I get started with claude code for hoppscotch?
Begin with the setup instructions in this guide. Install the required dependencies, configure your environment, and test with a small project before scaling to your full codebase.
What are the prerequisites?
You need a working development environment with Node.js or Python installed. Familiarity with the command line and basic Git operations is helpful. No advanced AI knowledge is required.
Can I use this with my existing development workflow?
Yes. These techniques integrate with standard development tools and CI/CD pipelines. Start by adding them to a single project and expand once you have verified the benefits.
Where can I find more advanced techniques?
Explore the related resources below for deeper coverage. The Claude Code documentation and community forums also provide advanced patterns and real-world case studies.