agentleFS
neno-is-oooneno-is-ooo/claudify/CLAUDE.md

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
  1. Distinctive:

    Subscription-Based Access: No API keys needed - users authenticate via Claude.ai subscription

    line 15
  2. Distinctive:

    Ensure Claude Code CLI is installed and user is logged in

    line 36
  3. Distinctive:

    Always include all HTTP methods when setting up CORS:

    line 69
  4. Distinctive:

    Always wrap SDK calls in try-catch:

    line 78
  5. Distinctive:

    Use session IDs for conversation continuity:

    line 90
  6. Distinctive:

    CORS errors: Ensure backend allows all necessary origins and methods

    line 115
  7. Very specific:

    Check /docs/API_REFERENCE.md for detailed API docs

    line 130
  8. Very specific:

    Use examples in /examples/ as templates

    line 131
  9. Very specific:

    Follow patterns from the working demo in /packages/demo/

    line 132

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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

  1. Subscription-Based Access: No API keys needed - users authenticate via Claude.ai subscription
  2. Real Implementation: Everything is real - no mocks, actual Claude Code CLI integration
  3. Production Ready: Complete error handling, retries, monitoring, and documentation
  4. LLM Friendly: Documentation specifically designed for AI-assisted integration

Architecture Summary

Your App → Claude Code SDK → Claude Code CLI → Claude.ai Subscription

The SDK handles:

  • Process management
  • Response parsing
  • Session continuity
  • Streaming
  • Error recovery

When Integrating This SDK

Essential Steps:

  1. Ensure Claude Code CLI is installed and user is logged in
  2. Initialize SDK: const sdk = new ClaudeCodeSDK()
  3. Execute prompts: await sdk.executeWithClaudeCode(prompt, options)
  4. 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

  1. Start the demo: npm run demo
    • Backend runs on port 3001
    • Frontend runs on port 3002
  2. Test features:
    • Chat with Claude
    • Switch models (Sonnet/Opus)
    • Save/load conversations
    • Export chat history
    • Stream responses

Common Issues & Solutions

  1. Port conflicts: Kill existing processes on ports 3001/3002
  2. CORS errors: Ensure backend allows all necessary origins and methods
  3. CLI not found: User needs to install Claude Code from claude.ai/code
  4. 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

  1. Read /docs/LLM_INTEGRATION_GUIDE.md first
  2. Check /docs/API_REFERENCE.md for detailed API docs
  3. Use examples in /examples/ as templates
  4. Follow patterns from the working demo in /packages/demo/

Remember: This SDK enables subscription-based access to Claude without API keys!

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.