Jump to content

Claude Code

From Sinfronteras

Claude Code (Anthropic’s coding-focused CLI/tooling)

Claude https://claude.ai is an AI assistant made by Anthropic (like ChatGPT). You can chat, write, analyze, code, and build interactive tools together.

Claude Code is an Agentic Coding Assistant. A developer tool where Claude works inside your terminal or IDE, autonomously reading and editing your actual codebase, running commands, and completing multi-step coding tasks hands-free. So, Claude Code is about delegating tasks to an AI agent. It goes further by orchestrating multiple tasks across a set of AI agents that can work in parallel.

A key tip for working with Claude Code is to provide clear context. This means pointing it to relevant files, clearly describing the functionality and features you want, and making sure you extend its capabilities using tools like MCP servers and others in the ecosystem.



Resources

Claude Code in Action: https://anthropic.skilljar.com/claude-code-in-action



Claude Code installation https://code.claude.com/docs/en/overview

The curl method is Anthropic's new preferred way. It's simpler, has no dependencies, and keeps itself up to date. The npm method still works but it'll be deprecated.

curl -fsSL https://claude.ai/install.sh | bash



Claude Code can help with every step of a project

1. Discover 2. Design 3. Build 4. Deploy 5. Support & Scale
Explore codebase and history Plan project Implement code Automate CI/CD Debug errors
Search documentation Develop tech specs Write and execute tests Configure environments Large-scale refactor
Onboard & Setup Define architecture Create commits and PRs Manage deployments Monitor usage & performance



Claude Code tools
A set of built-in tools that help it understand and modify your codebase. For example:



Claude Code is extensible

  • You can add additional tools by connecting MCP servers, which allow customization for your particular project.



Effort levels / Extended Thinking

https://platform.claude.com/docs/en/build-with-claude/effort

I found the documentation regarding effort levels and extended thinking is not very clear.

We can check and set the effort level with the effort command. Available levels are:
low, medium, high, xhigh, and max.

Apparently, the thinking mode can also be controlled using keywords in the request:
think, (think hard or megathink), and ultrathink.

It seems that the ultrathink keyword is equivalent to the max effort level.

It also appears that the newest Claude models use "adaptive thinking", meaning the model adjusts how much it thinks based on the complexity of the request. Again, the documentation is not very clear, but it seems that even when using xhigh, the model may still adjust the effort level depending on the task complexity.



CLAUDE.md

It's essentially a way to give Claude Code a "memory". When Claude Code starts or operates in a directory, it automatically reads any CLAUDE.md file it finds and uses that content as part of its context. This allows you to give Claude standing instructions without having to repeat them in every conversation.

Common uses include:

  • Project overview and architecture notes
  • Coding conventions and style guidelines
  • Commands to run tests, build, or lint the project
  • Important context about dependencies or environment setup
  • Things Claude should always remember or avoid doing


Three common CLAUDE.md files

  • CLAUDE.md
  • Generated with /init
  • Commit to source control
  • Shared with other engineers
  • Location: project directory or subdirectories (for folder-specific context)
  • CLAUDE.local.md
  • Not shared with other engineers. It's typically added to .gitignore
  • Contains personal instructions and customizations for Claude
  • Location: project directory or subdirectories (for folder-specific context)
  • ~/.claude/CLAUDE.md
  • Used with all projects on your machine
  • Contains instructions that you want Claude to follow on all projects
  • Location: .claude folder stored in your home directory



Create custom subagents

https://code.claude.com/docs/en/sub-agents



Course 1

Built in direct partnership with Anthropic and taught by their Head of Technical Education. I think it was released in 2025-08

https://www.deeplearning.ai/short-courses/claude-code-a-highly-agentic-coding-assistant

Reading notes: https://github.com/https-deeplearning-ai/sc-claude-code-files/blob/main/reading_notes/L0_notes.md


The course covers best practices and tips on how to use agentic coding with Claude Code. You'll learn these tips through 3 examples:

  • codebase for a RAG chatbot (Lessons 2-6)
  • e-commerce data analysis (Lesson 7)
  • Figma design mockup (Lesson 8)



Codebase Exploration

https://github.com/https-deeplearning-ai/sc-claude-code-files/blob/main/reading_notes/L2_notes.md

Here are some questions you can ask Claude Code to explore a codebase:

  • Give me an overview of this codebase
  • What are the key data models?
  • Explain how the documents are processed
  • What is the format of the document expected by the document_processor?
  • How are the course chunks loaded to the database?
  • Trace the process of handling user's query from frontend to backend
  • Draw a diagram that illustrates this flow
  • Explain how the text is transformed into chunks? What is the size of each chunk?
  • Describe the api endpoints
  • How can I run the application?



How to structure an instruction

Instructions need to be structured clearly so Claude Code understands what we’re asking it to do.

In this section, there are some examples of request https://github.com/https-deeplearning-ai/sc-claude-code-files/blob/main/reading_notes/L3_notes.md

For instance:

The chat interface displays query responses with source citations. I need to modify it so each source becomes a clickable link that opens the corresponding lesson video in a new tab:
- When courses are processed into chunks in @backend/document_processor.py, the link of each lesson is stored in the course_catalog collection
- Modify _format_results in @backend/search_tools.py so that the lesson links are also returned
- The links should be embedded invisibly (no visible URL text)


Claude Code Commands

https://learn.deeplearning.ai/courses/claude-code-a-highly-agentic-coding-assistant/lesson/zzhtb/adding-features

  • Managing Project Memory:
  • /init: Claude Code scans your codebase and creates CLAUDE.md file inside your project directory.
  • CLAUDE.md guides Claude through your codebase, pointing out important commands, architecture and coding style. It's automatically included in the context each time you launch Claude Code.
  • Here's an example of a CLAUDE.md file generated by init for the RAG chatbot example.
  • #: Use # to quickly add a memory. Useful when you see Claude Code repeats an error.
  • Example 1: since the project is a uv project, we added these to CLAUDE.md file using #:
  • # use uv to run python files or add any dependencies
  • Example 2: you can inform Claude Code about the database schema, in this case since you have a vector database, you can inform Claude Code about the collections stored in the vector database:
  • # The vector database has two collections:
  • course_catalog:
  • stores course titles for name resolution
  • metadata for each course: title, instructor, course_link, lesson_count, lessons_json (list of lessons: lesson_number, lesson_title, lesson_link)
  • course_content:
  • stores text chunks for semantic search
  • metadata for each chunk: course_title, lesson_number, chunk_index


  • Managing the Context of Claude Code:
  • /clear: clears current conversation history
  • /compact: summarizes current conversation history
  • ESC: interrupt Claude to redirect or correct it
  • ESC ESC: rewind the conversation to an earlier point in time


  • You can use regular bash command within Claude Code, but you need to start the command with ! (for example: !pwd).
  • You can type exit to quit Claude Code.


  • File mentions: let you pull a specific file into the context of your conversation using the @. For example @path/to/file.ts


  • Planning mode is a way to ask Claude to think through a task before doing anything — so you can review and approve the approach before any code is written or files are changed.
You can trigger it in different ways:
  • By entering Planning mode before asking any question using:
  • Using the /plan command
  • Using the Shift Tab shortcut, which switches between Claude Code's input modes:
  1. Normal mode (default)
  2. Auto-accept edits (Claude makes changes without asking)
  3. Plan mode (read-only, no edits)
So you need to press it twice (Shift Tab Shift Tab) to go directly into Planning mode.
  • Or just by asking me like "enter plan mode" or "switch to plan mode"
  • You can also asking Claude to plan first in any question (but I’d suggest switching to Planning mode first):
For example: "Plan how you would add authentication to this app"


  • /mcp: Manage MCP connection & check available MCP servers with their provided tools



Adding Features with MCP servers

https://code.claude.com/docs/en/mcp

MCP (Model Context Protocol) servers are a standardized way to extend Claude's capabilities by connecting it to external tools, data sources, and services. Think of them as plugins. They let Claude interact with things beyond its built-in abilities, like reading your files, querying databases, calling APIs, or controlling apps.

How it works: MCP is an open protocol that Anthropic developed. An MCP server exposes a set of "tools" that Claude can call during a conversation. Claude discovers what tools are available, and can invoke them as needed to complete tasks.


Examples of what MCP servers can do:

  • File systems: read/write files on your machine
  • Databases: query PostgreSQL, SQLite, etc.
  • Version control: interact with GitHub (open PRs, read issues, etc.)
  • Web browsing: fetch pages, search the web
  • Productivity tools: connect to Slack, Notion, Jira, Asana
  • Dev tools: run terminal commands, interact with Docker, etc.


In the context of Claude Code specifically: You can add MCP servers to extend what Claude Code can do in your sessions. For example:

bashclaude mcp add github -- npx -y @modelcontextprotocol/server-github



Installing the Playwright MCP server

https://github.com/https-deeplearning-ai/sc-claude-code-files/blob/main/reading_notes/L3_notes.md
https://learn.deeplearning.ai/courses/claude-code-a-highly-agentic-coding-assistant/lesson/zzhtb/adding-features

Playwright is an MCP server that provides browser automation capabilities using Playwright. It lets AI assistants control a web browser automatically:

  • it opens websites
  • clicks buttons
  • fills forms
  • reads page content
  • takes screenshots
  • runs browser tests


To install Playwright MCP:

  • Exit Claude Code
  • In the terminal, type:
claude mcp add --scope user playwright -- npx -y @playwright/mcp@latest
  • Open Claude Code again and verify you are connected to the MCP server using /mcp command


Then we can make a request to Claude code this way:

Using the playwright MCP server, visit 127.0.0.1:8000 and view the '+ New Chat' button. I want that button to look the same as the other links below for Courses and Try Asking. Make sure this is left aligned and that the border is removed.



Testing, Error Debugging and Code Refactoring

https://learn.deeplearning.ai/courses/claude-code-a-highly-agentic-coding-assistant/lesson/33kzc/testing%2C-error-debugging-and-code-refactoring
https://github.com/https-deeplearning-ai/sc-claude-code-files/blob/main/reading_notes/L4_notes.md


Here is the request:

The RAG chatbot returns 'query failed' for any content-related questions. I need you to:

1. Write tests to evaluate the outputs of the execute method of the CourseSearchTool in @backend/search_tools.py

2. Write tests to evaluate if @backend/ai_generator.py correctly calls for the CourseSearchTool

3. Write tests to evaluate how the RAG system is handling the content-query related questions.

Save the tests in a tests folder within @backend. Run those tests against the current system to identify which components are failing. Propose fixes based on what the tests reveal is broken.

Think harder


We can also use several agents in the same request. We only need to specify this on the request:

....

....

Use two parallel subagents to brainstorm possible plans. Do not implement any code.