Skip to content

Claude Code Complete Guide

Claude Code Web Advanced Guide - Complete GitHub Remote Control

Target Audience

  • Users familiar with Claude Code Web basics
  • Those seeking advanced GitHub integration
  • Anyone wanting to learn about environment and security controls

How to Use This Guide

Agent-Driven Development

Important: The commands shown in this guide are not for you to execute yourself.

Claude Code agents will execute them:

  1. Verbal Instructions: Tell Claude Code "Set up GitHub CLI"
  2. Documentation: Write setup procedures in CLAUDE.md (or a symlink to AGENTS.md), and the agent will automatically read and execute them
  3. Automatic Execution: The agent references this documentation and automatically executes the necessary commands

Your role is to "tell Claude what you want done". Let the agent handle command execution.

Key Points

  1. Complete repository management remotely with GitHub CLI
  2. Control issues, PRs, Actions, and releases via natural language
  3. Properly manage network access and security

What GitHub CLI Enables

Integrating GitHub CLI (gh) allows the following operations from Claude Code Web without leaving your browser. Agent-driven development means complex GitHub operations can be performed simply by giving instructions in natural language.

Issue Management: Create, edit, close, label, and assign issues

Pull Requests: Create PRs, merge, approve reviews, add comments

GitHub Actions: Check workflow status, trigger manually, view logs

Release Management: Create tags, generate release notes, upload assets

Repository Operations: Manage project boards, Discussions, and Gists

All of these can be executed simply by instructing Claude in natural language. The agent automatically constructs and executes commands. No deep GitHub knowledge required.

Network Access Permission Settings

Choosing Access Levels

Claude Code Web offers three network environment options, selectable when creating tasks.

Completely blocks external network connections. Ideal for reviewing highly confidential code.

Permits access only to specified domains. Use when specific external resources like npm packages are needed.

Allows access to all domains (* designation). Used for development environment setup, but evaluate risks before use.

Practical Configuration Examples

Enabling npm Package Installation

Add the following in the "Network access" section when creating a task:

registry.npmjs.org

This enables npm package downloads.

Secure Execution Environment

Sandbox Mechanism

All tasks run in isolated sandbox environments. The latest 2025 updates have strengthened the following protections.

Filesystem Isolation: Only authorized repositories are accessible. Sensitive files like .env are automatically blocked.

Network Isolation: External connections only through a proxy server. New domain connections require confirmation each time.

Web Version Limitations

Claude Code Web runs in the cloud and cannot directly access local environment variables or secrets. Consider using the CLI version when sensitive information is required.

Leveraging GitHub CLI (gh)

Environment as of February 2026

Claude Code Web now supports apt-get, making GitHub CLI installation straightforward. Simply set your token as an environment variable and run apt-get install -y gh to get started immediately.

Detailed Prerequisites

All procedures are verified in production environments (2026-02-22).

For more detailed prerequisites and environment setup, document them in your project's CLAUDE.md or dedicated documentation files. The agent will automatically reference them.

Setup Steps

Step 0: Configure Environment Variables (Web Task Screen)

Set one of the following in the "Environment variables" section of the task creation screen.

Choosing Environment Variable Name

Recommended: Setting GH_TOKEN directly, which GitHub CLI recognizes by default, is simpler.

GH_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
With this method, you don't need to specify GH_TOKEN=$TOKEN when executing gh commands.

GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
With this method, you need to specify GH_TOKEN=$GITHUB_PERSONAL_ACCESS_TOKEN at execution time.

Create a GitHub Personal Access Token from GitHub Settings > Developer settings > Personal access tokens.

Required Permission Scopes

Write permissions are required for the operations described:

  • repo - Full access to private repositories (required for issue/PR/release operations)
  • or public_repo - For public repositories only
  • workflow - Required for manually triggering GitHub Actions
  • read:org - Read organization information (optional)

Read-only is insufficient: Write operations such as adding issue comments, editing labels, and merging PRs require write permissions.

Step 1: Install GitHub CLI

Install using apt-get.

# Install GitHub CLI
apt-get install -y gh

# Verify installation
gh --version

✅ Expected verified output:

gh version 2.67.0 (2025-03-17)
https://github.com/cli/cli/releases/tag/v2.67.0

About versions

The version installed via apt-get may vary by environment. Basic operations work with any recent version.

Step 2: Verify Authentication

Confirm the environment variable is correctly configured.

# Verify authentication status (with GH_TOKEN set as environment variable)
gh auth status

✅ Expected verified output:

github.com
  ✓ Logged in to github.com account username (GH_TOKEN)
  - Active account: true
  - Git operations protocol: https
  - Token: ghp_************************************
  - Token scopes: 'repo', 'workflow', 'read:org', ...

Using the GH_TOKEN Environment Variable

When GH_TOKEN is set in the task creation screen, gh commands automatically recognize the token. No need to specify the token with each command execution.

Step 3: Set Default Repository (Optional)

Setting a frequently used repository allows you to omit the --repo flag.

# Check repository information
git remote get-url origin

# Set default repository
gh config set repository owner/repo

Step 4: Verify Installation

REPO=owner/repo

# Get issue list
gh issue list --repo $REPO

# View specific issue details
gh issue view 123 --repo $REPO

Best Practices

✅ Verified recommended patterns (Tested in production):

REPO=owner/repo

# Execute gh api command
gh api repos/$REPO/pulls --jq '.[] | {number, title, state}'

# Get PR list (with pagination support)
gh api repos/$REPO/pulls --paginate \
  --jq '.[] | {number, title, state, head: .head.ref}'

Efficient Operation Tips

  1. ✅ GH_TOKEN environment variable: Just set GH_TOKEN in the task creation screen for automatic authentication across all commands
  2. Prefer gh api: gh api is more stable than gh pr view or gh issue view
  3. Use --paginate: Always add --paginate when results span multiple pages
  4. Filter with jq: Use --jq to extract only needed information for readability

Practical Usage Examples

With gh commands, you can perform advanced operations via natural language instructions.

Issue Management Examples:

Create a new bug report issue
Create a bug report issue: title "Login error", include error logs
in the body, add label "bug", and assign to me
Batch process multiple issues
Fetch 10 issues with label "good first issue" and add a
"beginner guide" comment to each

Pull Request Examples:

Automated PR review
Review the code in PR #789 and comment on any issues found
PR merge and cleanup
Merge PR #456, close related issue #123, and create a
release notes draft

GitHub Actions Integration Examples:

Workflow monitoring
REPO=owner/repo

# Check latest workflow execution
gh api repos/$REPO/actions/runs \
  -F status=failure -F per_page=1 --jq '.[0] | {id, name, conclusion, html_url}'

# Get error logs
RUN_ID=<ID from above>
gh api repos/$REPO/actions/runs/$RUN_ID/jobs \
  --jq '.jobs[] | select(.conclusion=="failure") | {name, steps: [.steps[] | select(.conclusion=="failure") | {name, conclusion}]}'
Manual deployment
Manually trigger the production deployment workflow

Release Management Examples:

Automated release creation
Create release v2.0.0 from the latest tag and generate
release notes from PR titles since the last release

Troubleshooting

gh Command Not Found

Symptom: gh: command not found

Solution: Run apt-get install -y gh to install GitHub CLI.

Authentication Errors

Symptom: authentication failed

Solution: 1. Verify GH_TOKEN is correctly set in the Web task screen 2. Check if the token is loaded with echo $GH_TOKEN | head -c 10 3. Verify authentication with gh auth status

Permission Errors

Symptom: Resource not accessible by integration or 403 Forbidden

Cause: Insufficient token scopes (permissions)

Solution: 1. Check your token at GitHub Settings > Developer settings > Personal access tokens 2. Verify the following scopes are enabled: - repo (or public_repo) - workflow (required for GitHub Actions operations) 3. If scopes are missing, regenerate the token and update the environment variable in the Web task screen

Required Scopes by Operation

  • Issue comments/label edits: repo or public_repo
  • PR creation/merge: repo or public_repo
  • Actions manual trigger: repo + workflow
  • Release creation: repo

auth login Not Working

Symptom: Interactive browser authentication is requested

Solution: Browser authentication is not available in the Web environment. Use the GH_TOKEN environment variable method by setting it in the task creation screen.

Next Steps

After mastering advanced settings, check out these articles:

Reference Information

Claude Code Official Documentation

Project-Specific Documentation Management

When managing prerequisites and environment setup in Claude Code projects, we recommend the following structure:

Automatic Loading with CLAUDE.md:

  • Create CLAUDE.md in your project root, and it will be automatically loaded when the agent starts
  • Document GitHub CLI setup procedures, authentication methods, and best practices
  • The agent will reference this documentation and automatically execute setup

Modularized Configuration Files:

  • Place purpose-specific rule files in the .claude/rules/ directory
  • Examples: prerequisites.md (prerequisites), development-workflow.md (development flow), etc.
  • Link to each rule file from CLAUDE.md to structure your information