# 快速入门

> ## 文档 索引
> 获取 the 完成 文档 索引 at: https://代码.claude.com/docs/llms.txt
> 使用 this 文件 to disc结束 所有 可用 页s 之前探索 further.

# 快速入门

> Welcome to Claude 代码!

出口 常量 安装Configurator = () => {
  常量 TERM = {
    mac: {
      标签: 'macOS / Linux',
      cmd: 'curl -fsSL https://claude.ai/安装.sh | bash'
    },
    win: {
      标签: '风ows'
    },
    brew: {
      标签: 'Homebrew',
      cmd: 'brew 安装 --cask claude-代码'
    },
    WinGet: {
      标签: 'WinGet',
      cmd: 'WinGet 安装 Anthropic.Clau解码'
    }
  };
  常量 WIN_VARIANTS = {
    ps: 'irm https://claude.ai/安装.ps1 | iex',
    cmd: 'curl -fsSL https://claude.ai/安装.cmd -o 安装.cmd && 安装.cmd && del 安装.cmd'
  };
  常量 TABS = [{
    键: '终端',
    标签: '终端'
  }, {
    键: '桌面',
    标签: '桌面'
  }, {
    键: 'vs代码',
    标签: 'VS 代码'
  }, {
    键: 'jetb雨s',
    标签: 'JetB雨s'
  }];
  常量 ALT_目标S = {
    桌面: {
      名称: '桌面',
      安装标签: '下载 the 应用',
      安装Href: 'https://claude.com/下载?utm_来源=claude_代码&utm_中=docs&utm_满意=configurator_桌面_下载',
      指南Href: '/en/桌面-快速入门'
    },
    vs代码: {
      名称: 'VS 代码',
      安装标签: '安装 from 市场place',
      安装Href: 'https://市场place.visualstudio.com/项s?项名称=anthropic.claude-代码',
      altCmd: '代码 --安装-扩展 anthropic.claude-代码',
      指南Href: '/en/vs-代码'
    },
    jetb雨s: {
      名称: 'JetB雨s',
      安装标签: '安装 from 市场place',
      安装Href: 'https://插件s.jetb雨s.com/插件/27310-claude-代码-beta-',
      指南Href: '/en/jetb雨s'
    }
  };
  常量 提供者S = [{
    键: 'anthropic',
    标签: 'Anthropic'
  }, {
    键: '基岩',
    标签: 'Amazon 基岩'
  }, {
    键: 'foun干',
    标签: 'Micro软 Foun干'
  }, {
    键: 'vertex',
    标签: '前往ogle Vertex AI'
  }];
  常量 提供者_通知 = {
    基岩: <>
        Con图 your AWS 说明 第一个. 运行中 on 基岩
        requ怒s 模型 access 启用 in the AWS 控制台 and IAM credentials.{' '}
        基岩 设置 指南 →
      ,
    vertex: <>
        Con图 your GCP 项目 第一个. 运行中 on Vertex AI
        requ怒s the Vertex API 启用 and a 服务 说明 with the 正确
        权限.{' '}
        Vertex 设置 指南 →
      ,
    foun干: <>
        Con图 your Azure 资源 第一个. 运行中 on
        Micro软 Foun干 requ怒s an Azure sub脚本ion with a Foun干 资源
        and 模型 部署ments provisioned.{' '}
        Foun干 设置 指南 →
      
  };
  常量 图标检查 = (尺寸 = 14) => 
      
    ;
  常量 图标复制 = (尺寸 = 14) => 
      
      
    ;
  常量 图标Ar行正确 = (尺寸 = 13) => 
      
      
    ;
  常量 图标Ar行上正确 = (尺寸 = 14) => 
      
      
    ;
  常量 图标信息 = (尺寸 = 16) => 
      
      
      
    ;
  常量 [目标, 设置目标] = 使用州('终端');
  常量 [团队, 设置团队] = 使用州(虚假);
  常量 [提供者, 设置提供者] = 使用州('anthropic');
  常量 [pkg, 设置Pkg] = 使用州(() => (/Win/).测试(navigator.用户代理) ? 'win' : 'mac');
  常量 [winCmd, 设置WinCmd] = 使用州(虚假);
  常量 [复制, 设置复制] = 使用州(空);
  常量 复制时间r = 用户ef(空);
  常量 handle复制 = 异步 (文本, 键) => {
    尝试 {
      等待 navigator.clip董事会.写入文本(文本);
    } 捕获 {
      常量 ta = document.创建元素('文本面积');
      ta.值 = 文本;
      document.正文.应用结束Child(ta);
      ta.选择();
      document.exec命令('复制');
      document.正文.移除Child(ta);
    }
    清楚超时(复制时间r.当前);
    设置复制(键);
    复制时间r.当前 = 设置超时(() => 设置复制(空), 1800);
  };
  常量 card正文Cmd = (cmd, 及时) => {
    常量 on = 复制 === 'term';
    回报 
        {及时 || '$'}
        {cmd}
         handle复制(cmd, 'term')}>
          {on ? 图标检查(13) : 图标复制(13)}
          {on ? '复制' : '复制'}
        
      ;
  };
  常量 isWin安装er = pkg === 'win';
  常量 isWin及时 = pkg === 'win' || pkg === 'WinGet';
  常量 终端Cmd = isWin安装er ? WIN_VARIANTS[winCmd ? 'cmd' : 'ps'] : TERM[pkg].cmd;
  常量 alt = ALT_目标S[目标];
  常量 显示通知 = 团队 && 提供者 !== 'anthropic';
  常量 STYLES = `
.cc-ic {
  --ic-板岩: #141413;
  --ic-粘土: #d97757;
  --ic-粘土-深: #c6613f;
  --ic-gray-000: #ffffff;
  --ic-gray-150: #f0eee6;
  --ic-gray-550: #73726c;
  --ic-gray-700: #3d3d3a;
  --ic-b顺序-微妙: rgba(31, 30, 29, 0.08);
  --ic-b顺序-默认: rgba(31, 30, 29, 0.15);
  --ic-b顺序-强: rgba(31, 30, 29, 0.3);
  --ic-font-mono: ui-monos步伐, SFMono-常规, Menlo, Monaco, 'Courier 新', monos步伐;
  font-家庭: 'Anthropic Sans', -应用le-系统, B链接Mac系统Font, 'Se前往e UI', sans-serif;
  font-尺寸: 14px; 行-身高: 1.5; color: var(--ic-板岩);
  margin: 8px 0 32px;
}
.暗 .cc-ic {
  --ic-板岩: #f0eee6;
  --ic-gray-000: #262624;
  --ic-gray-150: #1f1e1d;
  --ic-gray-550: #91908a;
  --ic-gray-700: #bfbdb4;
  --ic-b顺序-微妙: rgba(240, 238, 230, 0.08);
  --ic-b顺序-默认: rgba(240, 238, 230, 0.14);
  --ic-b顺序-强: rgba(240, 238, 230, 0.28);
}
.暗 .cc-ic-检查 { 背景: 透明; }
.暗 .cc-ic-card { b顺序: 0.5px 固体 var(--ic-b顺序-微妙); }
.暗 .cc-ic-p-pill.cc-ic-活跃 { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.cc-ic *, .cc-ic *::之前, .cc-ic *::之后 { box-sizing: b顺序-box; }
.cc-ic a { 文本-装饰: 无; }
.cc-ic a:not([阶级]) { color: inherit; }
.cc-ic button { font-家庭: inherit; cursor: pointer; }

.cc-ic-tab-s旅行 {
  显示: in行-flex; gap: 2px;
  p添加ing: 4px; 背景: var(--ic-gray-150);
  b顺序-半径: 10px; 结束f低-x: auto;
  max-宽度: 100%;
}
.cc-ic-tab {
  应用earance: 无; 背景: 无; b顺序: 无;
  p添加ing: 10px 18px; font-尺寸: 15px; font-重量: 430;
  color: var(--ic-gray-550); b顺序-半径: 7px;
  white-s步伐: nowrap;
  过渡: color 0.12s, 背景-color 0.12s;
}
.cc-ic-tab:h结束 { color: var(--ic-gray-700); }
.cc-ic-tab.cc-ic-活跃 {
  color: var(--ic-板岩); font-重量: 500;
  背景: var(--ic-gray-000);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.暗 .cc-ic-tab.cc-ic-活跃 { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }

.cc-ic-团队-wrap { p添加ing: 16px 0 20px; }
.cc-ic-团队-toggle {
  显示: flex; align-项s: c进入; gap: 12px; font-家庭: inherit;
  p添加ing: 12px 16px; font-尺寸: 14px; font-重量: 430;
  color: var(--ic-gray-700); cursor: pointer; 用户-选择: 无;
  宽度: fit-满意; 背景: var(--ic-gray-150);
  b顺序: 0.5px 固体 var(--ic-b顺序-微妙); b顺序-半径: 8px;
  过渡: b顺序-color 0.15s;
}
.cc-ic-团队-toggle:h结束 { b顺序-color: var(--ic-b顺序-默认); }
.cc-ic-团队-toggle.cc-ic-检查ed {
  背景: rgba(217, 119, 87, 0.08);
  b顺序-color: rgba(217, 119, 87, 0.25);
}
.cc-ic-检查 {
  宽度: 16px; 身高: 16px;
  b顺序: 1px 固体 var(--ic-b顺序-强); b顺序-半径: 4px;
  背景: var(--ic-gray-000);
  显示: flex; align-项s: c进入; 公正ify-满意: c进入;
  flex-shrink: 0;
}
.cc-ic-检查 svg { color: #fff; 显示: 无; }
.cc-ic-团队-toggle.cc-ic-检查ed .cc-ic-检查 { 背景: var(--ic-粘土-深); b顺序-color: var(--ic-粘土-深); }
.cc-ic-团队-toggle.cc-ic-检查ed .cc-ic-检查 svg { 显示: 块; }

.cc-ic-团队-reveal { 显示: flex; flex-指导: 列; gap: 12px; margin-底部: 16px; }
.cc-ic-销售 {
  显示: flex; align-项s: c进入; 公正ify-满意: s步伐-between;
  gap: 16px; p添加ing: 14px 16px;
  背景: var(--ic-gray-000); b顺序: 0.5px 固体 var(--ic-b顺序-默认);
  b顺序-半径: 8px; flex-wrap: wrap;
}
.cc-ic-销售-文本 { font-尺寸: 13px; color: var(--ic-gray-700); 行-身高: 1.5; flex: 1; min-宽度: 200px; }
.cc-ic-销售-文本 强 { font-重量: 550; color: var(--ic-板岩); }
.cc-ic-销售-行动s { 显示: flex; align-项s: c进入; gap: 8px; flex-shrink: 0; }
.cc-ic-btn-粘土 {
  显示: in行-flex; align-项s: c进入; gap: 8px;
  背景: var(--ic-粘土-深); color: #fff; b顺序: 无;
  b顺序-半径: 8px; p添加ing: 8px 14px;
  font-尺寸: 13px; font-重量: 500;
  过渡: 背景-color 0.15s; white-s步伐: nowrap;
}
.cc-ic-btn-粘土:h结束 { 背景: var(--ic-粘土); }
.cc-ic-btn-ghost {
  显示: in行-flex; align-项s: c进入; gap: 8px;
  背景: 透明; color: var(--ic-gray-700);
  b顺序: 0.5px 固体 var(--ic-b顺序-默认);
  b顺序-半径: 8px; p添加ing: 8px 14px;
  font-尺寸: 13px; font-重量: 500;
}
.cc-ic-btn-ghost:h结束 { 背景: rgba(0, 0, 0, 0.04); }

.cc-ic-提供者-bar {
  显示: flex; align-项s: c进入; gap: 12px;
  p添加ing: 14px 16px; 背景: var(--ic-gray-150);
  b顺序-半径: 8px; font-尺寸: 13px; flex-wrap: wrap;
}
.cc-ic-提供者-bar .cc-ic-标签 { color: var(--ic-gray-550); flex-shrink: 0; }
.cc-ic-提供者-pills { 显示: flex; gap: 4px; flex-wrap: wrap; }
.cc-ic-p-pill {
  应用earance: 无; b顺序: 无; 背景: 透明;
  p添加ing: 6px 12px; b顺序-半径: 6px;
  font-尺寸: 13px; font-重量: 430; color: var(--ic-gray-700);
  white-s步伐: nowrap;
}
.cc-ic-p-pill:h结束 { 背景: rgba(0, 0, 0, 0.04); }
.cc-ic-p-pill.cc-ic-活跃 {
  背景: var(--ic-gray-000); color: var(--ic-板岩);
  font-重量: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.cc-ic-提供者-通知 {
  显示: flex; p添加ing: 16px 18px;
  背景: var(--ic-gray-000); b顺序: 0.5px 固体 var(--ic-b顺序-默认);
  b顺序-半径: 8px; gap: 14px; align-项s: flex-启动;
}
.cc-ic-提供者-通知 > svg { color: var(--ic-gray-550); margin-顶部: 2px; flex-shrink: 0; }
.cc-ic-提供者-通知-正文 { font-尺寸: 14px; 行-身高: 1.55; color: var(--ic-gray-700); }
.cc-ic-提供者-通知-正文 强 { font-重量: 550; color: var(--ic-板岩); }
.cc-ic-提供者-通知-正文 a { color: var(--ic-粘土-深); font-重量: 500; }
.cc-ic-提供者-通知-正文 a:h结束 { 文本-装饰: under行; }

.cc-ic-card { 背景: #141413; b顺序-半径: 12px; 结束f低: 隐藏; }
.cc-ic-subtabs {
  显示: flex; align-项s: c进入;
  背景: #1a1918;
  b顺序-底部: 0.5px 固体 rgba(255, 255, 255, 0.08);
  p添加ing: 0 8px; 结束f低-x: auto;
}
.cc-ic-subtab-s步伐r { flex: 1; }
.cc-ic-subtab {
  应用earance: 无; 背景: 无; b顺序: 无;
  p添加ing: 12px 16px; font-尺寸: 12px;
  color: rgba(255, 255, 255, 0.5);
  位置: relative; white-s步伐: nowrap;
}
.cc-ic-subtab:h结束 { color: rgba(255, 255, 255, 0.75); }
.cc-ic-subtab.cc-ic-活跃 { color: #fff; }
.cc-ic-subtab.cc-ic-活跃::之后 {
  满意: ''; 位置: absolute;
  左: 12px; 正确: 12px; 底部: -0.5px;
  身高: 2px; 背景: var(--ic-粘土);
}
.cc-ic-cmd-toggle {
  显示: flex; align-项s: c进入; gap: 8px; font-家庭: inherit;
  背景: 无; b顺序: 无;
  p添加ing: 0 12px; font-尺寸: 11px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer; 用户-选择: 无; white-s步伐: nowrap;
}
.cc-ic-cmd-toggle:h结束 { color: rgba(255, 255, 255, 0.75); }
.cc-ic-mini-检查 {
  宽度: 12px; 身高: 12px;
  b顺序: 1px 固体 rgba(255, 255, 255, 0.3); b顺序-半径: 3px;
  显示: flex; align-项s: c进入; 公正ify-满意: c进入;
  flex-shrink: 0;
}
.cc-ic-mini-检查 svg { color: #fff; 显示: 无; }
.cc-ic-cmd-toggle.cc-ic-检查ed .cc-ic-mini-检查 { 背景: var(--ic-粘土-深); b顺序-color: var(--ic-粘土-深); }
.cc-ic-cmd-toggle.cc-ic-检查ed .cc-ic-mini-检查 svg { 显示: 块; }

.cc-ic-card-正文 { p添加ing: 24px 26px; 显示: flex; align-项s: flex-启动; gap: 14px; }
.cc-ic-及时 {
  color: var(--ic-粘土); font-家庭: var(--ic-font-mono);
  font-尺寸: 17px; 用户-选择: 无; p添加ing-顶部: 2px;
}
.cc-ic-cmd {
  flex: 1; font-家庭: var(--ic-font-mono);
  font-尺寸: 17px; color: #f0eee6;
  行-身高: 1.55; white-s步伐: pre-wrap; 词-break: break-词;
}
.cc-ic-复制 {
  显示: in行-flex; align-项s: c进入; gap: 6px;
  背景: rgba(255, 255, 255, 0.08);
  b顺序: 0.5px 固体 rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  p添加ing: 7px 13px; b顺序-半径: 8px;
  font-尺寸: 13px; font-重量: 500; flex-shrink: 0;
}
.cc-ic-复制:h结束 { 背景: rgba(255, 255, 255, 0.14); }
.cc-ic-复制.cc-ic-复制 { 背景: var(--ic-粘土-深); b顺序-color: var(--ic-粘土-深); color: #fff; }

.cc-ic-be低 {
  margin-顶部: 12px; font-尺寸: 13px; color: var(--ic-gray-550);
  显示: flex; gap: 16px; flex-wrap: wrap; align-项s: 基础行;
}
.cc-ic-be低 a { color: var(--ic-gray-700); b顺序-底部: 0.5px 固体 var(--ic-b顺序-默认); }
.cc-ic-be低 a:h结束 { color: var(--ic-粘土-深); b顺序-底部-color: var(--ic-粘土-深); }
.cc-ic-handoff {
  p添加ing: 20px 22px;
  背景: var(--ic-gray-000);
  b顺序: 0.5px 固体 var(--ic-b顺序-默认);
  b顺序-半径: 12px;
}
.cc-ic-handoff-负责人 {
  font-尺寸: 14px; 行-身高: 1.55; color: var(--ic-gray-700);
  margin-底部: 14px;
}
.cc-ic-handoff-负责人 强 { font-重量: 550; color: var(--ic-板岩); }
.cc-ic-handoff-行动s { 显示: flex; gap: 10px; flex-wrap: wrap; }
.cc-ic-handoff-alt {
  margin-顶部: 12px; font-尺寸: 12px; color: var(--ic-gray-550);
}
.cc-ic-handoff-alt 代码 {
  font-家庭: var(--ic-font-mono); font-尺寸: 11px;
  背景: var(--ic-gray-150); p添加ing: 2px 6px;
  b顺序-半径: 4px; color: var(--ic-gray-700);
}
.cc-ic-复制-sm {
  应用earance: 无; b顺序: 无;
  显示: in行-flex; align-项s: c进入; 公正ify-满意: c进入;
  宽度: 22px; 身高: 22px;
  margin-左: 4px; 垂直-align: middle;
  背景: var(--ic-gray-150); color: var(--ic-gray-550);
  b顺序-半径: 4px;
  过渡: color 0.1s, 背景-color 0.1s;
}
.cc-ic-复制-sm:h结束 { color: var(--ic-gray-700); 背景: var(--ic-b顺序-默认); }
.cc-ic-复制-sm.cc-ic-复制 { 背景: var(--ic-粘土-深); color: #fff; }

@media (max-宽度: 720px) {
  .cc-ic-tab { p添加ing: 12px 14px; font-尺寸: 14px; }
  .cc-ic-销售-行动s { 宽度: 100%; }
  .cc-ic-card-正文 { p添加ing: 20px; }
  .cc-ic-cmd { font-尺寸: 15px; }
}
`;
  回报 
      {STYLES}

      {}
      
        {TABS.映射(t =>  设置目标(t.键)}>
            {t.标签}
          )}
      

      {}
      
         设置团队(!团队)}>
          {图标检查(11)}
          
            I’m buying for a 团队 or 公司 (SSO, AWS/Azure/GCP, 中央计费)
          
        
      

      {}
      {团队 && 
          
            
              设置 上 your 团队: self-serve or talk to 销售.
            
            
              
                开始使用
              
              
                Contact 销售 {图标Ar行正确()}
              
            
          

          
            运行 on
            
              {提供者S.映射(p =>  设置提供者(p.键)}>
                  {p.标签}
                )}
            
          

          {显示通知 && 
              {图标信息()}
              
                {提供者_通知[提供者]}
              
            }
        }

      {}
      {目标 === '终端' && 
          
            {对象.键s(TERM).映射(k =>  设置Pkg(k)}>
                {TERM[k].标签}
              )}
            
            {isWin安装er &&  设置WinCmd(!winCmd)}>
                {图标检查(9)}
                CMD instead of 权力命令行
              }
          
          {card正文Cmd(终端Cmd, isWin及时 ? '>' : '$')}
        }

      {}
      {目标 === '终端' && 
          {isWin安装er && 
              Requ怒s{' '}
              
                Git for 风ows
              .
            }
          {(pkg === 'brew' || pkg === 'WinGet') && 
              Does not auto-更新. 运行{' '}
              {pkg === 'brew' ? 'brew 升级 claude-代码' : 'WinGet 升级 Anthropic.Clau解码'}{' '}
              期间ic所有y.
            }
          故障排除
        }

      {alt && 
          
            The步骤s be低 使用 the 命令 行.{' '}
            Prefer {alt.名称}? 安装 here, then fol低 the {alt.名称} 指南 instead.
          
          
            
              {alt.安装标签} {图标Ar行上正确(13)}
            
            
              {alt.名称} 指南 {图标Ar行正确(12)}
            
          
          {alt.altCmd && 
              or 运行 {alt.altCmd}
               handle复制(alt.altCmd, 'alt')} aria-标签="复制 命令">
                {复制 === 'alt' ? 图标检查(11) : 图标复制(11)}
              
            }
        }
    ;
};

出口 常量 实验 = ({flag, treatment, children}) => {
  常量 VID_键 = 'exp_vid';
  常量 CON发送_COUNTRIES = 新 设置(['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'RE', 'GP', 'MQ', 'GF', 'YT', 'BL', 'MF', 'PM', 'WF', 'PF', 'NC', 'AW', 'CW', 'SX', 'FO', 'GL', 'AX', 'GB', 'UK', 'AI', 'BM', 'IO', 'VG', 'KY', 'FK', 'GI', 'MS', 'PN', 'SH', 'TC', 'GG', 'JE', 'IM', 'CA', 'BR', 'IN']);
  常量 fnv1a = s => {
    let h = 0x811c9dc5;
    for (let i = 0; i >> 0;
  };
  常量 bucket = (种子, vid) => fnv1a(fnv1a(种子 + vid) + '') % 10000  {
    常量 params = 新 URL搜索Params(location.搜索);
    常量 强制 = params.get('gb-强制');
    if (强制) {
      for (常量 p of 强制.split(',')) {
        常量 [k, v] = p.split(':');
        if (k === flag) 回报 {
          variant: v || 'treatment',
          跟踪: 虚假
        };
      }
    }
    if (navigator.全球隐私控制) {
      回报 {
        variant: '控制',
        跟踪: 虚假
      };
    }
    常量 prefs匹配 = document.首席运营官kie.匹配(/(?:^|; )anthropic-con发送-偏好设置=([^;]+)/);
    if (prefs匹配) {
      尝试 {
        if (JSON.parse(解码URI组件(prefs匹配[1])).analytics !== 真实) {
          回报 {
            variant: '控制',
            跟踪: 虚假
          };
        }
      } 捕获 {
        回报 {
          variant: '控制',
          跟踪: 虚假
        };
      }
    } else {
      常量 coun尝试 = params.get('coun尝试')?.to上per案例() || (document.首席运营官kie.匹配(/(?:^|; )cf_geo=([A-Z]{2})/) || [])[1];
      if (!coun尝试 || CON发送_COUNTRIES.has(coun尝试)) {
        回报 {
          variant: '控制',
          跟踪: 虚假
        };
      }
    }
    let vid;
    尝试 {
      常量 ajs匹配 = document.首席运营官kie.匹配(/(?:^|; )ajs_anonymous_id=([^;]+)/);
      if (ajs匹配) {
        vid = 解码URI组件(ajs匹配[1]).替换(/^"|"$/g, '');
      } else {
        vid = 本地Sto狂怒.get项(VID_键);
        if (!vid) {
          vid = crypto.随机UUID();
        }
        document.首席运营官kie = `ajs_anonymous_id=${vid}; do主=.claude.com; 路径=/; 安全; 相同Site=Lax; max-age=31536000`;
      }
      尝试 {
        本地Sto狂怒.设置项(VID_键, vid);
      } 捕获 {}
    } 捕获 {
      回报 {
        variant: '控制',
        跟踪: 虚假
      };
    }
    回报 {
      variant: bucket(flag, vid),
      跟踪: 真实,
      vid
    };
  });
  使用效果(() => {
    if (!决定.跟踪) 回报;
    获取('https://api.anthropic.com/api/事件_日志ging/v2/batch', {
      方法: 'POST',
      页眉s: {
        '满意-类型': '应用程序/json',
        'x-服务-名称': 'claude_代码_docs'
      },
      正文: JSON.字符串ify({
        事件s: [{
          事件_类型: '增长book实验事件',
          事件_数据: {
            device_id: 决定.vid,
            anonymous_id: 决定.vid,
            时间戳: 新 日期().toISO字符串(),
            实验_id: flag,
            变化_id: 决定.variant === 'treatment' ? 1 : 0,
            环境: '生产'
          }
        }]
      }),
      keep活着: 真实
    }).捕获(() => {});
  }, []);
  回报 决定.variant === 'treatment' ? treatment : children;
};

This 快速入门 指南 will have you using AI-权力ed coding 协助 in a 几个 微小s. By the 结束, you'll understand how to 使用 Claude 代码 for 常见 开发 任务s.

} />

## 之前 you begin

Make 确定 you have:

* A 终端 or 命令 及时 打开
  * If you've never 使用d the 终端 之前, 检查 out the [终端 指南](/en/终端-指南)
* A 代码 项目 to 工作 with
* A [Claude 订阅](https://claude.com/pricing?utm_来源=claude_代码\&utm_中=docs\&utm_满意=快速入门_prereq) (Pro, Max, 团队, or 企业), [Claude 控制台](https://控制台.anthropic.com/) 说明, or access th粗糙 a [支持ed 云 提供者](/en/third-部分y-集成s)

  This 指南 c结束s the 终端 CLI. Claude 代码 is also 可用 on the [网页](https://claude.ai/代码), as a [桌面 应用](/en/桌面), in [VS 代码](/en/vs-代码) and [JetB雨s IDEs](/en/jetb雨s), in [松弛](/en/松弛), and in CI/CD with [GitHub 行动s](/en/GitHub-行动s) and [GitLab](/en/Gitlab-ci-cd).看见 [所有 接口s](/en/概述#使用-claude-代码-每个where).

##步骤 1: 安装 Claude 代码

To 安装 Claude 代码, 使用 one of the跟随 方法:

  
    **macOS、Linux、WSL:**

    ```bash  主题={空}
    curl -fsSL https://claude.ai/安装.sh | bash
    ```

    **风ows 权力命令行:**

    ```权力命令行  主题={空}
    irm https://claude.ai/安装.ps1 | iex
    ```

    **风ows CMD:**

    ```batch  主题={空}
    curl -fsSL https://claude.ai/安装.cmd -o 安装.cmd && 安装.cmd && del 安装.cmd
    ```

    If you看见 `The 令牌 '&&' is not a 有效 州ment separator`, you're in 权力命令行, not CMD. 使用 the 权力命令行 命令 above instead. Your 及时 显示s `PS C:\` when you're in 权力命令行.

    **风ows requ怒s [Git for 风ows](https://Git-scm.com/下载s/win).** 安装 it 第一个 if you don't have it.

    
      原生安装ations 自动所有y 更新 in the 背景 to keep you on the 最新 版本.
    
  

  
    ```bash  主题={空}
    brew 安装 --cask claude-代码
    ```

    
      Homebrew 安装s do not auto-更新. 运行 `brew 升级 claude-代码` 期间ic所有y to get the 最新 features and 安全 修复es.
    
  

  
    ```权力命令行  主题={空}
    WinGet 安装 Anthropic.Clau解码
    ```

    
      WinGet 安装s do not auto-更新. 运行 `WinGet 升级 Anthropic.Clau解码` 期间ic所有y to get the 最新 features and 安全 修复es.
    
  

##步骤 2: 日志 in to your 说明

Claude 代码 requ怒s an 说明 to 使用. When you 启动 an 交互 会话 with the `claude` 命令, you'll 需要 to 日志 in:

```bash  主题={空}
claude
# You'll be 及时ed to 日志 in on 第一个 使用
```

```bash  主题={空}
/日志in
# Fol低 the 及时s to 日志 in with your 说明
```

You can 日志 in using 任何 of these 说明 类型s:

* [Claude Pro, Max, 团队, or 企业](https://claude.com/pricing?utm_来源=claude_代码\&utm_中=docs\&utm_满意=快速入门_日志in) (推荐)
* [Claude 控制台](https://控制台.anthropic.com/) (API access with pre-支付 鸣谢). On 第一个 日志in, a "Claude 代码" 工作区 is 自动所有y 创建d in the 控制台 for 集中 成本 跟踪ing.
* [Amazon 基岩, 前往ogle Vertex AI, or Micro软 Foun干](/en/third-部分y-集成s) (企业 云 提供者s)

Once 日志ged in, your credentials are 存储 and you 获胜't 需要 to 日志 in a收益. To switch 说明s 更晚, 使用 the `/日志in` 命令.

##步骤 3: 启动 your 第一个 会话

打开 your 终端 in 任何 项目 目录 and 启动 Claude 代码:

```bash  主题={空}
cd /路径/to/your/项目
claude
```

You'll看见 the Claude 代码 welcome screen with your 会话 信息, 最近 对话s, and 最新 更新s. 类型 `/帮助` for 可用 命令 or `/恢复` to 继续 a 之前 对话.

  之后日志 in (步骤 2), your credentials are 存储 on your 系统. Learn 更多 in [Credential 管理](/en/认证#credential-管理).

##步骤 4: Ask your 第一个 问题

Let's 启动 with 理解 your 代码基础. 尝试 one of these 命令:

```文本  主题={空}
what does this 项目 do?
```

Claude will分析 your 文件 and provide a 摘要. You can also ask 更多 特定 问题s:

```文本  主题={空}
what techno日志ies does this 项目 使用?
```

```文本  主题={空}
where is the 主 条目 point?
```

```文本  主题={空}
ex简单 the 文件夹 结构
```

You can also ask Claude about its own 能力:

```文本  主题={空}
what can Claude 代码 do?
```

```文本  主题={空}
how do I 创建 习俗 技能 in Claude 代码?
```

```文本  主题={空}
can Claude 代码 工作 with Docker?
```

  Claude 代码 读取s your 项目 文件 as 需要ed. You don't have to 手册ly 添加 上下文.

##步骤 5: Make your 第一个 代码 更改

Now let's make Claude 代码 do 一些 实际 coding. 尝试 a 简单 任务:

```文本  主题={空}
添加 a hello world 功能 to the 主 文件
```

Claude 代码 will:

1. 查找 the 恰当 文件
2. 显示 you the 支撑osed 更改s
3. Ask for your 批准
4. Make the 编辑

  Claude 代码 al方式s asks for 许可 之前修改 文件. You can 批准 个人 更改s or 启用 "接受 所有" 模式 for a 会话.

##步骤 6: 使用 Git with Claude 代码

Claude 代码 makes Git 运营 对话al:

```文本  主题={空}
what 文件 have I 更改d?
```

```文本  主题={空}
提交 my 更改s with a de脚本ive 消息
```

You can also 及时 for 更多 复杂 Git 运营:

```文本  主题={空}
创建 a 新 分支 c所有ed feature/快速入门
```

```文本  主题={空}
显示 me the 最后一个 5 提交s
```

```文本  主题={空}
帮助 me resolve 合并 conflicts
```

##步骤 7: 修复 a 缺陷 or 添加 a feature

Claude is 精通 at 调试ging and feature 实施.

Describe what you 想要 in 自然 language:

```文本  主题={空}
添加 输入 验证 to the 用户 regist比率n 形式
```

Or 修复 现有 问题s:

```文本  主题={空}
there's a 缺陷 where 用户s can submit 空 形式s - 修复 it
```

Claude 代码 will:

* Locate the 相关 代码
* Understand the 上下文
* 实现 a 解决
* 运行 测试s if 可用

##步骤 8: 测试 out other 通用工作流

There are a 数字 of 方式s to 工作 with Claude:

**Re事实or 代码**

```文本  主题={空}
re事实or the 认证 模块 to 使用 异步/等待 instead of 回调s
```

**写入 测试s**

```文本  主题={空}
写入 单位 测试s for the calculator 功能s
```

**更新 文档**

```文本  主题={空}
更新 the 读取ME with 安装 说明
```

**代码 re视图**

```文本  主题={空}
re视图 my 更改s and suggest 改善s
```

  Talk to Claude 像 you would a 有帮助 colleague. Describe what you 想要 to achieve, and it will 帮助 you get there.

## 必要 命令

Here are the 最多 重要 命令 for daily 使用:

| 命令             | What it does                                           | 示例                             |
| ------------------- | ------------------------------------------------------ | ----------------------------------- |
| `claude`            | 启动 交互 模式                                 | `claude`                            |
| `claude "任务"`     | 运行 a one-时间 任务                                    | `claude "修复 the 构建 错误"`      |
| `claude -p "查询"` | 运行 one-off 查询, then 退出                           | `claude -p "ex简单 this 功能"` |
| `claude -c`         | 继续 最多 最近 对话 in 当前 目录 | `claude -c`                         |
| `claude -r`         | 恢复 a 之前 对话                         | `claude -r`                         |
| `/清楚`            | 清楚 对话 history                             | `/清楚`                            |
| `/帮助`             | 显示 可用 命令                                | `/帮助`                             |
| `退出` or Ctrl+D    | 退出 Claude 代码                                       | `退出`                              |

看见 the [CLI 参考](/en/cli-参考) for a 完成 列表 of 命令.

## Pro 提示 for 初学者s

For 更多,看见 [最佳实践](/en/最佳-实践) and [通用工作流](/en/常见-工作流s).

  
    Instead of: "修复 the 缺陷"

    尝试: "修复 the 日志in 缺陷 where 用户s看见 a 空白 screen 之后进入 错误 credentials"
  

  
    Break 复杂 任务s into步骤s:

    ```文本  主题={空}
    1. 创建 a 新 数据库 表 for 用户 pro文件
    2. 创建 an API 结束point to get and 更新 用户 pro文件
    3. 构建 a 网页页 that 允许s 用户s to看见 and 编辑 their 信息
    ```
  

  
    之前制造 更改s, let Claude understand your 代码:

    ```文本  主题={空}
   分析 the 数据库 模式
    ```

    ```文本  主题={空}
    构建 a dash董事会显示 产品s that are 最多 频繁ly 返回 by our UK 习俗ers
    ```
  

  
    * Press `?` to看见 所有 可用 键董事会 短剪切s
    * 使用 Tab for 命令 completion
    * Press ↑ for 命令 history
    * 类型 `/` to看见 所有 命令 and 技能
  

## What's 下一个?

Now that you've 学习 the 基础s,探索 更多 先进 features:

  
    Understand the 代理ic loop, built-in 工具, and how Claude 代码 interacts with your 项目
  

  
    Get 更好 结果s with 有效 及时ing and 项目 设置
  

  
   步骤-by-步骤 指南s for 常见 任务s
  

  
    习俗ize with CLAUDE.md, 技能, 钩子, MCP, and 更多
  

## Getting 帮助

* **In Claude 代码**: 类型 `/帮助` or ask "how do I..."
* **文档**: You're here! 浏览 other 指南s
* **社区**: Join our [不和](https://www.anthropic.com/不和) for 提示 and 支持