# Claude Code Setup Guide

URL: https://research-memex.org/docs/implementation/agentic-ai-tools/claude-code-setup-guide
Description: Claude Code helps researchers manage files, run analyses, and automate repeatable project tasks from the terminal.



<GuideMeta>
  Intermediate · 45–60 min · Node.js 18+ and terminal access
</GuideMeta>

*Your research project lives in files. This agent lives in the terminal alongside them.*

## Overview [#overview]

Claude Code is an agentic AI assistant that runs in your terminal. It helps researchers manage literature, analyze papers, draft sections, organize complex projects, and run project workflows through natural-language commands. Unlike traditional chat interfaces, it can read files, create folders, run analyses, and manage workflows.

Benefits for Research Memex:

* File-aware AI: Reference papers with @filename syntax
* Project memory: CLAUDE.md stores your research protocol
* Custom commands: Create slash commands for repetitive tasks
* MCP integration: Connect to Zotero, filesystems, web search
* Autonomous execution: Plan and execute multi-step workflows
* Version control: Built-in Git integration

## Step 1: installation [#step-1-installation]

### 1.1 prerequisites [#11-prerequisites]

System requirements:

* Node.js 18 or newer
* Terminal/command-line access
* Claude.ai account or API key

Check Node.js version:

```bash
node --version
```

If you need to install Node.js, download from the [Node.js website](https://nodejs.org)

### 1.2 install Claude Code [#12-install-claude-code]

<Aside label="Install docs">
  For detailed installation instructions, see [Claude Code Overview](https://docs.claude.com/en/docs/claude-code/overview) | [GitHub Repository](https://github.com/anthropics/claude-code)
</Aside>

Via npm (Terminal):

```bash
npm install -g @anthropic-ai/claude-code
```

Verify installation:

```bash
claude --version
```

First launch:

```bash
cd ~/your-research-project
claude
```

### 1.3 alternative: VS Code extension [#13-alternative-vs-code-extension]

For users who prefer a graphical interface:

1. Open VS Code.
2. Install the [Claude Code extension](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code) from the marketplace.
3. Configure your API key in the extension settings.
4. Access Claude Code from the sidebar.

## Step 2: core concepts [#step-2-core-concepts]

### 2.1 what is CLAUDE.md? [#21-what-is-claudemd]

<Aside label="Keep it lean">
  Keep CLAUDE.md concise and updated. Claude reads it at the start of every conversation, so include only essential context, not your full literature review.
</Aside>

Claude automatically reads `CLAUDE.md` at the start of every conversation. It acts as your project's memory or constitution.

What to put in CLAUDE.md:

* Project overview and goals
* File structure explanation
* Research protocol or methodology
* Custom commands you've created
* Style guidelines (citation format, writing tone)
* Important context Claude should always know

Example CLAUDE.md for a research project:

```markdown
# Research Project: AI in Education

## Project Goal
Analyze the impact of AI tools on student learning outcomes through
literature synthesis and empirical analysis.

## File Structure
- /literature/ - Curated papers in markdown format
- /analysis/ - Data files and R scripts
- /drafts/ - Paper sections and outlines
- /exports/ - Final outputs (PDF, Word)

## Research Protocol
- Citation style: APA 7th Edition
- Inclusion criteria: Peer-reviewed, 2020-2025, empirical studies
- Analysis approach: Thematic synthesis

## Custom Commands
- /summarize: Create structured summary of a paper
- /compare: Compare methodologies across papers
- /synthesize: Identify themes across multiple papers
```

Official guide: [CLAUDE.md Best Practices](https://www.anthropic.com/engineering/claude-code-best-practices)

### 2.2 plan mode vs act mode [#22-plan-mode-vs-act-mode]

Plan Mode (default - recommended):

* Claude shows you what it will do before it executes
* You approve/reject each action
* Useful for learning and complex operations
* Toggle: `Shift+Tab` (Mac/Linux) or `Alt+M` (Windows)

Act Mode:

* Claude executes immediately
* Faster for trusted operations
* Use for simple tasks (reading files, searches)

<Warning>
  Stay in Plan Mode when working with research data. Preview operations before they modify your files.
</Warning>

### 2.3 file references with @ syntax [#23-file-references-with--syntax]

Add files to context:

```
"Summarize the key arguments in @/literature/smith2024.md"

"Compare the methodologies in @/literature/jones2024.md
and @/literature/lee2024.md"

"Analyze all papers in @/literature/ and identify common themes"
```

Folder references:

* `@/literature/` - Adds entire folder to context
* `@CLAUDE.md` - Always available as project memory

## Step 3: creating custom slash commands [#step-3-creating-custom-slash-commands]

### 3.1 what are slash commands? [#31-what-are-slash-commands]

Slash commands are reusable prompt templates you create once and run with `/commandname`. Use them for repetitive research tasks.

Examples for research:

* `/summarize` - Structured paper summary
* `/compare` - Compare two papers
* `/extract` - Pull out specific information
* `/critique` - Review writing for quality

### 3.2 create your first command [#32-create-your-first-command]

Step 1: create the commands folder

```bash
mkdir -p .claude/commands
```

Step 2: create a command file

Create `.claude/commands/summarize.md`:

```markdown
Summarize the following paper in this exact structure:

Paper: $ARGUMENTS

## Summary Template
- **Research Question**: [What problem does it address?]
- **Methodology**: [How did they study it?]
- **Key Findings**: [What did they discover?]
- **Theoretical Contribution**: [What does it add to knowledge?]
- **Limitations**: [What are the gaps?]
- **Relevance**: [How does this relate to my research?]

Be specific and cite page numbers where relevant.
```

Step 3: use your command

```bash
claude  # Launch Claude Code
```

Then type:

```
/summarize @/literature/smith2024.md
```

Claude executes the template, replacing `$ARGUMENTS` with whatever follows the slash command so the command stays flexible and reusable.

### 3.3 useful research commands [#33-useful-research-commands]

Create `.claude/commands/compare.md`:

```markdown
Compare these two papers systematically:

Papers: $ARGUMENTS

## Comparison Framework
1. **Research Questions**: How do they differ?
2. **Methodologies**: Qualitative vs quantitative? Samples?
3. **Findings**: Do they agree or contradict?
4. **Theories**: What frameworks do they use?
5. **Gaps**: What does each paper miss that the other addresses?

Present in a comparison table.
```

Create `.claude/commands/gaps.md`:

```markdown
Analyze the following papers for research gaps:

Papers: $ARGUMENTS

## Gap Analysis
1. **Methodological Gaps**: What methods are missing?
2. **Theoretical Gaps**: What theories are underexplored?
3. **Empirical Gaps**: What contexts are understudied?
4. **Temporal Gaps**: What recent developments aren't covered?

For each gap, explain why it matters and what research it suggests.
```

## Step 4: MCP servers for research [#step-4-mcp-servers-for-research]

MCP (Model Context Protocol) servers add specialized tools to Claude Code.

### 4.1 essential MCP servers for research [#41-essential-mcp-servers-for-research]

Zotero MCP:

* Search your Zotero library from terminal
* Get paper metadata instantly
* Installation: See [Zotero Setup Guide](/docs/implementation/foundational-setup/zotero-setup-guide)

Filesystem MCP:

* Already built-in to Claude Code
* Navigate and search project files
* Create and modify documents

Sequential Thinking MCP:

* Step-by-step reasoning for complex analysis
* Useful for theoretical arguments
* Install: [Smithery - Sequential Thinking](https://smithery.ai/server/@smithery-ai/server-sequential-thinking)

Web Search MCP:

* Real-time literature discovery
* Verify recent developments
* Fact-checking and citation validation

### 4.2 installing MCP servers [#42-installing-mcp-servers]

Via Smithery:

1. Visit [smithery.ai](https://smithery.ai).
2. Search for the MCP server you want.
3. Click **Install**.
4. Follow the guided setup.
5. Restart Claude Code.

Manual configuration:
Edit `~/.config/claude-code/config.json` to add MCP servers. For end-to-end installation guidance, see the [MCP Explorer Guide](/docs/implementation/ai-environment-setup/mcp-explorer-guide).

## Step 5: project structure for research [#step-5-project-structure-for-research]

### 5.1 recommended folder structure [#51-recommended-folder-structure]

General research project:

```
/Your-Research-Project/
├── CLAUDE.md                 # Project memory
├── .claude/
│   └── commands/             # Custom slash commands
├── literature/               # Curated papers (markdown)
├── analysis/                 # Data, scripts, results
├── notes/                    # Research notes, synthesis
├── drafts/                   # Paper sections
└── exports/                  # Final outputs
```

### 5.2 setting up a new project [#52-setting-up-a-new-project]

Option 1: ask Claude to do it

```
Create a research project structure with folders for literature,
analysis, notes, drafts, and exports. Then create a CLAUDE.md file
documenting this project structure.
```

Option 2: manual setup

```bash
mkdir -p literature analysis notes drafts exports .claude/commands
touch CLAUDE.md
claude
```

## Step 6: common research workflows [#step-6-common-research-workflows]

### 6.1 literature analysis [#61-literature-analysis]

Analyze a single paper:

```
Read @/literature/smith2024.md and create a structured summary
following the format in CLAUDE.md
```

Compare multiple papers:

```
Compare the methodologies in @/literature/smith2024.md,
@/literature/jones2024.md, and @/literature/lee2024.md.
Create a comparison table.
```

Find themes across corpus:

```
Analyze all papers in @/literature/ and identify the 3 most
common themes. For each theme, list which papers discuss it
and how their perspectives differ.
```

### 6.2 data management [#62-data-management]

Organize files:

```
Review all files in @/literature/ and organize them into
subfolders by research method (qualitative, quantitative, mixed-methods)
```

Create synthesis tables:

```
Extract the following from each paper in @/literature/:
author, year, method, sample size, key finding.
Create a CSV table with this data.
```

### 6.3 drafting and writing [#63-drafting-and-writing]

Generate section outlines:

```
Based on the papers in @/literature/, create an outline for
a literature review section covering theoretical frameworks.
```

Draft from synthesis:

```
Using the synthesis notes in @/notes/themes.md, draft a
2-page literature review section in academic style (APA 7th).
```

## Step 7: keyboard shortcuts & navigation [#step-7-keyboard-shortcuts--navigation]

### 7.1 essential shortcuts [#71-essential-shortcuts]

<KeyTable>
  | Shortcut    | Action                                |
  | ----------- | ------------------------------------- |
  | `Shift+Tab` | Toggle Plan/Act mode (Mac/Linux)      |
  | `Alt+M`     | Toggle Plan/Act mode (Windows)        |
  | `Esc Esc`   | Navigate command history (double-tap) |
  | `Ctrl+C`    | Cancel current operation              |
  | `Ctrl+D`    | Exit Claude Code                      |
</KeyTable>

### 7.2 command history [#72-command-history]

Double-tap `Esc` to jump back through previous commands:

* Modify and re-run analyses
* Fix typos without retyping
* Compare different approaches quickly

## Step 8: learning resources [#step-8-learning-resources]

### 8.1 official documentation [#81-official-documentation]

* [Claude Code Overview](https://docs.claude.com/en/docs/claude-code/overview) - Official intro
* [Best Practices Guide](https://www.anthropic.com/engineering/claude-code-best-practices) - CLAUDE.md tips
* [GitHub Repository](https://github.com/anthropics/claude-code) - Source code and issues
* [Latest Updates](https://www.anthropic.com/news/enabling-claude-code-to-work-more-autonomously) - New features

### 8.2 video tutorials [#82-video-tutorials]

Beginner series:

* [SeanMatthewAI YouTube Series](https://www.youtube.com/@SeanMatthewAI) - Claude Code essentials
* [Claude Code Beginners Guide 2025](https://www.geeky-gadgets.com/claude-code-beginners-guide-2025/) - Comprehensive walkthrough

Hands-on tutorials:

* [Build a YouTube Research Agent](https://creatoreconomy.so/p/claude-code-tutorial-build-a-youtube-research-agent-in-15-min) - Slash commands in action
* [Cooking with Claude Code](https://www.siddharthbharath.com/claude-code-the-complete-guide/) - Complete app build

### 8.3 online courses [#83-online-courses]

* [DeepLearning.AI: Claude Code](https://learn.deeplearning.ai/courses/claude-code-a-highly-agentic-coding-assistant) - Comprehensive course
* [Anthropic Training](https://anthropic.skilljar.com/claude-code-in-action) - Official certification
* [DataCamp Tutorial](https://www.datacamp.com/tutorial/claude-code) - Practical examples

### 8.4 blog posts and guides [#84-blog-posts-and-guides]

* [How I Use Claude Code](https://www.builder.io/blog/claude-code) - Pro tips from Builder.io
* [No-BS Quick Start Guide](https://fuszti.com/claude-code-setup-guide-2025/) - July 2025 guide
* [ClaudeLog](https://claudelog.com/) - Best practices collection

## Step 9: integration with Research Memex [#step-9-integration-with-research-memex]

### 9.1 connect to Zotero [#91-connect-to-zotero]

Set up Zotero MCP:

1. Follow the [Zotero Setup Guide](/docs/implementation/foundational-setup/zotero-setup-guide).
2. Install the Zotero MCP server.
3. Start a new Claude Code session, or restart Claude Code if it was already open, then run `/mcp` and confirm `zotero` is connected.

In Claude Code, search your library with natural language. Example: "Search my Zotero for papers on AI in education"

### 9.2 export papers for analysis [#92-export-papers-for-analysis]

From Zotero to Claude Code:

1. Export papers from Zotero as markdown (via OCR)
2. Save to `/literature/` folder
3. Reference with `@/literature/author2024.md`
4. Claude can now analyze the full text.

See: [OCR PDF Conversion Guide](/docs/implementation/ai-environment-setup/ocr-pdf-conversion-guide)

### 9.3 workflow with Obsidian [#93-workflow-with-obsidian]

Obsidian for synthesis, Claude Code for execution:

1. Use Obsidian for literature notes
2. Export synthesis to markdown
3. Move to Claude Code project folder
4. Claude Code automates analysis and drafting

## Step 10: example research workflows [#step-10-example-research-workflows]

### 10.1 general literature analysis [#101-general-literature-analysis]

Create CLAUDE.md:

```markdown
# Literature Analysis Project

## Goal
Analyze papers on [TOPIC] to identify themes, methodologies, and gaps.

## File Structure
- /literature/ - Papers in markdown format
- /synthesis/ - Theme notes and comparisons
- /outputs/ - Final analysis documents

## Analysis Protocol
- Extract: Research question, method, key findings
- Compare: Methodologies and theoretical frameworks
- Synthesize: Common themes and research gaps
```

Custom command `.claude/commands/analyze.md`:

```markdown
Analyze this paper:

Paper: $ARGUMENTS

Extract:
1. Research question and objectives
2. Methodology (qualitative/quantitative/mixed)
3. Sample and data collection
4. Key findings (3-5 bullet points)
5. Theoretical contribution
6. Limitations and future research

Format as markdown table for easy compilation.
```

### 10.2 multi-paper comparison [#102-multi-paper-comparison]

Workflow:

```
1. /analyze @/literature/paper1.md
2. /analyze @/literature/paper2.md
3. /analyze @/literature/paper3.md

Then: "Create a comparison table of the three analyses above,
focusing on methodological differences."
```

### 10.3 theory building [#103-theory-building]

Use Sequential Thinking MCP:

```
Using Sequential Thinking, analyze the papers in @/literature/
and propose a novel theoretical framework that integrates their
key findings. Work step-by-step through:
1. Identifying core constructs
2. Mapping relationships
3. Proposing mechanisms
4. Identifying testable propositions
```

## Step 11: advanced features [#step-11-advanced-features]

### 11.1 parallel agents [#111-parallel-agents]

Run multiple analyses simultaneously:

```
"Use 3 parallel agents to analyze @/literature/smith2024.md:
- Agent 1: Focus on methodology quality
- Agent 2: Focus on theoretical contribution
- Agent 3: Focus on practical implications

Compare their assessments."
```

### 11.2 git integration [#112-git-integration]

Built-in version control:

```
"Create a Git commit for the changes we just made with
message: 'Add literature analysis for Smith 2024'"

"Show me the diff of changes since yesterday"

"Create a new branch for the theory-building section"
```

### 11.3 task tracking with TodoWrite [#113-task-tracking-with-todowrite]

Claude Code has built-in task management:

```
"Create a todo list for analyzing these 10 papers:
- Read and summarize each
- Extract methodologies
- Identify common themes
- Map theoretical frameworks
- Draft synthesis section"
```

Claude creates a checklist and tracks progress.

## Step 12: troubleshooting [#step-12-troubleshooting]

### Installation issues [#installation-issues]

"npm command not found"

* Install Node.js from nodejs.org
* Restart terminal after installation

"Permission denied"

* Use: `sudo npm install -g @anthropic-ai/claude-code`
* Or fix npm permissions: [npm docs](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally)

### CLAUDE.md not loading [#claudemd-not-loading]

* Verify filename is exactly `CLAUDE.md` (case-sensitive)
* Must be in project root directory
* Restart Claude Code: `exit` then `claude`

### Slash commands not working [#slash-commands-not-working]

* Check folder exists: `.claude/commands/`
* Verify file naming: `commandname.md` (no slashes)
* Restart Claude Code after creating commands
* Test with: `/help` (built-in command)

### File references failing [#file-references-failing]

* Use absolute paths from project root: `@/literature/file.md`
* Check filename spelling and case
* Verify file exists: `ls literature/`

## Step 13: best practices for research [#step-13-best-practices-for-research]

### 13.1 project organization [#131-project-organization]

DRY Principle (Don't Repeat Yourself):

* Create slash commands for repetitive tasks
* Document protocols in CLAUDE.md once
* Reuse across multiple papers/projects

Version Everything:

* Use Git for tracking changes
* Commit after major analyses
* Branch for experimental approaches

### 13.2 quality control [#132-quality-control]

Always verify AI outputs:

* Check citations against your Zotero library
* Validate statistical claims
* Review for coherence and logic
* See: [Failure Museum](/docs/implementation/core-references/failure-museum)

Use Plan Mode for:

* File modifications
* Data extraction
* Writing operations
* Complex multi-step tasks

### 13.3 ethical guidelines [#133-ethical-guidelines]

Transparency:

* Document AI use in CLAUDE.md
* Track which tasks were AI-assisted
* Maintain audit trail of prompts used

Verification:

* Never trust AI-generated citations blindly
* Verify every factual claim
* Check for hallucinations and errors

## Step 14: advanced use cases [#step-14-advanced-use-cases]

### 14.1 for systematic literature reviews [#141-for-systematic-literature-reviews]

See the [Claude Code SLR Workflow](/docs/case-studies/systematic-reviews/claude-code-slr-workflow) for a complete SLR workflow covering screening, extraction, and PRISMA reporting.

### 14.2 for qualitative analysis [#142-for-qualitative-analysis]

Coding transcripts:

```
/code "Analyze @/data/interview1.md using thematic analysis.
Identify codes, group into themes, provide exemplar quotes."
```

### 14.3 for theory development [#143-for-theory-development]

Build conceptual frameworks:

```
"Using Sequential Thinking MCP, develop a theoretical model
that integrates findings from @/synthesis/themes.md.
Work through: constructs → relationships → propositions → testable hypotheses."
```

## Checklist [#checklist]

By the end of this guide, you should have:

* [ ] Installed Claude Code (terminal or VS Code)
* [ ] Created a research project folder
* [ ] Written a CLAUDE.md file with project context
* [ ] Created at least one custom slash command
* [ ] Tested file references with @ syntax
* [ ] Understood Plan vs Act mode
* [ ] Installed at least one MCP server (Zotero or Sequential Thinking)
* [ ] Watched at least one tutorial video
* [ ] Tested a basic analysis workflow

## What's next [#whats-next]

Next, see the [Claude Code SLR Workflow](/docs/case-studies/systematic-reviews/claude-code-slr-workflow) for a complete walkthrough of screening, extraction, and synthesis with Claude Code.

### External references [#external-references]

* [Claude Code Docs](https://docs.claude.com/en/docs/claude-code/)
* [Best Practices](https://www.anthropic.com/engineering/claude-code-best-practices)
* [GitHub](https://github.com/anthropics/claude-code)