Skip to content

Claude Code

Set up

Installation

Sherlock

Claude code is already installed on Sherlock.

Local

Refer to public documentation.

Launching

Open a terminal in the repository where you want to work and type 'claude'. Claude code should launch immediately. It is good practice to start claude in the directory where you actually want to work to keep it focused.

Setting up account

When you first start up claude code it will guide you through the set up. The correct choice here depends on if you have your own subscription or if you are drawing from a pre-purchased contingent of tokens allocated for a larger project (anthropic console account).

We have run into issues before where people would get stuck during the setup. They were resolved by @zoe

Switching to local installation on Sherlock

@konstantin

MCP servers

Context7

Context7 is a very useful MCP server that enables claude code to pull official docs of python libraries when needed. It is more efficient and works better than asking it to google.

install

claude mcp add --transport http context7 https://mcp.context7.com/mcp

use

When you want to make sure that what you build aligns with how it is recommended in a specific python library's documentation or claude seems to run in circles or just have issues properly understanding and fixing a bug. At the end of your prompt asking claude to work on something write "use context7". Claude will automatically look up the relevant documentation and retrieve the relevant information from it.

Others

There are tons of useful MCP servers out there. If you wish claude just had access to something instead of you having to provide it information from that source, it's probably worth looking into an MCP server for that source.

Tips and tricks

Context is key

CLAUDE.md files

by typing telling claude code to "/init", it will look through the directory and create a comprehensive documentation of it in a CLAUDE.md file. This file serves as claudes memory. It will load it automatically when started in the same directory. It will however not automatically update it so you need to tell it to do this every now and then. An outdated CLAUDE.md file can badly mess with claudes ability to fix issues.

Other memory files

It can be useful to help claude keep track of larger workflows such as major refactors of large codebases by creating .md files. You can tell claude to create such files but also make sure to delete them when they've become outdated in order to not confuse it.

Session context window

Do not let claude work on too many things in the same session. It is good practice to start a new session for each problem. A typical productive workflow may look like this: * think about what exactly you want in as much detail as you feel certain about. Write all of that in a simple txt file. * start claude. Tell it to read your txt file and optionally point it to specific other files in your codebase that you think are particularly relevant. * tell it to make sure it understands what you want and ask questions if anything is unclear. In that case it will almost certainly come back with questions and they will help you see how well claudes ideas are aligned with yours. If the questions show you a complete misunderstanding of what you need it may be better to improve the txt file and start the whole process again in a new session. If the questions are about details, answer them and use them to guide claude more. * work through the to do list with claude * once everything is implemented and ideally tested, ask claude to update the CLAUDE.md file and if this was part of a larger workflow, document the progress in another .md file that you can reference in your next session

Specializations

Subagents

Subagents can be useful for context isolation for separatable subtasks. Common subagents are specialized for e.g. code review, debugging, testing, ... Check the official docs to get an up-to-date description of how to use them. People also publish their subagents and you can find people describing their successful setups on reddit etc.

Skills

Skills are useful to define a specific workflow that comes up regularly and make sure that claude does it the way you want it to without having to babysit it each time. Similar to subagents, there is a lot of useful community information online.

Github Copilot

This is an AI coding tool that can do code-completion and agentic work via a chat interface

Access

As a student, you can get free Github Copilot Pro You can sign up for it with Github and then add the Copilot extension.

Use

Once it is integrated in VS Code, on the bottom right corner, if you click the bee icon, you can adjust settings for Copilot. A nice features is "Snooze" which turns off code completion for a few minutes which is nice if you need a break from constant suggestions. If you press Command + I (on a Mac, likely similar on Windows), you can get an inline chat. If you press Command + Shift + I, you get the chat feature. You can choose which model you want to use for the chat (e.g. GPT models, Claude models etc.) for that chat, add files for context, and also toggle "Ask", "Agent", and "Edit" modes. "Ask" mode is nice because it gives an opportunity to chat with the AI but not have it edit your files.

Stanford AI playground:

This is Stanford's internal LLM Chatbot tool that gives you access to good models for free and has built-in security (which might feel safer if asking research questions) https://aiplayground-prod2.stanford.edu/login