In-House Tool with Claude Code
Use Claude Code to rapidly build an internal legal research tool powered by the Moonlit API -- without writing code yourself.
What you'll build
Claude Code is Anthropic's agentic coding tool that can build complete applications from natural-language instructions. Combined with the Moonlit API, it enables legal professionals and non-developers to create custom internal tools without writing code themselves. This guide walks through the process of using Claude Code to build a purpose-built legal research tool. You describe what you want in plain language -- for example, "Build a web app where I can search Dutch employment case law and get AI summaries" -- and Claude Code writes, tests, and iterates on the application. The approach is particularly powerful for in-house legal teams that need custom workflows (e.g., a GDPR audit trail checker, a contract clause library with semantic search, or a due diligence document reviewer) but do not have dedicated development resources.
Architecture
┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │ You describe │ │ Claude Code │ │ Working app │ │ the tool in │───▶│ builds it │───▶│ with Moonlit │ │ plain English │ │ iteratively │ │ API integrated │ └────────────────┘ └────────────────┘ └────────────────┘
Prerequisites
- Claude Code installed (claude.ai/code)
- A Moonlit API key
- Node.js 18+ installed
Step-by-step
Set up the project
Create a new directory and initialize the project. Store your API key in a .env file that Claude Code can reference.
mkdir moonlit-research-tool && cd moonlit-research-tool
echo "MOONLIT_API_KEY=your-api-key" > .env
claudeDescribe your tool to Claude Code
Use a detailed prompt that explains the tool's purpose, the Moonlit API endpoints to use, and the desired UI. Be specific about functionality and layout -- the more detail you provide, the better the first iteration will be.
Build a Next.js web application for our in-house legal team that:
1. Has a search bar where users can enter legal research questions
2. Uses the Moonlit API (base: https://api.moonlit.ai/v1.1) for search
- Auth header: Ocp-Apim-Subscription-Key with the key from .env
- Use POST /search/hybrid_search_reranked for best results
3. Shows results in a clean table with: ECLI, court, date, summary
4. Clicking a result fetches the full document via GET /document/retrieve_document
and shows it in a side panel with the AI summary highlighted
5. Has filter dropdowns for jurisdiction (load from GET /search/filters/jurisdictions_portals)
and document type (load from GET /search/filters/documenttypes)
6. Style it professionally with Tailwind CSS
The API key is in .env as MOONLIT_API_KEY.Iterate on the result
Review what Claude Code builds, then ask for refinements. The iterative process is where the tool becomes truly useful for your specific team's needs.
# Example refinements to ask Claude Code:
"Add a date range picker that sets from_date and until_date on the search"
"Add an export button that downloads the current results as a CSV file"
"Add a 'Research History' sidebar that saves past searches to localStorage"
"Make the document panel show the full HTML with proper formatting"
"Add a loading skeleton while results are being fetched"