claudify
CLAUDE.md32 starsChanged 17 months agoMITArchived repositoryView on GitHub
This file provides guidance to Claude Code and other LLMs when working with this SDK. This is the Claude Code SDK Complete - a production-ready monorepo containing: - SDK: Universal integration layer for using Claude Code as a headless LLM provider - Demo: Full-featured chat application demonstrating all SDK capabilities - Documentation: Comprehensive guides for developers and LLMs - Examples: Ready-to-use integration examples The SDK handles: - Process management - Response parsing - Session continuity - Streaming - Error recovery
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Subscription-Based Access: No API keys needed - users authenticate via Claude.ai subscription
- Distinctive: line 36
Ensure Claude Code CLI is installed and user is logged in
- Distinctive: line 69
Always include all HTTP methods when setting up CORS:
- Distinctive: line 78
Always wrap SDK calls in try-catch:
- Distinctive: line 90
Use session IDs for conversation continuity:
- Distinctive: line 115
CORS errors: Ensure backend allows all necessary origins and methods
- Very specific: line 130
Check /docs/API_REFERENCE.md for detailed API docs
- Very specific: line 131
Use examples in /examples/ as templates
- Very specific: line 132
Follow patterns from the working demo in /packages/demo/
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md - Claude Code Integration Guide
This file provides guidance to Claude Code and other LLMs when working with this SDK.
Project Overview
This is the Claude Code SDK Complete - a production-ready monorepo containing:
- SDK: Universal integration layer for using Claude Code as a headless LLM provider
- Demo: Full-featured chat application demonstrating all SDK capabilities
- Documentation: Comprehensive guides for developers and LLMs
- Examples: Ready-to-use integration examples
Key Principles
- Subscription-Based Access: No API keys needed - users authenticate via Claude.ai subscription
- Real Implementation: Everything is real - no mocks, actual Claude Code CLI integration
- Production Ready: Complete error handling, retries, monitoring, and documentation
- LLM Friendly: Documentation specifically designed for AI-assisted integration
Architecture Summary
Your App → Claude Code SDK → Claude Code CLI → Claude.ai SubscriptionThe SDK handles:
- Process management
- Response parsing
- Session continuity
- Streaming
- Error recovery
When Integrating This SDK
Essential Steps:
- Ensure Claude Code CLI is installed and user is logged in
- Initialize SDK:
const sdk = new ClaudeCodeSDK() - Execute prompts:
await sdk.executeWithClaudeCode(prompt, options) - Handle responses properly with error checking
Common Patterns:
Basic Usage:
const result = await sdk.executeWithClaudeCode("Your prompt")
if (result.success) {
console.log(result.messages[0].content)
}Streaming:
for await (const chunk of sdk.executeStreamingWithClaudeCode("Prompt")) {
process.stdout.write(chunk)
}WebSocket Integration:
socket.on('message', async (data) => {
const result = await sdk.executeWithClaudeCode(data.prompt)
socket.emit('response', result)
})Important Implementation Notes
CORS Configuration
Always include all HTTP methods when setting up CORS:
cors({
origin: ['http://localhost:3000'],
methods: ['GET', 'POST', 'DELETE', 'PUT', 'PATCH', 'OPTIONS']
})Error Handling
Always wrap SDK calls in try-catch:
try {
const result = await sdk.executeWithClaudeCode(prompt)
} catch (error) {
if (error.code === 'CLI_NOT_FOUND') {
// Guide user to install Claude Code
}
}Session Management
Use session IDs for conversation continuity:
const sessionId = MessageConverter.generateSessionId()
await sdk.executeWithClaudeCode(prompt, {
continueSession: true,
sessionId
})Testing the Implementation
- Start the demo:
npm run demo- Backend runs on port 3001
- Frontend runs on port 3002
- Test features:
- Chat with Claude
- Switch models (Sonnet/Opus)
- Save/load conversations
- Export chat history
- Stream responses
Common Issues & Solutions
- Port conflicts: Kill existing processes on ports 3001/3002
- CORS errors: Ensure backend allows all necessary origins and methods
- CLI not found: User needs to install Claude Code from claude.ai/code
- Not authenticated: User needs to run
claude code login
File Structure Guide
/packages/sdk/- Core SDK implementation/packages/demo/client/- React frontend demo/packages/demo/server/- Express backend with Socket.io/docs/- All documentation/examples/- Integration examples
For LLMs Implementing This
- Read
/docs/LLM_INTEGRATION_GUIDE.mdfirst - Check
/docs/API_REFERENCE.mdfor detailed API docs - Use examples in
/examples/as templates - Follow patterns from the working demo in
/packages/demo/
Remember: This SDK enables subscription-based access to Claude without API keys!
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

