Jump to content

Claude Code: Difference between revisions

From Wiki
Marcluer (talk | contribs)
Marcluer (talk | contribs)
mNo edit summary
Line 27: Line 27:
claude --version
claude --version
</pre>
</pre>
== Memory ==
{| class="wikitable"
|+
!
!file
|-
|Project memory
|<code>./CLAUDE.md</code>
|-
|User memory
|<code>~/.claude/CLAUDE.md</code>
|-
|Local project memory
|<code>./CLAUDE.local.md</code>
|}
== Sub agents ==
{| class="wikitable"
|+
!
!file
|-
|User sub agents
|<code>~/.claude/agents/</code>
|-
|Project sub agents
|<code>.claude/agents/</code>
|}
== Custom commands ==
{| class="wikitable"
|+
!
!file
|-
|User commands
|<code>~/.claude/commands/</code>
|-
|Project commands
|<code>.claude/commands/</code>
|}


== settings.json ==
== settings.json ==
Line 62: Line 106:
</blockquote>
</blockquote>


Hook example:
<blockquote>
<pre>
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/prompt-validator.py"
          }
        ]
      }
    ]
  }
</pre>
</blockquote>


== Sub agent configuration ==
{| class="wikitable"
|+
!
!file
|-
|User sub agents
|<code>~/.claude/agents/</code>
|-
|Project sub agents
|<code>.claude/agents/</code>
|}


== Command line options ==
== Command line options ==

Revision as of 12:16, 31 July 2025

Other articles

Installation on Ubuntu (WSL2)

sudo apt install npm

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

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

which claude
claude doctor
claude --version

Memory

file
Project memory ./CLAUDE.md
User memory ~/.claude/CLAUDE.md
Local project memory ./CLAUDE.local.md

Sub agents

file
User sub agents ~/.claude/agents/
Project sub agents .claude/agents/

Custom commands

file
User commands ~/.claude/commands/
Project commands .claude/commands/


settings.json

file scope
User settings ~/.claude/settings.json
Project settings .claude/settings.json all users
Project settings .claude/settings.local.json local/personal only

Example:

{
  "permissions": {
    "allow": [
      "Bash(ls:*)"
    ],
    "deny": []
  }
}

Hook example:

  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/prompt-validator.py"
          }
        ]
      }
    ]
  }


Command line options

claude                                   # interactive mode
claude "task"                            # run single task
claude -p "task"                         # run single task, print response, exit
claude --dangerously-skip-permissions

claude config list
claude mcp list
claude doctor
claude update

Learning Videos

Description Channel URL
1. Basics Matt Maher https://www.youtube.com/watch?v=T_IYHx-9VGU
2. Best practices Matt Maher https://www.youtube.com/watch?v=IUi--nVU4yA
H Hooks IndyDevDan https://www.youtube.com/watch?v=J5B9UGTuNoM
H Hooks 2 IndyDevDan https://www.youtube.com/watch?v=9ijnN985O_c
IndyDevDan https://github.com/disler/claude-code-hooks-mastery
S Sub agents Matt Maher https://www.youtube.com/watch?v=6MLyc3jYisQ
S Sub agents IndyDevDan https://www.youtube.com/watch?v=7B2HJr0Y68g