Loading...

How to Develop with Claude Code: Project Setup, Agentic Workflow, and Slash Commands

Now that you have successfully installed and configured Claude Code on your Bluehost Self-Managed VPS or VDS server, it’s time to move past basic setup and learn how to actually develop with it.

Unlike typical autocomplete tools or traditional chat windows, Claude Code is an agentic coding environment. It operates directly within your file system. It can explore your directories, write and edit files across multiple modules, run your build commands, and proactively fix errors until everything passes.

Here is how to effectively steer this powerful tool in your daily engineering workflow.

1. Creating and Initializing a Fresh Project Workspace

Before you can hand over instructions to Claude Code, you need an active project directory on your server. Claude expects to run inside an initialized code repository. If you try to run it in a completely empty, non-initialized folder, it won't have the baseline structure it needs to track file edits or execute internal tools safely.

CRITICAL TERMINAL BOUNDARY: All steps in this section (Steps A through F) must be executed directly on your standard, regular VPS or VDS server command line (your native Bash/Zsh prompt). Do not launch Claude yet. You are building the home for your project first; you will only open the interactive Claude session after these steps are complete.

Follow these steps sequence-by-sequence inside your standard Linux command line to spin up your ready-to-code directory framework from scratch:

Step A: Create a brand new project folder and step inside it

root@vps-server:~# mkdir my-new-vps-project && cd my-new-vps-project

Step B: Initialize Git tracking

root@vps-server:~/my-new-vps-project# git init
Initialized empty Git repository in /root/my-new-vps-project/.git/

Step C: Generate a base Node.js configuration file

root@vps-server:~/my-new-vps-project# npm init -y
Wrote to /root/my-new-vps-project/package.json:
{
  "name": "my-new-vps-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "keywords": [],
  "author": "",
  "license": "ISC"
}

Step D: Establish your development directory layout

mkdir -p src/middleware src/routes config
root@vps-server:~/my-new-vps-project# mkdir -p src/middleware src/routes config

Step E: Place a default entry file inside your workspace

echo "// Main application entry point" > src/index.js
root@vps-server:~/my-new-vps-project# echo "// Main application entry point" > src/index.js

Step F: Lock down your baseline commit


root@vps-server:~/my-new-vps-project# git add . && git commit -m "initial workspace commit"
[main (root-commit) 5b7a1d2] initial workspace commit
2 files changed, 12 insertions(+)
create mode 100644 package.json
create mode 100644 src/index.js

Once this structural baseline is fully generated, you are cleared to launch the agentic environment by typing:

root@vps-server:~/my-new-vps-project# claude

2. Understanding the Agentic Workflow (Explore → Plan → Code)

Once you start Claude within your project folder, you’re not simply chatting but engaging in a process of developing with the help of Claude. Rather than inputting file content to Claude manually one part at a time, you use the following agentic cycle:

Phase Description Example
Explore Ask Claude to analyze your architecture. Look at our database schema and explain how users are authenticated.
Plan Instruct Claude to outline its approach before writing anything down. Use /plan for new features before edits.
Implement Claude will write/edit files, showing you a diff, always asking permission first. Automated code creation, refactor, patching.
Verify Give Claude a command to run tests/lint. Claude fixes code and re-runs as needed. npm test (run/fix until passes)

3. Launch Parameters: System CLI Flags vs. Live Interactive Mode

An issue that often causes a problem for those who use Claude Code for the first time is using the wrong commands for the shell and the wrong inputs within the program, because they are:

A. Outside Claude (Your Standard VPS Bash/Zsh Shell)

These are CLI Flags executed directly from your normal server terminal prompt. They determine how Claude boots up or let you run one-off headless processes:

How to Run Sample Command When to Use
Interactive Session claude Open the live interface session for exploring and iterating code.
One-off Task claude "task" Run a single prompt or task, then exit Claude.
Print Mode claude -p "query" Query only, no file edits or actions taken.
Resume Session claude -c Continue work in an existing context in this folder.
Danger Mode claude --dangerously-skip-permissions Expert only! Bypasses approval prompts for edits/execution.

B. Inside Claude (The Interactive TUI)

Once you run the base claude command, your shell hands control over to the live interactive REPL. Within this panel, you do not use standard Linux shell syntax; you communicate in plain English, trigger Slash Commands, or use physical hotkeys.

4. Essential Slash Commands to Run Inside the Session

While inside a live interactive Claude Code session, type / at any time to unlock direct system-level controls over your current environment:

Command What it Runs / Executes When to Use It
/init Generates a project-level CLAUDE.md file in the root directory. Run this immediately upon initializing a new workspace to store permanent project tech stack preferences.
/plan Switches Claude into read-only "Plan Mode." Use this before making large changes to map out architectural layers safely without accidental file modifications.
/diff Opens an interactive viewer displaying all file code line modifications made during the current live session. Run this to audit Claude's work line-by-line before saving or running pipelines.
/rewind Rolls back modified files and conversation history to a previous clean state. Run this if Claude goes down a broken development path and you need a clean historical reset.
/compact Compresses a long conversation history logs into a dense summary. Run this when your session gets long to clear up the active memory window and save massive token expenses.
/model Switches the underlying AI model logic dynamically. Swap to lighter models for trivial file edits or premium models for heavy data abstractions.
/clear Wipes out the active chat conversation log entirely. Crucial: Run this every time you switch to an unrelated task to keep model responses fast and targeted.
/exit Safely shuts down the session. Closes out Claude Code and safely routes your keyboard focus back to your native host VPS operating system shell.

5. Deep Dive: Slash Commands in Action

To fully grasp how these slash commands behave under real project development, review these common troubleshooting scenarios and terminal output logs simulated directly from a live VPS environment:

A. The /plan Command

code-user $ /plan
Claude Code: Switched to Plan Mode. Tool executions that modify files are now disabled.

code-user $ Map out how to add an 'is_admin' boolean column to the users table and expose it via the API.
Claude Code: I will analyze the schema without editing any code.
[Tool Call: View file 'src/models/user.js']
[Tool Call: View file 'src/routes/api.js']

Proposed plan:
1. Generate a database migration via knex: npx knex migrate:make add_admin_to_users
2. Update user.js to serialize the new field.

Ready to implement? Type /toggle-mode to re-enable file writes.

B. The /compact Command

code-user $ /compact
Claude Code: Compressing conversation history context...
✓ Memory Optmized. Context window reduced by 72%. 
Key findings, ongoing architectural goals, and past code fixes saved to persistent session cache. Proposing fresh prompt line.

C. The /diff Command

code-user $ /diff
Claude Code: Current uncommitted session changes:

--- a/src/middleware/auth.js
+++ b/src/middleware/auth.js
- const token = req.headers['authorization'];
+ const authHeader = req.headers['authorization'];
+ const token = authHeader && authHeader.startsWith('Bearer ') ? authHeader.split(' ')[1] : null;

6. Context Targeting, Overrides, and Escapes

A. Directing Context via File Triggers

code-user $ Check the variable names inside @src/middleware/auth.js and confirm they match @config/production.json
Claude Code: Scanning specified resources...
[Tool Call: Read file 'src/middleware/auth.js']
[Tool Call: Read file 'config/production.json']

Analysis: The authentication middleware expects process.env.JWT_SECRET, but your production json layout targets config.auth.secretToken. You have a fallback structural mismatch here.

B. Escaping to the Host Terminal via Bash Override (!)

code-user $ !git status
Claude Code: System Output:
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git restore ..." to discard changes in working directory)
	modified:   src/middleware/auth.js

no changes added to commit (use "git add" and/or "git commit -a")

7. Interactive TUI Keyboard Shortcuts

  • Shift + Tab — Cycles your active tool permission level. You can toggle between manually approving every single file edit or switching to complete autonomous execution.
  • Ctrl + C — Interrupts an active processing sequence. Use this to freeze Claude mid-thought or kill a terminal execution loop running wild. Pressing it twice exits the session entirely.
  • Ctrl + B — Pushes a heavy, long-running task (like a major database compilation) into a background subagent so you can continue chatting and editing in the foreground window.
  • Ctrl + R — Activates prompt history reverse search, letting you loop through complex prompts you keyed into past sessions.
  • Esc + Esc — Wipes your current prompt draft text line clear. If your input line is already completely empty, double-tapping Escape pops open the interactive rewind menu tree.
  • Ctrl + O — Expands the sub-terminal live execution tool log, letting you inspect the exact raw tool inputs and script outputs passing under the hood.

8. Direct Terminal Pipeline Utilities (Unix Piping)

tail -n 150 /var/log/nginx/error.log | claude -p "Analyze these formatting errors or anomalies and propose configuration fixes."
git diff main --name-only | claude -p "Audit these specific files for styling or syntax mistakes."

9. Setting Persistent Project Instructions via CLAUDE.md

cat << 'EOF' > CLAUDE.md
# Project Guidelines

## Tech Stack & Architecture
- Codebase utilizes ES modules syntax (`import/export`), do not use CommonJS.
- Ensure all database promises implement `async/await` blocks with explicit try/catch traps.

## Common Automation Scripts
- Build command: `npm run build`
- Test command: `npm run test`
- Lint command: `npm run lint`
EOF

10. Pro-Tips for Peak VPS Performance & Cost Management

  • Manage Context Aggressively: Because Claude scans real files, it's easy to burn through Anthropic API tokens on giant directories. Keep your .gitignore file updated so Claude doesn't waste tokens indexing bloated folders like node_modules or massive media assets.

    How to Keep Your .gitignore Updated via VPS Terminal:

    cat << 'EOF' >> .gitignore
    # Stop Claude from indexing third-party libraries
    node_modules/
    jspm_packages/
    web_modules/
    
    # Ignore production builds and logs
    dist/
    build/
    .npm
    *.log
    
    # Guard environment variables and server files
    .env
    .env.local
    .vps-cache/
    EOF
    
  • Limit File System Sweeps: If you are working inside a massive monolithic folder, avoid broad prompts like "Find bugs in this project." Always combine your instructions with targeted file flags using the @ operator to enforce strict file scanning bounds.

Note for VPS Admin Users: Running Claude Code directly as the root user gives it full authorization to execute local system bash actions. Ensure you only initialize Claude inside project directories whose dependencies you completely trust.

Summary

Claude Code transforms your Bluehost Self-Managed VPS or VDS into an agentic, AI-powered development environment that works directly with your real project files. To get started, always initialize a proper repository and project directory via your server’s command line — this structure lets Claude safely track, edit, and execute code on your behalf.

Inside Claude, use its agentic workflow (Explore → Plan → Implement → Verify) to guide the AI through architectural analysis, intelligent code generation, and error fixing—never needing to paste long code snippets or switch tools. Harness its rich slash commands (/plan, /diff, /rewind, etc.) and context-targeting features (@filename) to control what you want Claude to analyze or edit.

Do not forget the difference between those actions performed in the shell of your normal VPS or VDS shell (system CLI flags) and actions performed within Claude’s terminal window. Maintain a CLAUDE.md file for all future projects as your authoritative guide and improve efficiency/efficiency by using a clear .gitignore rand proper context. Be extra careful while dealing with big and/or security-related folders while performing as root or using AI to sweep files.

With these best practices, your Bluehost server becomes a modern, context-aware coding workspace, offering speed, safety, and full-lifecycle AI assistance—from scaffolding to build, test, and deploy.

Loading...