AI News

  • Loading...

Setting Up CLAUDE.md for Claude Code: Complete Guide with Templates

On
Setting Up CLAUDE.md for Claude Code: Complete Guide with Templates

A well-crafted CLAUDE.md file won't do your thinking for you—but it eliminates the tedious repetition of explaining the same technical constraints, boundaries, and verification processes in every conversation. This is where the real productivity gains happen.

The file works best when it's not just a generic wish list. Instead, it should tell Claude Code which commands actually work in your setup, where the critical code lives, which files are off-limits for changes, and how to verify when a task is genuinely complete.

What CLAUDE.md Does

CLAUDE.md is a standard Markdown file that Claude Code loads into its project memory and uses as supplemental guidance during work sessions. It's the ideal place to store details that apply across multiple tasks:

  • Reliable commands for development, testing, and building your application
  • An overview of key directories and main entry points
  • Architectural patterns and dependency conventions
  • Hard boundaries—for example, "never run database migrations without explicit approval"
  • Clear completion criteria so Claude can verify the work actually meets requirements

This doesn't replace a detailed task description. Specific outputs, scope, and acceptance criteria should still be stated in your current prompt. Conversations can be trimmed or lose important context over time. Put long-term project rules and constraints in this file instead of relying on chat history.

Hierarchical Structure: System-Level, Project-Level, and Subdirectories

Claude Code assembles configuration files based on your working path. On startup, it layers content from outermost folders inward. CLAUDE.local.md in the same directory gets loaded after CLAUDE.md. A CLAUDE.md in a subdirectory gets included in context when Claude reads files in that area.

Example of a real-world hierarchy

~/.claude/CLAUDE.md
  Personal rules applied to every project

~/projects/shop/CLAUDE.md
  General shop project guidelines

~/projects/shop/apps/admin/CLAUDE.md
  Specific rules for the admin frontend

~/projects/shop/apps/admin/src/payments/CLAUDE.md
  Extra safeguards for payment processing

Put shared project information in CLAUDE.md at your project root, or in .claude/CLAUDE.md one level up. Pick a convention and stick with it across the repository. Write rules so they don't conflict with each other—Claude Code merges file contents instead of applying a priority system to resolve contradictions.

Claude Code's official documentation on memory hierarchy
Claude Code's official documentation on memory hierarchy

Anthropic covers project-level, user-level, and local memory files in detail in the official Memory documentation. The exact interfaces and terminology may shift, so check back there when making major configuration changes.

What Goes Into Each File

System-Wide CLAUDE.md

Your ~/.claude/CLAUDE.md file holds personal rules that apply across multiple projects. This might include formatting preferences, your preferred languages for code and comments, or your personal authentication workflow. It shouldn't contain assumptions tied to any specific repository.

Project-Level CLAUDE.md

This file lives in your repository and describes the overall project state. Keep it under version control when your team needs to stay aligned on common commands and rules. Only include information that actually reflects your codebase, configuration, or decisions the team has agreed on.

CLAUDE.local.md

Use CLAUDE.local.md for personal additions at the same location—like local test data or your personal workflow shortcuts. Add this to .gitignore. Passwords, API keys, customer data, and other sensitive information have no place in any CLAUDE.md file.

Rules for Subdirectories

Creating files in subdirectories makes sense when a specific area has unique risks or conventions. Payment processing, data migrations, and mobile apps are classic examples. Don't duplicate your entire root file here—just add rules specific to that area.

Pro Tip: An effective rule is one that drives specific decisions. "Write clean code" is vague. "Run existing migration tests before altering database schema" is something you can actually verify.

System-Wide CLAUDE.md for Your Workflow

Your system-level file at ~/.claude/CLAUDE.md should be repository-agnostic. This is where you define how Claude works with you in general. Avoid assumptions about specific frameworks or projects.

Sample content for ~/.claude/CLAUDE.md

# Personal Working Guidelines

## Collaboration
- Explain your plan and verification steps before making large changes.
- Ask clarifying questions if expected outcomes or scope aren't clear.

## Code
- Prefer TypeScript if the project already uses it.
- Use the project's existing formatters and test runners.

## Before You Finish
- List changed files and completed checks.
- Flag any remaining risks or unknowns.

A Lean Template for Your Project Root

Create the file directly in your project root, or let Claude Code draft an initial version with /init. Auto-generated drafts won't capture your project's nuances. Review, remove bad assumptions, and only add rules you actually follow.

CLAUDE.md template for projects

# Project Name

One sentence describing the product and who uses it.

## Key Directories
- src/app/: routes and pages
- src/lib/: business logic and integrations
- tests/: automated test suites

## Running and Verifying
bash
npm run lint
npm run test
npm run build


## Core Rules
- Check for existing components before creating new ones.
- Validate all input at API boundaries.
- Document changes to public interfaces.

## Hard Limits
- Never log sensitive information to files or output.
- Don't run data migrations without a confirmed plan.
- Ask before proceeding if requirements are unclear.

## Task Complete When
- All agreed-upon checks pass.
- Documentation and tests reflect actual behavior.

Use the @imports syntax to reference long, stable documents. A line like @docs/architecture.md will load that file at startup. What's interesting here is that imports only support a limited depth, so avoid importing your entire documentation suite by default.

How CLAUDE.md Differs from Auto Memory

Auto Memory stores reusable insights privately and locally. The system discovers stable project patterns as Claude works and learns from them. It's different from guidelines you've vetted and shared in your repository.

CLAUDE.md remains the authoritative source for standards, security boundaries, commands, and architectural decisions. Think of Auto Memory as a helper tool. The /memory command lets you view and manage stored items.

What If Claude Code Ignores Your Rules?

  1. Run pwd to confirm Claude Code launched in the intended project directory.
  2. Open /context and check what's loaded in the current session.
  3. Use /memory to make sure Auto Memory isn't conflicting with a specific project rule.
  4. Run claude --version and claude doctor if setup or configuration looks unusual.
  5. Try claude --safe-mode if you're troubleshooting customization errors. This mode skips CLAUDE.md files, skills, plugins, hooks, MCP servers, and Auto Memory. Authentication, model selection, built-in tools, and permissions still work normally. Management policies remain active.

If the file loaded but Claude still misbehaved, narrow down your rules and name specific verification steps. Instead of "be careful with emails," write "display the recipient, subject, and body for confirmation before sending."

Working Alongside Other Development Tools

Some teams also use AGENTS.md files. Avoid duplicating rules across multiple files when you can. Claude Code can include a shared file through an import like @AGENTS.md. Then your CLAUDE.md (kept concise) can explain why that file takes the lead and list Claude-specific additions.

Review your actual commands and most critical rules after each major change. A short, accurate file beats a lengthy collection of outdated guidelines every time.


Description: Learn how to create effective CLAUDE.md files at system, project, and subdirectory levels to guide Claude Code through your workflows.

Related Articles

Converting Stories Into Storyboards With Dola AI

On
Converting Stories Into Storyboards With Dola AI

Turning a story or script into a comic book traditionally means breaking it down into individual scenes and determining what content belongs in each one. Here's the thing: doing this manually eats up serious time. You're reading, analyzing, reorganizing plot points, and basically doing all the heavy lifting yourself.

Dola offers a smarter approach. The platform can automatically convert your story content into a detailed comic storyboard script in text format. It handles the scene sequencing for you, then suggests settings, characters, actions, and dialogue for each panel. Essentially, it gives you a solid foundation to develop into a full comic or series of illustrations.

Creating a Storyboard Script on Dola AI

Step 1:

Head to Dola AI using the link below and log into your account. In the chat interface, click Quick to switch to Pro mode.

https://www.dola.com

Pro mode on Dola

Step 2:

Now select the Skills section to access available tools.

Skills on Dola AI

When the skills menu appears, click on Create Comic Storyboard to get started.

Create comic storyboard on Dola AI

Step 3:

Enter your conversion request—describe the story or idea you want transformed into a specific number of scenes. Here's an example prompt to follow.

Convert the following content into a vibrant, cheerful, and colorful animated storyboard with 8 scenes. For each scene, describe the setting, characters, actions, expressions, camera angle, and dialogue in Vietnamese. Keep character details and visual elements consistent across all scenes.

Content: Lan is a 17-year-old girl living with her grandmother in a small, colorful house. One afternoon while tidying the storage room, Lan discovers a glowing star-shaped key that sparkles mysteriously. Curious, she carries the key and explores the house. She happily finds a small staircase leading down to a basement she never noticed before. There, she spots a secret door with a star-shaped lock. When Lan inserts the key, the door swings open and brilliant light floods out. Behind it is a hidden room filled with old photographs, toys, and precious family keepsakes. Lan excitedly explores the room and decides to tell her grandmother about this discovery. Finally, Lan and her grandmother look through the old memories together and happily share family stories.

Step 4:

Wait a moment for Dola to process your request and generate the storyboard. You'll receive complete scene content and scripts—in this case, eight fully developed scenes.

Storyboard content
Dola AI storyboard creation

Review the output and request refinements if needed. Want more scenes? Change the dialogue? Add character details or environmental descriptions? You can iterate until it matches your vision.

Character and effects settings

Step 5:

Once you're satisfied, use this storyboard as your foundation. You can build image-generation prompts from each scene or use it as a blueprint for developing your full comic. Click the save icon to export the storyboard content as a CSV file.

Download storyboard content on Dola AI

Tips for Creating Better Storyboards on Dola AI

To get results that actually match what you're envisioning, provide a story with clear progression. Be specific about scene count, visual style, and what details should appear in each scene. If your story has multiple characters, describe their distinctive features so the scenes stay visually consistent. Here's the basic formula for your prompt:

[Conversion Request] + [Scene Count] + [Style] + [Content Details] + [Language]

Example: Convert this story into 8 comic scenes + cheerful animation style + describe setting, characters, actions, and dialogue + write in Vietnamese.

  • Scene count: 6, 8, 10, or whatever works for your story.
  • Language: specify if you want output in Vietnamese or another language.
  • Style: animated, manga, fairytale, comedic, realistic—whatever fits your vision.
  • Scene information: setting, characters, actions, expressions, dialogue.
  • Consistency: request that character traits and visual details remain constant across scenes.
  • Detail level: if you'll use this to generate images later, ask for more specific descriptions of settings and actions.

Description: Learn how to transform narrative ideas into detailed comic storyboards using Dola AI's automated scene-building tool.

Related Articles

Transform Rough Sketches Into Polished Images With ChatGPT's New Sketch Tool

On
Transform Rough Sketches Into Polished Images With ChatGPT's New Sketch Tool

Here's something genuinely cool: ChatGPT's latest feature, called Sketch, lets you turn rough doodles into AI-polished artwork without typing a single prompt. Just draw something—anything, really—and ChatGPT transforms your scribbles into a finished image that matches your vision.

What makes this stand out is the simplicity. You don't need to write detailed commands or explain your concept in text. Every step happens through ChatGPT's interface. Feed it a rough sketch, and the AI analyzes it, then generates a complete, detailed image you'd never create by hand alone. It takes your rough concept and turns it into something visually polished and easy to understand. Below, we'll walk you through using ChatGPT Sketch on both mobile and desktop.

Creating Finished Images From Sketches on ChatGPT Sketch Mobile

Step 1:

Open ChatGPT and tap the menu icon to access the options. Navigate to the Images section, then select the Sketch tool.

Step 2:

The Sketch interface loads and you're ready to draw directly into ChatGPT. You can also switch to block mode if you prefer drawing with shapes instead of freehand lines.

Step 3:

Tap the colored circle to pick your stroke color. Then draw whatever you want and hit send. ChatGPT Sketch immediately analyzes your sketch and converts it into a complete, refined image.

The image generation prompt is already built in, so you don't need to modify anything.

Step 4:

Wait a moment, and your finished image appears.

ChatGPT Sketch chuyển nét vẽ thành ảnh

If you like the result, download it. Or add new text commands to refine or adjust the image further.

Ảnh tạo trên ChatGPT

Using ChatGPT Sketch on Desktop

The desktop version gives you more control—you can actually edit the AI prompt if needed.

Step 1:

Go to Images and select Sketch to begin.

ChatGPT Sketch

Next, choose your stroke color.

Chọn màu sắc nét vẽ trong ChatGPT Sketch

Step 2:

Pick your drawing style—either block shapes or simple line sketches.

Chọn kiểu vẽ trong ChatGPT Sketch

One desktop-exclusive feature: you can add text directly to your sketch.

Viết chữ trong ChatGPT Sketch

Step 3:

Once you're happy with your sketch, hit send. You can even combine multiple sketches together. After that, you'll see the complete image generation prompt, and you're free to edit it if you want. Finally, send it again and let ChatGPT generate the final result.

Viết chữ trong ChatGPT Sketch

What's interesting here is: you end up with a polished, complete image built from just two messy doodles. If any part doesn't quite match your vision, you can circle areas and request refinements.


Description: ChatGPT Sketch turns your messy doodles into professional artwork. No prompts needed—just draw and let AI do the magic.

Related Articles

How to Use Dola Chat's AI Homework Solver Feature

On
How to Use Dola Chat's AI Homework Solver Feature

Dola Chat is more than just a conversational AI. Sure, you can use it for writing, creating images, and general chatting — but there's a feature that's especially useful for students. It can solve homework problems, and it does it in a surprisingly intelligent way.

Here's what makes this genuinely useful: you don't have to retype entire problem sets. Just snap a photo of your worksheet, and Dola reads the content, then walks you through the solution step by step. This approach works perfectly when you're stuck on a tough problem but have no idea where to begin. Let's walk through how to use it.

Getting Started With Dola Chat's Homework Mode

Head over to Dola Chat at the link below and select the Homework mode.

https://www.dola.com

Chế độ bài tập về nhà trên Dola

From there, you have three options: paste a screenshot of your assignment, type out the problem directly, or upload a file. Dola processes it immediately and solves the entire problem set.

Giải bài tập về nhà trên Dola

Each question gets a detailed breakdown. Below the solution, you'll find options to copy or download the results, which is handy when you're working through multiple questions.

Tổng hợp kết quả bài tập về nhà trên Dola

Want even more detail? Ask Dola to break it down further, explain it differently, or simplify it to match your grade level. Just type a follow-up command and Dola will expand its explanation. This is particularly helpful when you're trying to really understand Dola's approach, especially when working through each step.

Nhập lệnh giải chi tiết trên Dola

One thing to keep in mind: for problems requiring visual answers — like graphing — Dola can't generate the actual drawing. Instead, it provides detailed instructions you can follow to create it yourself.

Hướng vẽ đồ thị hàm số trên Dola

Students can visualize the graph using the descriptive section Dola provides.

Mô tả đồ thị hàm số trên Dola

Overall, Dola delivers concrete, detailed solutions. It understands images and content you upload, and supports problem-solving across multiple subjects.

Hỗ trợ giải bài tập nhiều môn trên Dola

Beyond just solving problems, consider using Dola to get hints instead of immediate answers. You can also upload a photo of your work and ask Dola to identify mistakes. If you got something wrong, request that Dola explain what went wrong and solve it correctly.

Kiểm tra lỗi sai bài làm trên Dola

Or take a solved problem and have Dola generate similar questions so you can practice on your own.

Triển khai bài tập tương tự trên Dola

Important Caveats When Using Dola for Homework Help

While Dola can solve and explain assignments quickly, it's not perfect. The AI can sometimes provide inaccurate answers, particularly with blurry images, incomplete information, or questions that require specialized solution methods. The real concern is treating its output as gospel without verification. Always double-check results against your textbook, class materials, or teacher notes when it matters.

Rather than asking for just the answer, request step-by-step explanations. Ask Dola to identify the formulas used and explain why it chose that particular approach. This helps you understand the underlying concept and apply it to similar problems later. For important assignments, view AI responses as reference material — verify them yourself before submitting.


Description: Learn how Dola Chat's homework solver works, from uploading problem photos to getting detailed step-by-step solutions across multiple subjects.

Related Articles

How to Design Your Own Custom Sticker Pack with ChatGPT

On
How to Design Your Own Custom Sticker Pack with ChatGPT

ChatGPT just rolled out a sticker pack creation feature, and it's actually pretty clever. Instead of manually designing individual stickers or wrestling with complex prompts, you can now turn your ideas, photos, or favorite characters into unique stickers for messaging apps—all without touching a design tool. The appeal here is obvious: personalized stickers add character to your conversations on WhatsApp, iMessage, and other messaging platforms.

The workflow is straightforward. Pick a visual style, select your emotional expressions from preset options, and ChatGPT generates a cohesive sticker pack automatically. No manual design work required. Below we'll walk through both the easy method using ChatGPT's built-in sticker builder and the more flexible approach using custom prompts.

Creating a Sticker Pack Using ChatGPT's Built-In Tool

Step 1:

Open ChatGPT and tap the menu icon, then navigate to the Images section. From there, select Stickers to get started.

Step 2:

In the sticker editor, start by selecting your preferred sticker style.

Sticker design interface on ChatGPT

You'll see multiple sticker styles to choose from. Scroll down to reveal additional options.

Step 3:

Once you've picked a style, tap the image icon to upload the main character for your sticker pack. ChatGPT supports uploads from three different sources, depending on your preference.

Character image

Step 4:

After selecting your main character, tap the emotion icons section to combine expressions into your complete sticker pack. ChatGPT offers tons of emotional expressions to mix and match.

When you're done, hit Create.

Generate your sticker pack on ChatGPT

ChatGPT will automatically generate the prompt needed to create your stickers—you don't need to type anything extra.

Prompt for sticker generation on ChatGPT

And there you have it—your completed sticker pack. You can download it to your photo library or add it directly to your messaging app if ChatGPT supports it on your device.

Step 5:

Now you can use your stickers in any messaging app.

Use your sticker

Creating Stickers with Custom Prompts

Step 1:

In ChatGPT, tap the plus icon and upload a photo of yourself. Then write your sticker creation prompt with the specific emotions and styles you want. Be detailed about the expressions, then hit send.

Convert this image into a 16-sticker chibi pack. Keep the outfit and hairstyle as shown. White background, with expressions for: smiling, eating, crying, angry, happy, content, sleepy, and funny.

Step 2:

ChatGPT will generate 16 sticker images based on your prompt. Tap each image and hit Save to download the chibi stickers.

Step 3:

To add these images as stickers, open your iPhone (which has built-in sticker creation) or use certain Samsung flagship models. Pinch to zoom the image, then press and hold the sticker you want to save, then tap Add Sticker.

On Samsung phones, press and hold the sticker, select Save as sticker, and you're done. Later, when you're in your phone's keyboard emoji section, tap the sticker library icon—all your ChatGPT stickers will appear there.

Step 4:

What's interesting here is that iPhone's image-to-sticker conversion sometimes has minor imperfections. You can fix these by adding a border to your stickers as shown below.

Step 5:

Open any messaging app and tap the smiley face icon to access your keyboard. Your newly created ChatGPT stickers will show up in your sticker library. Now just tap to send them like you normally would.

Video Tutorial: Making Stickers with ChatGPT


Description: Learn to create personalized sticker packs in ChatGPT without design skills. Two methods: use the built-in sticker builder or write custom prompts.

Related Articles

Copyright © 2016 QTitHow All Rights Reserved