fix json
This commit is contained in:
6
ai.json
6
ai.json
@ -372,9 +372,13 @@
|
||||
"text": "ai.botの一つの機能であるカードゲーム。現実とゲームの融合を目指して、atprotoのユーザーデータでカードを所有すること、リアルカードの送付などを目指して、ios appとして実装することを目指している。"
|
||||
},
|
||||
"api": {
|
||||
"type": [ "api" ],
|
||||
"type": "api",
|
||||
"text": "カードを引くことができるapi。現在はgolangのent(ogent)で実装しているが、mcp serverに移行したいと思っている。この際、ai.cardのprojectに統合されるかもしれない。"
|
||||
},
|
||||
"log": {
|
||||
"type": "blog",
|
||||
"text": "今はhugoでblogを作ってる。それをclaude codeでrustの静的ブログジェネレーターを作る。AI機能を付け加える。AI機能は具体的に記事の修正、情報の追加、lang:jaを自動翻訳してlang:en(page)を生成。アイが一言コメントするコメント欄の追加を行う。なお、コメント欄はatprotoと連携し、atprotoアカウントのoauthでログインして書き込める"
|
||||
},
|
||||
"verse": {
|
||||
"text": "現実とゲームを結びつけます。",
|
||||
"description": "現実をゲームに反映し、ゲームを現実に反映します。",
|
||||
|
327
md/claude_code_settings.md
Normal file
327
md/claude_code_settings.md
Normal file
@ -0,0 +1,327 @@
|
||||
# Claude Code settings
|
||||
|
||||
> Learn how to configure Claude Code with global and project-level settings, themes, and environment variables.
|
||||
|
||||
Claude Code offers a variety of settings to configure its behavior to meet your
|
||||
needs. You can configure Claude Code by running `claude config` in your
|
||||
terminal, or the `/config` command when using the interactive REPL.
|
||||
|
||||
## Configuration hierarchy
|
||||
|
||||
The new `settings.json` file is our official mechanism for configuring Claude
|
||||
Code through hierarchical settings:
|
||||
|
||||
* **User settings** are defined in `~/.claude/settings.json` and apply to all
|
||||
projects.
|
||||
* **Project settings** are saved in your project directory under
|
||||
`.claude/settings.json` for shared settings, and `.claude/settings.local.json`
|
||||
for local project settings. Claude Code will configure git to ignore
|
||||
`.claude/settings.local.json` when it is created.
|
||||
* For enterprise deployments of Claude Code, we also support **enterprise
|
||||
managed policy settings**. These take precedence over user and project
|
||||
settings. System administrators can deploy policies to
|
||||
`/Library/Application Support/ClaudeCode/policies.json` on macOS and
|
||||
`/etc/claude-code/policies.json` on Linux and Windows via WSL.
|
||||
|
||||
```JSON Example settings.json
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm run lint)",
|
||||
"Bash(npm run test:*)",
|
||||
"Read(~/.zshrc)"
|
||||
],
|
||||
"deny": [
|
||||
"Bash(curl:*)"
|
||||
]
|
||||
},
|
||||
"env": {
|
||||
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
|
||||
"OTEL_METRICS_EXPORTER": "otlp"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Available settings
|
||||
|
||||
`settings.json` supports a number of options:
|
||||
|
||||
| Key | Description | Example |
|
||||
| :-------------------- | :------------------------------------------------------------------------------------------------------- | :------------------------------ |
|
||||
| `apiKeyHelper` | Custom script to generate an Anthropic API key | `/bin/generate_temp_api_key.sh` |
|
||||
| `cleanupPeriodDays` | How long to locally retain chat transcripts (default: 30 days) | `20` |
|
||||
| `env` | Environment variables that will be applied to every session | `{"FOO": "bar"}` |
|
||||
| `includeCoAuthoredBy` | Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |
|
||||
|
||||
### Settings precedence
|
||||
|
||||
Settings are applied in order of precedence:
|
||||
|
||||
1. Enterprise policies
|
||||
2. Command line arguments
|
||||
3. Local project settings
|
||||
4. Shared project settings
|
||||
5. User settings
|
||||
|
||||
## Configuration options
|
||||
|
||||
Claude Code supports global and project-level configuration.
|
||||
|
||||
To manage your configurations, use the following commands:
|
||||
|
||||
* List settings: `claude config list`
|
||||
* See a setting: `claude config get <key>`
|
||||
* Change a setting: `claude config set <key> <value>`
|
||||
* Push to a setting (for lists): `claude config add <key> <value>`
|
||||
* Remove from a setting (for lists): `claude config remove <key> <value>`
|
||||
|
||||
By default `config` changes your project configuration. To manage your global
|
||||
configuration, use the `--global` (or `-g`) flag.
|
||||
|
||||
### Global configuration
|
||||
|
||||
To set a global configuration, use `claude config set -g <key> <value>`:
|
||||
|
||||
| Key | Description | Example |
|
||||
| :---------------------- | :--------------------------------------------------------------- | :------------------------------------------------------------------------- |
|
||||
| `autoUpdaterStatus` | Enable or disable the auto-updater (default: `enabled`) | `disabled` |
|
||||
| `preferredNotifChannel` | Where you want to receive notifications (default: `iterm2`) | `iterm2`, `iterm2_with_bell`, `terminal_bell`, or `notifications_disabled` |
|
||||
| `theme` | Color theme | `dark`, `light`, `light-daltonized`, or `dark-daltonized` |
|
||||
| `verbose` | Whether to show full bash and command outputs (default: `false`) | `true` |
|
||||
|
||||
We are in the process of migration global configuration to `settings.json`.
|
||||
|
||||
## Permissions
|
||||
|
||||
You can manage Claude Code's tool permissions with `/allowed-tools`. This UI
|
||||
lists all permission rules and the settings.json file they are sourced from.
|
||||
|
||||
* **Allow** rules will allow Claude Code to use the specified tool without
|
||||
further manual approval.
|
||||
* **Deny** rules will prevent Claude Code from using the specified tool. Deny
|
||||
rules take precedence over allow rules.
|
||||
|
||||
Permission rules use the format: `Tool(optional-specifier)`.
|
||||
|
||||
For example, adding `WebFetch` to the list of allow rules would allow any use of
|
||||
the web fetch tool without requiring user approval. See the list of
|
||||
[tools available to Claude](/en/docs/claude-code/security#tools-available-to-claude)
|
||||
(use the name in parentheses when provided.)
|
||||
|
||||
Some tools use the optional specifier for more fine-grained permission controls.
|
||||
For example, an allow rule with `WebFetch(domain:example.com)` would allow
|
||||
fetches to example.com but not other URLs.
|
||||
|
||||
Bash rules can be exact matches like `Bash(npm run build)`, or prefix matches
|
||||
when they end with `:*` like `Bash(npm run test:*)`
|
||||
|
||||
`Read()` and `Edit()` rules follow the
|
||||
[gitignore](https://git-scm.com/docs/gitignore) specification. Patterns are
|
||||
resolved relative to the directory containing `.claude/settings.json`. To
|
||||
reference an absolute path, use `//`. For a path relative to your home
|
||||
directory, use `~/`. For example `Read(//tmp/build_cache)` or `Edit(~/.zshrc)`.
|
||||
Claude will also make a best-effort attempt to apply Read and Edit rules to
|
||||
other file-related tools like Grep, Glob, and LS.
|
||||
|
||||
MCP tool names follow the format: `mcp__server_name__tool_name` where:
|
||||
|
||||
* `server_name` is the name of the MCP server as configured in Claude Code
|
||||
* `tool_name` is the specific tool provided by that server
|
||||
|
||||
More examples:
|
||||
|
||||
| Rule | Description |
|
||||
| :----------------------------------- | :--------------------------------------------------------------------------------------------------- |
|
||||
| `Bash(npm run build)` | Matches the exact Bash command `npm run build`. |
|
||||
| `Bash(npm run test:*)` | Matches Bash commands starting with `npm run test`. See note below about command separator handling. |
|
||||
| `Edit(~/.zshrc)` | Matches the `~/.zshrc` file. |
|
||||
| `Read(node_modules/**)` | Matches any `node_modules` directory. |
|
||||
| `mcp__puppeteer__puppeteer_navigate` | Matches the `puppeteer_navigate` tool from the `puppeteer` MCP server. |
|
||||
| `WebFetch(domain:example.com)` | Matches fetch requests to example.com |
|
||||
|
||||
<Tip>
|
||||
Claude Code is aware of command separators (like `&&`) so a prefix match rule
|
||||
like `Bash(safe-cmd:*)` won't give it permission to run the command `safe-cmd
|
||||
&& other-cmd`
|
||||
</Tip>
|
||||
|
||||
## Auto-updater permission options
|
||||
|
||||
When Claude Code detects that it doesn't have sufficient permissions to write to
|
||||
your global npm prefix directory (required for automatic updates), you'll see a
|
||||
warning that points to this documentation page. For detailed solutions to
|
||||
auto-updater issues, see the
|
||||
[troubleshooting guide](/en/docs/claude-code/troubleshooting#auto-updater-issues).
|
||||
|
||||
### Recommended: Create a new user-writable npm prefix
|
||||
|
||||
```bash
|
||||
# First, save a list of your existing global packages for later migration
|
||||
npm list -g --depth=0 > ~/npm-global-packages.txt
|
||||
|
||||
# Create a directory for your global packages
|
||||
mkdir -p ~/.npm-global
|
||||
|
||||
# Configure npm to use the new directory path
|
||||
npm config set prefix ~/.npm-global
|
||||
|
||||
# Note: Replace ~/.bashrc with ~/.zshrc, ~/.profile, or other appropriate file for your shell
|
||||
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
|
||||
|
||||
# Apply the new PATH setting
|
||||
source ~/.bashrc
|
||||
|
||||
# Now reinstall Claude Code in the new location
|
||||
npm install -g @anthropic-ai/claude-code
|
||||
|
||||
# Optional: Reinstall your previous global packages in the new location
|
||||
# Look at ~/npm-global-packages.txt and install packages you want to keep
|
||||
# npm install -g package1 package2 package3...
|
||||
```
|
||||
|
||||
**Why we recommend this option:**
|
||||
|
||||
* Avoids modifying system directory permissions
|
||||
* Creates a clean, dedicated location for your global npm packages
|
||||
* Follows security best practices
|
||||
|
||||
Since Claude Code is actively developing, we recommend setting up auto-updates
|
||||
using the recommended option above.
|
||||
|
||||
### Disabling the auto-updater
|
||||
|
||||
If you prefer to disable the auto-updater instead of fixing permissions, you can
|
||||
use:
|
||||
|
||||
```bash
|
||||
claude config set -g autoUpdaterStatus disabled
|
||||
```
|
||||
|
||||
## Optimize your terminal setup
|
||||
|
||||
Claude Code works best when your terminal is properly configured. Follow these
|
||||
guidelines to optimize your experience.
|
||||
|
||||
**Supported shells**:
|
||||
|
||||
* Bash
|
||||
* Zsh
|
||||
* Fish
|
||||
|
||||
### Themes and appearance
|
||||
|
||||
Claude cannot control the theme of your terminal. That's handled by your
|
||||
terminal application. You can match Claude Code's theme to your terminal during
|
||||
onboarding or any time via the `/config` command
|
||||
|
||||
### Line breaks
|
||||
|
||||
You have several options for entering linebreaks into Claude Code:
|
||||
|
||||
* **Quick escape**: Type `\` followed by Enter to create a newline
|
||||
* **Keyboard shortcut**: Press Option+Enter (Meta+Enter) with proper
|
||||
configuration
|
||||
|
||||
To set up Option+Enter in your terminal:
|
||||
|
||||
**For Mac Terminal.app:**
|
||||
|
||||
1. Open Settings → Profiles → Keyboard
|
||||
2. Check "Use Option as Meta Key"
|
||||
|
||||
**For iTerm2 and VSCode terminal:**
|
||||
|
||||
1. Open Settings → Profiles → Keys
|
||||
2. Under General, set Left/Right Option key to "Esc+"
|
||||
|
||||
**Tip for iTerm2 and VSCode users**: Run `/terminal-setup` within Claude Code to
|
||||
automatically configure Shift+Enter as a more intuitive alternative.
|
||||
|
||||
### Notification setup
|
||||
|
||||
Never miss when Claude completes a task with proper notification configuration:
|
||||
|
||||
#### Terminal bell notifications
|
||||
|
||||
Enable sound alerts when tasks complete:
|
||||
|
||||
```sh
|
||||
claude config set --global preferredNotifChannel terminal_bell
|
||||
```
|
||||
|
||||
**For macOS users**: Don't forget to enable notification permissions in System
|
||||
Settings → Notifications → \[Your Terminal App].
|
||||
|
||||
#### iTerm 2 system notifications
|
||||
|
||||
For iTerm 2 alerts when tasks complete:
|
||||
|
||||
1. Open iTerm 2 Preferences
|
||||
2. Navigate to Profiles → Terminal
|
||||
3. Enable "Silence bell" and Filter Alerts → "Send escape sequence-generated
|
||||
alerts"
|
||||
4. Set your preferred notification delay
|
||||
|
||||
Note that these notifications are specific to iTerm 2 and not available in the
|
||||
default macOS Terminal.
|
||||
|
||||
### Handling large inputs
|
||||
|
||||
When working with extensive code or long instructions:
|
||||
|
||||
* **Avoid direct pasting**: Claude Code may struggle with very long pasted
|
||||
content
|
||||
* **Use file-based workflows**: Write content to a file and ask Claude to read
|
||||
it
|
||||
* **Be aware of VS Code limitations**: The VS Code terminal is particularly
|
||||
prone to truncating long pastes
|
||||
|
||||
### Vim Mode
|
||||
|
||||
Claude Code supports a subset of Vim keybindings that can be enabled with `/vim`
|
||||
or configured via `/config`.
|
||||
|
||||
The supported subset includes:
|
||||
|
||||
* Mode switching: `Esc` (to NORMAL), `i`/`I`, `a`/`A`, `o`/`O` (to INSERT)
|
||||
* Navigation: `h`/`j`/`k`/`l`, `w`/`e`/`b`, `0`/`$`/`^`, `gg`/`G`
|
||||
* Editing: `x`, `dw`/`de`/`db`/`dd`/`D`, `cw`/`ce`/`cb`/`cc`/`C`, `.` (repeat)
|
||||
|
||||
## Environment variables
|
||||
|
||||
Claude Code supports the following environment variables to control its
|
||||
behavior:
|
||||
|
||||
<Note>
|
||||
All environment variables can also be configured in
|
||||
[`settings.json`](/en/docs/claude-code/settings#available-settings). This is
|
||||
useful as a way to automatically set environment variables for each session,
|
||||
or to roll out a set of environment variables for your whole team or
|
||||
organization.
|
||||
</Note>
|
||||
|
||||
| Variable | Purpose |
|
||||
| :----------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `ANTHROPIC_API_KEY` | API key, only when using the Claude SDK (for interactive usage, run `/login`) |
|
||||
| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` and `Proxy-Authorization` headers (the value you set here will be prefixed with `Bearer `) |
|
||||
| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers you want to add to the request (in `Name: Value` format) |
|
||||
| `ANTHROPIC_MODEL` | Name of custom model to use (see [Model Configuration](/en/docs/claude-code/bedrock-vertex-proxies#model-configuration)) |
|
||||
| `ANTHROPIC_SMALL_FAST_MODEL` | Name of [Haiku-class model for background tasks](/en/docs/claude-code/costs) |
|
||||
| `BASH_DEFAULT_TIMEOUT_MS` | Default timeout for long-running bash commands |
|
||||
| `BASH_MAX_TIMEOUT_MS` | Maximum timeout the model can set for long-running bash commands |
|
||||
| `BASH_MAX_OUTPUT_LENGTH` | Maximum number of characters in bash outputs before they are middle-truncated |
|
||||
| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval at which credentials should be refreshed (when using `apiKeyHelper`) |
|
||||
| `CLAUDE_CODE_USE_BEDROCK` | Use Bedrock (see [Bedrock & Vertex](/en/docs/claude-code/bedrock-vertex-proxies)) |
|
||||
| `CLAUDE_CODE_USE_VERTEX` | Use Vertex (see [Bedrock & Vertex](/en/docs/claude-code/bedrock-vertex-proxies)) |
|
||||
| `CLAUDE_CODE_SKIP_VERTEX_AUTH` | Skip Google authentication for Vertex (eg. when using a proxy) |
|
||||
| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |
|
||||
| `DISABLE_AUTOUPDATER` | Set to `1` to disable the automatic updater |
|
||||
| `DISABLE_BUG_COMMAND` | Set to `1` to disable the `/bug` command |
|
||||
| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |
|
||||
| `DISABLE_ERROR_REPORTING` | Set to `1` to opt out of Sentry error reporting |
|
||||
| `DISABLE_TELEMETRY` | Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) |
|
||||
| `HTTP_PROXY` | Specify HTTP proxy server for network connections |
|
||||
| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections |
|
||||
| `MAX_THINKING_TOKENS` | Force a thinking for the model budget |
|
||||
| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup |
|
||||
| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |
|
282
md/claude_code_settings_ja.md
Normal file
282
md/claude_code_settings_ja.md
Normal file
@ -0,0 +1,282 @@
|
||||
# Claude Code の設定
|
||||
|
||||
> Claude Code をグローバルおよびプロジェクトレベルの設定、テーマ、環境変数を使って構成する方法を学びましょう。
|
||||
|
||||
Claude Code は、ニーズに合わせて動作をカスタマイズするための様々な設定を提供しています。ターミナルで `claude config` を実行するか、対話型 REPL を使用する場合は `/config` コマンドを実行することで、Claude Code を構成できます。
|
||||
|
||||
## 構成階層
|
||||
|
||||
新しい `settings.json` ファイルは、階層的な設定を通して Claude Code を構成するための公式の仕組みです。
|
||||
|
||||
* **ユーザー設定** は `~/.claude/settings.json` に定義され、すべてのプロジェクトに適用されます。
|
||||
* **プロジェクト設定** は、プロジェクトディレクトリに保存されます。共有設定の場合は `.claude/settings.json`、ローカルプロジェクト設定の場合は `.claude/settings.local.json` に保存されます。 Claude Code は、`.claude/settings.local.json` が作成されると、git がそれを無視するように設定を行います。
|
||||
* Claude Code のエンタープライズ展開では、**エンタープライズ管理ポリシー設定** もサポートされています。これらはユーザー設定やプロジェクト設定よりも優先されます。システム管理者は、macOS では `/Library/Application Support/ClaudeCode/policies.json`、Linux および Windows では WSL 経由で `/etc/claude-code/policies.json` にポリシーを展開できます。
|
||||
|
||||
```JSON サンプル設定.json
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm run lint)",
|
||||
"Bash(npm run test:*)",
|
||||
"Read(~/.zshrc)"
|
||||
],
|
||||
"deny": [
|
||||
"Bash(curl:*)"
|
||||
]
|
||||
},
|
||||
"env": {
|
||||
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
|
||||
"OTEL_METRICS_EXPORTER": "otlp"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 利用可能な設定
|
||||
|
||||
`settings.json` はいくつかのオプションをサポートしています。
|
||||
|
||||
| キー | 説明 | 例 |
|
||||
| :-------------------- | :------------------------------------------------------------------------------------------------------ | :------------------------------ |
|
||||
| `apiKeyHelper` | Anthropic API キーを生成するカスタムスクリプト | `/bin/generate_temp_api_key.sh` |
|
||||
| `cleanupPeriodDays` | チャットのトランスクリプトをローカルに保持する期間(デフォルト: 30 日) | `20` |
|
||||
| `env` | すべてのセッションに適用される環境変数 | `{"FOO": "bar"}` |
|
||||
| `includeCoAuthoredBy` | Git コミットとプルリクエストに `co-authored-by Claude` の署名を含めるかどうか(デフォルト: `true`) | `false` |
|
||||
|
||||
### 設定の優先順位
|
||||
|
||||
設定は優先順位に従って適用されます。
|
||||
|
||||
1. エンタープライズポリシー
|
||||
2. コマンドライン引数
|
||||
3. ローカルプロジェクト設定
|
||||
4. 共有プロジェクト設定
|
||||
5. ユーザー設定
|
||||
|
||||
## 設定オプション
|
||||
|
||||
Claude Code は、グローバルおよびプロジェクトレベルの設定をサポートしています。
|
||||
|
||||
設定を管理するには、以下のコマンドを使用します。
|
||||
|
||||
* 設定を一覧表示する: `claude config list`
|
||||
* 設定を確認する: `claude config get <key>`
|
||||
* 設定を変更する: `claude config set <key> <value>`
|
||||
* 設定にプッシュする (リストの場合): `claude config add <key> <value>`
|
||||
* 設定から削除する (リストの場合): `claude config remove <key> <value>`
|
||||
|
||||
デフォルトでは、`config` はプロジェクトの設定を変更します。グローバル設定を管理するには、`--global` (または `-g`) フラグを使用します。
|
||||
|
||||
### グローバル設定
|
||||
|
||||
グローバル設定を設定するには、`claude config set -g <key> <value>` を使用します。
|
||||
|
||||
| キー | 説明 | 例 |
|
||||
| :---------------------- | :--------------------------------------------------------------- | :--------------------------------------------------------------------------- |
|
||||
| `autoUpdaterStatus` |自動更新の有効化/無効化 (デフォルト: `enabled`) | `disabled` |
|
||||
| `preferredNotifChannel` | 通知の受信先 (デフォルト: `iterm2`) | `iterm2`、`iterm2_with_bell`、`terminal_bell`、または `notifications_disabled` |
|
||||
| `theme` | カラーテーマ | `dark`、`light`、`light-daltonized`、または `dark-daltonized` |
|
||||
| `verbose` | bash およびコマンドの出力全体を表示するかどうか (デフォルト: `false`) | `true` |
|
||||
|
||||
現在、グローバル設定を `settings.json` に移行中です。
|
||||
|
||||
## 権限
|
||||
|
||||
Claude Code のツール権限は `/allowed-tools` で管理できます。この UI には、すべての権限ルールと、それらのルールの元となる settings.json ファイルの一覧が表示されます。
|
||||
|
||||
* **許可** ルールは、Claude Code が指定されたツールを手動での承認なしで使用できるようにします。
|
||||
* **拒否** ルールは、Claude Code が指定されたツールを使用できないようにします。拒否ルールは許可ルールよりも優先されます。
|
||||
|
||||
許可ルールは「ツール(オプションの指定子)」という形式を使用します。
|
||||
|
||||
例:
|
||||
|
||||
`WebFetch` を許可ルールのリストに追加すると、ユーザーの承認なしに Web フェッチツールの使用が許可されます。[Claude が利用できるツール](/en/docs/claude-code/security#tools-available-to-claude)のリストをご覧ください。(括弧内で提供されている場合は、その名前を使用してください。)
|
||||
|
||||
一部のツールでは、よりきめ細かい権限制御のためにオプション指定子を使用します。
|
||||
|
||||
例えば、`WebFetch(domain:example.com)` という許可ルールでは、example.com へのフェッチは許可されますが、他の URL へのフェッチは許可されません。
|
||||
|
||||
Bash ルールは、`Bash(npm run build)` のように完全一致、または `:*` で終わる `Bash(npm run test:*)` のように前方一致で指定できます。
|
||||
|
||||
`Read()` および `Edit()` ルールは、
|
||||
[gitignore](https://git-scm.com/docs/gitignore) 仕様に準拠しています。パターンは、`.claude/settings.json` を含むディレクトリを基準として解決されます。絶対パスを参照するには `//` を使用します。ホームディレクトリからの相対パスを参照するには `~/` を使用します。例: `Read(//tmp/build_cache)` または `Edit(~/.zshrc)`。
|
||||
Claude は、Grep、Glob、LS などの他のファイル関連ツールにも読み取りルールと編集ルールを適用しようとします。
|
||||
|
||||
MCP ツール名は `mcp__server_name__tool_name` という形式に従います。ここで:
|
||||
|
||||
* `server_name` は、Claude Code で設定された MCP サーバーの名前です。
|
||||
* `tool_name` は、そのサーバーが提供する特定のツールです。
|
||||
|
||||
その他の例:
|
||||
|
||||
| ルール | 説明 |
|
||||
| :----------------------------------- | :------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Bash(npm run build)` | Bash コマンド `npm run build` に完全に一致します。 |
|
||||
| `Bash(npm run test:*)` | `npm run test` で始まる Bash コマンドに一致します。コマンド区切り文字の処理については、以下の注記を参照してください。 |
|
||||
| `Edit(~/.zshrc)` | `~/.zshrc` ファイルと一致します。 |
|
||||
| `Read(node_modules/**)` | 任意の `node_modules` ディレクトリに一致します。 |
|
||||
| `mcp__puppeteer__puppeteer_navigate` | `puppeteer` MCP サーバーの `puppeteer_navigate` ツールに一致します。 |
|
||||
| `WebFetch(domain:example.com)` | example.com へのフェッチ要求に一致します。 |
|
||||
|
||||
<hint>
|
||||
Claude Code はコマンドセパレーター(`&&` など)を認識するため、`Bash(safe-cmd:*)` のようなプレフィックス一致ルールでは、`safe-cmd && other-cmd` コマンドの実行権限は付与されません。
|
||||
</hint>
|
||||
|
||||
## 自動アップデーターの権限オプション
|
||||
|
||||
Claude Code が、グローバル npm プレフィックスディレクトリへの書き込み権限(自動更新に必要)が不足していることを検出すると、このドキュメントページへのリンクを示す警告が表示されます。自動アップデーターに関する問題の詳細な解決策については、[トラブルシューティングガイド](/en/docs/claude-code/troubleshooting#auto-updater-issues) を参照してください。
|
||||
|
||||
### 推奨: ユーザーが書き込み可能な新しい npm プレフィックスを作成
|
||||
|
||||
```bash
|
||||
# まず、後で移行するために既存のグローバルパッケージのリストを保存します
|
||||
npm list -g --depth=0 > ~/npm-global-packages.txt
|
||||
|
||||
# グローバルパッケージ用のディレクトリを作成します
|
||||
mkdir -p ~/.npm-global
|
||||
|
||||
# 新しいディレクトリパスを使用するように npm を設定します
|
||||
npm config set prefix ~/.npm-global
|
||||
|
||||
# 注: ~/.bashrc を ~/.zshrc、~/.profile、またはお使いのシェルの適切なファイルに置き換えてください
|
||||
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
|
||||
|
||||
# 新しい PATH 設定を適用します
|
||||
source ~/.bashrc
|
||||
|
||||
# 新しい場所に Claude Code を再インストールします
|
||||
npm install -g @anthropic-ai/claude-code
|
||||
|
||||
# オプション: 新しい場所に以前のグローバルパッケージを再インストールします場所
|
||||
# ~/npm-global-packages.txt を確認し、保存しておきたいパッケージをインストールします。
|
||||
# npm install -g package1 package2 package3...
|
||||
```
|
||||
|
||||
**このオプションを推奨する理由:**
|
||||
|
||||
* システムディレクトリの権限変更を回避します。
|
||||
* グローバル npm パッケージ用のクリーンな専用ディレクトリを作成します。
|
||||
* セキュリティのベストプラクティスに従います。
|
||||
|
||||
Claude Code は現在も開発が続けられているため、上記の推奨オプションを使用して自動更新を設定することをお勧めします。
|
||||
|
||||
### 自動更新の無効化
|
||||
|
||||
権限を修正する代わりに自動更新を無効にしたい場合は、以下のコマンドを使用します。
|
||||
|
||||
```bash
|
||||
claude config set -g autoUpdaterStatus enabled
|
||||
```
|
||||
|
||||
## ターミナル設定の最適化
|
||||
|
||||
Claude Code は、ターミナルが適切に設定されている場合に最も効果的に動作します。エクスペリエンスを最適化するには、以下のガイドラインに従ってください。
|
||||
|
||||
**サポートされているシェル**:
|
||||
|
||||
* Bash
|
||||
* Zsh
|
||||
* Fish
|
||||
|
||||
### テーマと外観
|
||||
|
||||
Claude Code はターミナルのテーマを制御できません。これはターミナルアプリケーションによって制御されます。オンボーディング中、または `/config` コマンドを使用していつでも、Claude Code のテーマをターミナルに合わせて変更できます。
|
||||
|
||||
### 改行
|
||||
|
||||
Claude Code で改行を入力するには、いくつかの方法があります。
|
||||
|
||||
* **クイックエスケープ**: `\` と入力して Enter キーを押すと、改行が作成されます。
|
||||
* **キーボードショートカット**: 適切な設定で Option+Enter (Meta+Enter) キーを押します。
|
||||
|
||||
O を設定するにはターミナルで Option+Enter キーを使用します。
|
||||
|
||||
**Mac の Terminal.app の場合:**
|
||||
|
||||
1. 設定 → プロファイル → キーボード を開きます。
|
||||
2. 「Option キーをメタキーとして使用する」にチェックを入れます。
|
||||
|
||||
**iTerm2 および VSCode ターミナルの場合:**
|
||||
|
||||
1. 設定 → プロファイル → キー を開きます。
|
||||
2. 「一般」で、左右の Option キーを「Esc+」に設定します。
|
||||
|
||||
**iTerm2 および VSCode ユーザーへのヒント**: Claude Code 内で `/terminal-setup` を実行すると、Shift+Enter キーがより直感的な代替キーとして自動的に設定されます。
|
||||
|
||||
### 通知設定
|
||||
|
||||
Claude がタスクを完了したことを通知設定で見逃さないようにしましょう。
|
||||
|
||||
#### ターミナルベル通知
|
||||
|
||||
タスク完了時にサウンドアラートを有効にする:
|
||||
|
||||
```sh
|
||||
claude config set --global preferredNotifChannel terminal_bell
|
||||
```
|
||||
|
||||
**macOS ユーザーの場合**: システム設定 → 通知 → [ターミナルアプリ] で通知権限を有効にすることを忘れないでください。
|
||||
|
||||
#### iTerm 2 システム通知
|
||||
|
||||
タスク完了時の iTerm 2 アラートの設定:
|
||||
|
||||
1. iTerm 2 の環境設定を開きます。
|
||||
2. 「プロファイル」→「ターミナル」に移動します。
|
||||
3. 「ベルを消音」と「フィルターアラート」→「エスケープシーケンスで生成されたアラートを送信する」を有効にします。
|
||||
4. 通知の遅延を設定します。
|
||||
|
||||
これらの通知は iTerm 2 固有のものであり、macOS のデフォルトのターミナルでは利用できません。
|
||||
|
||||
### 大量の入力の処理
|
||||
|
||||
膨大なコードや長い命令を扱う場合:
|
||||
|
||||
* **直接貼り付けは避ける**: Claude Code は、非常に長い貼り付けコンテンツを処理するのに苦労する場合があります。
|
||||
* **ファイルベースのワークフローを使用する**: コンテンツをファイルに書き込んで、Claude に読み込ませます。
|
||||
* **VS Code の制限事項に注意してください**: VS Code ターミナルは、特に長い貼り付けコンテンツを切り捨ててしまう傾向があります。
|
||||
|
||||
### Vim モード
|
||||
|
||||
Claude Code は、`/vim` で有効化するか、`/config` で設定できる Vim キーバインドのサブセットをサポートしています。
|
||||
|
||||
サポートされているサブセットは次のとおりです。
|
||||
|
||||
* モード切り替え: `Esc` (NORMAL)、`i`/`I`、`a`/`A`、`o`/`O` (INSERT)
|
||||
* ナビゲーション: `h`/`j`/`k`/`l`、`w`/`e`/`b`、`0`/`$`/`^`、`gg`/`G`
|
||||
* 編集: `x`、`dw`/`de`/`db`/`dd`/`D`、`cw`/`ce`/`cb`/`cc`/`C`、`.` (繰り返し)
|
||||
|
||||
## 環境変数
|
||||
|
||||
Claude Code は、動作を制御するために以下の環境変数をサポートしています。
|
||||
|
||||
<note>
|
||||
すべての環境変数は、[`settings.json`](/en/docs/claude-code/settings#available-settings) でも設定できます。これは、各セッションの環境変数を自動的に設定したり、チーム全体または組織全体に環境変数のセットを展開したりするのに便利です。
|
||||
</note>
|
||||
|
||||
| 変数 | 目的 |
|
||||
| :----------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `ANTHROPIC_API_KEY` | API キー(Claude SDK 使用時のみ)(対話型で使用する場合は、`/login` を実行してください) |
|
||||
| `ANTHROPIC_AUTH_TOKEN` | `Authorization` ヘッダーと `Proxy-Authorization` ヘッダーのカスタム値(ここで設定した値には、`Bearer` というプレフィックスが付きます) |
|
||||
| `ANTHROPIC_CUSTOM_HEADERS` | リクエストに追加するカスタムヘッダー(`Name: Value` 形式) |
|
||||
| `ANTHROPIC_MODEL` |使用するカスタム モデルの名前 ([モデル構成](/en/docs/claude-code/bedrock-vertex-proxies#model-configuration) を参照) |
|
||||
| `ANTHROPIC_SMALL_FAST_MODEL` | [バックグラウンド タスク用の Haiku クラス モデル](/en/docs/claude-code/costs) の名前 |
|
||||
| `BASH_DEFAULT_TIMEOUT_MS` | 長時間実行される bash コマンドのデフォルトのタイムアウト |
|
||||
| `BASH_MAX_TIMEOUT_MS` | 長時間実行される bash コマンドに対してモデルが設定できる最大タイムアウト |
|
||||
| `BASH_MAX_OUTPUT_LENGTH` | bash 出力で途中で切り捨てられるまでの文字数の最大数 |
|
||||
| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | 認証情報を更新する間隔 (`apiKeyHelper` を使用する場合) |
|
||||
| `CLAUDE_CODE_USE_BEDROCK` | Bedrock を使用します ([Bedrock & Vertex](/en/docs/claude-code/bedrock-vertex-proxies) を参照) |
|
||||
| `CLAUDE_CODE_USE_VERTEX` | Vertex を使用します ([Bedrock & Vertex](/en/docs/claude-code/bedrock-vertex-proxies) を参照) |
|
||||
| `CLAUDE_CODE_SKIP_VERTEX_AUTH` | Vertex の Google 認証をスキップします (例: プロキシを使用している場合) |
|
||||
| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | `DISABLE_AUTOUPDATER` の設定と同等`DISABLE_BUG_COMMAND`、`DISABLE_ERROR_REPORTING`、および `DISABLE_TELEMETRY` |
|
||||
| `DISABLE_AUTOUPDATER` | 自動アップデーターを無効にするには `1` に設定します |
|
||||
| `DISABLE_BUG_COMMAND` | `/bug` コマンドを無効にするには `1` に設定します |
|
||||
| `DISABLE_COST_WARNINGS` | コスト警告メッセージを無効にするには `1` に設定します |
|
||||
| `DISABLE_ERROR_REPORTING` | Sentry エラー報告をオプトアウトするには `1` に設定します |
|
||||
| `DISABLE_TELEMETRY` | Statsig テレメトリをオプトアウトするには `1` に設定します (Statsig イベントには、コード、ファイル パス、bash コマンドなどのユーザー データは含まれません) |
|
||||
| `HTTP_PROXY` | ネットワーク接続用の HTTP プロキシ サーバーを指定します |
|
||||
| `HTTPS_PROXY` | ネットワーク接続用の HTTPS プロキシ サーバーを指定します |
|
||||
| `MAX_THINKING_TOKENS` | モデル バジェットの考慮を強制します |
|
||||
| `MCP_TIMEOUT` | MCP サーバー起動のタイムアウト (ミリ秒) |
|
||||
| `MCP_TOOL_TIMEOUT` | MCP ツール実行のタイムアウト (ミリ秒) |
|
||||
|
Reference in New Issue
Block a user