#Claude cli

1 messages · Page 1 of 1 (latest)

sullen bluff
#

--dangerously-skip-permissions cannot be used with root/sudo privileges

last heartBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

boreal escarpBOT
#

That error is intentional. Claude Code won’t allow --dangerously-skip-permissions while running as root/via sudo, because that flag bypasses permission prompts and safety checks. Anthropic documents it as bypassPermissions mode and says to use it only in isolated environments like containers/VMs/devcontainers. (code.claude.com)

Fix is not to sudo harder — run Claude as a normal unprivileged user:

# bad
sudo claude --dangerously-skip-permissions

# good
claude --dangerously-skip-permissions

If this is on a VPS/container, create/use a non-root user, mount only the project directory, and run Claude there. If you just want fewer prompts, Claude’s newer auto/sandbox modes are safer than full bypass. (anthropic.com)

Claude Code Docs

Control whether Claude asks before editing files or running commands. Cycle modes with Shift+Tab in the CLI or use the mode selector in VS Code, Desktop, and claude.ai.

Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems.

sullen bluff
#

Comment changer ça car j'utilsie le cli dans openclaw et sa me dit c comme erreur

boreal escarpBOT
#

Oui — dans OpenClaw, ne mets pas sudo/root avec Claude CLI.

À faire :

  1. VĂ©rifie d’abord ta version :
openclaw --version
  1. Si tu as configuré/écrit une commande Claude comme ça :
claude --dangerously-skip-permissions ...

remplace par :

#
claude --permission-mode bypassPermissions --print "ta tĂąche"
  1. Si l’erreur vient du gateway OpenClaw, vĂ©rifie qu’il ne tourne pas en root :
openclaw gateway status
openclaw status --all
  1. Si tu as mis des args custom dans ~/.openclaw/openclaw.json, cherche une config du genre :
agents: {
  defaults: {
    cliBackends: {
      "claude-cli": {
sullen bluff
#

"anthropic:claude-cli": {
"provider": "claude-cli",
"mode": "oauth"
}
}

#

"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {},
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]

boreal escarpBOT
#

Ce bloc est OK — c’est juste le profil d’auth Claude CLI. Ce n’est pas lui qui cause l’erreur.

L’erreur vient plutît de l’un de ces deux cas :

  1. OpenClaw/Gateway tourne en root ou via sudo
    → Claude refuse le mode bypass en root.

  2. OpenClaw est en mode YOLO exec
    (tools.exec.security: "full" + tools.exec.ask: "off")
    → OpenClaw ajoute --permission-mode bypassPermissions pour Claude CLI.

À vĂ©rifier :

openclaw --version
openclaw gateway status
#
openclaw status --all

Et surtout : ne lance pas OpenClaw comme ça :

sudo openclaw gateway start
sudo openclaw ...

Lance-le avec ton utilisateur normal.

Si tu veux désactiver le bypass Claude, ajoute/force plutÎt un mode plus safe dans ~/.openclaw/openclaw.json :

#

Mais avant de modifier, envoie openclaw --version + openclaw gateway status, parce que si ton gateway tourne en root, c’est ça qu’il faut corriger en premier.

#

Voilà, on a trouvé le problÚme :

"workspace": "/root/.openclaw/workspace"

Ça veut dire que ton OpenClaw tourne/configure Claude CLI depuis root. Claude refuse le bypass permissions en root, donc l’erreur est normale.

Corrige comme ça :

  1. Ne lance pas OpenClaw avec sudo
  2. Utilise un utilisateur normal, pas root
  3. Mets le workspace hors de /root, par exemple :
"workspace": "/home/TON_USER/.openclaw/workspace"
#

Ou supprime carrément la ligne workspace pour laisser OpenClaw utiliser le défaut de ton utilisateur.

Sur un VPS oĂč tu es connectĂ© en root, fais plutĂŽt :

adduser openclaw
su - openclaw

Puis réinstalle/configure OpenClaw + Claude CLI depuis cet utilisateur normal.

AprÚs ça :

claude auth login
openclaw models auth login --provider anthropic --method cli --set-default
sullen bluff
#

c'est que openclaw je l'ai installer sur root

boreal escarpBOT
#

Oui, c’est exactement la cause.

Claude CLI + bypass permissions ne peut pas tourner en root. Donc avec OpenClaw installé sous /root, tu vas continuer à avoir cette erreur.

Le fix propre :

  1. Crée/utilise un utilisateur normal sur ton VPS, par ex. openclaw
  2. Connecte-toi avec cet utilisateur
  3. Réinstalle OpenClaw + Claude CLI dans ce compte
  4. Relance l’onboarding/auth Claude CLI depuis ce compte

Exemple du flow :

# en root, créer un user normal
adduser openclaw
#

# passer sur ce user
su - openclaw

Puis dans ce user, refaire l’install OpenClaw, puis :

claude auth login
claude auth status --text
openclaw models auth login --provider anthropic --method cli --set-default
openclaw gateway start

Et dans ta config, le workspace ne doit plus ĂȘtre :

sullen bluff
#

Il y a pas une autre facon sans tout modif?

boreal escarpBOT
#

Oui, il y a un workaround sans tout réinstaller : rester en root, mais désactiver le mode bypass/YOLO.

Dans /root/.openclaw/openclaw.json, ajoute au niveau racine :

"tools": {
  "exec": {
    "ask": "on-miss"
  }
}

Si tu as déjà un bloc tools.exec, change juste :

"ask": "off"
#

en :

"ask": "on-miss"

Puis redémarre :

openclaw gateway restart

Ça Ă©vite qu’OpenClaw ajoute --permission-mode bypassPermissions, donc Claude CLI ne devrait plus bloquer Ă  cause de root.

⚠ Compromis : Claude/OpenClaw sera moins “auto full power” et pourra demander des validations. Si tu veux le mode bypass complet, lĂ  non : Claude le bloque en root, il faut un utilisateur non-root.

Docs : https://docs.openclaw.ai/gateway/cli-backends

sullen bluff
#

je le met ou

boreal escarpBOT
#

Dans ton fichier config :

nano /root/.openclaw/openclaw.json

Mets le bloc au mĂȘme niveau que agents, pas dedans :

{
  "agents": {
    "defaults": {
      ...
    }
  },
#
  "tools": {
    "exec": {
      "ask": "on-miss"
    }
  }
}

Si tu as déjà "tools" dans le fichier, ne le duplique pas : ajoute juste "exec" dedans.

Puis :

openclaw gateway restart
sullen bluff
#

"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}

  "model": {
    "primary": "claude-cli/claude-opus-4-7",
    "fallbacks": [
      "claude-cli/claude-sonnet-4-6",
      "claude-cli/claude-opus-4-6",
      "claude-cli/claude-opus-4-5",
      "claude-cli/claude-sonnet-4-5",
      "claude-cli/claude-haiku-4-5"
    ]
  }
},
boreal escarpBOT
#

LĂ  tu l’as mis au mauvais endroit : tu l’as mis au milieu de agents.defaults, avant "model". Il faut le dĂ©placer tout en bas, au mĂȘme niveau que "agents".

Structure correcte :

{
  "agents": {
    "defaults": {
      "workspace": "/root/.openclaw/workspace",

      "models": {
        "claude-cli/claude-opus-4-7": {},
        "claude-cli/claude-sonnet-4-6": {},
        "claude-cli/claude-opus-4-6": {},
        "claude-cli/claude-opus-4-5": {},
        "claude-cli/claude-sonnet-4-5": {},
#
        "claude-cli/claude-haiku-4-5": {}
      },

      "model": {
        "primary": "claude-cli/claude-opus-4-7",
        "fallbacks": [
          "claude-cli/claude-sonnet-4-6",
          "claude-cli/claude-opus-4-6",
          "claude-cli/claude-opus-4-5",
          "claude-cli/claude-sonnet-4-5",
          "claude-cli/claude-haiku-4-5"
        ]
      }
    }
  },
#

  "tools": {
    "exec": {
      "ask": "on-miss"
    }
  }
}

Important : "tools" est aprĂšs la fermeture complĂšte de "agents".

Ensuite :

openclaw gateway restart
sullen bluff
#

"tools": {
"exec": {
"ask": "on-miss"
}
}
}

boreal escarpBOT
#

Oui, ce bloc est bon si tu l’as mis tout Ă  la fin du fichier, au mĂȘme niveau que "agents".

Il faut juste vérifier la virgule avant "tools" :

{
  "agents": {
    ...
  },

  "tools": {
    "exec": {
      "ask": "on-miss"
    }
  }
}
#

Donc :

  • aprĂšs le } qui ferme "agents" → il faut une virgule ,
  • aprĂšs le dernier bloc "tools" → pas de virgule finale

Ensuite lance :

openclaw doctor
openclaw gateway restart

Si doctor ne signale pas d’erreur de JSON/config, c’est bon.

sullen bluff
#

{
"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {},
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]
}
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
},
"list": [
{
"id": "main",
"tools": {
etc

boreal escarpBOT
#

Presque — là tu as mis "tools" dans "agents", et "list" se retrouve dehors. Il faut cette forme :

{
  "agents": {
    "defaults": {
      "workspace": "/root/.openclaw/workspace",
      "models": {
        "claude-cli/claude-opus-4-7": {},
        "claude-cli/claude-sonnet-4-6": {}
      },
      "model": {
        "primary": "claude-cli/claude-opus-4-7",
        "fallbacks": [
          "claude-cli/claude-sonnet-4-6"
        ]
#
      }
    },

    "list": [
      {
        "id": "main"
      }
    ]
  },

  "tools": {
    "exec": {
      "ask": "on-miss"
    }
  }
#
}

Donc :

  • "defaults" et "list" sont dans "agents"
  • "tools" est en dehors de "agents"

⚠ Si dans agents.list[0].tools.exec tu as aussi "ask": "off", ça override le global. Mets-le aussi en "on-miss" ou supprime ce bloc.

Puis :

openclaw doctor
openclaw gateway restart
sullen bluff
#

la je modif quoi:
{
"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {},
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]
}
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
},
"list": [
{
"id": "main",
"tools": {
"elevated": {
"enabled": true,
"allowFrom": {
"telegram": [
"IDD "
]
}
}
}
}
]
},

boreal escarpBOT
#

Modifie juste l’emplacement de "tools".

Actuellement tu as mis "tools" dans "agents". Il faut que "tools" soit aprĂšs tout le bloc "agents".

Fais comme ça :

{
  "agents": {
    "defaults": {
      "workspace": "/root/.openclaw/workspace",
      "models": {
        "claude-cli/claude-opus-4-7": {},
        "claude-cli/claude-sonnet-4-6": {},
        "claude-cli/claude-opus-4-6": {},
        "claude-cli/claude-opus-4-5": {},
#
        "claude-cli/claude-sonnet-4-5": {},
        "claude-cli/claude-haiku-4-5": {}
      },
      "model": {
        "primary": "claude-cli/claude-opus-4-7",
        "fallbacks": [
          "claude-cli/claude-sonnet-4-6",
          "claude-cli/claude-opus-4-6",
          "claude-cli/claude-opus-4-5",
          "claude-cli/claude-sonnet-4-5",
          "claude-cli/claude-haiku-4-5"
        ]
      }
    },
#
    "list": [
      {
        "id": "main",
        "tools": {
          "elevated": {
            "enabled": true,
            "allowFrom": {
              "telegram": ["IDD "]
            }
          }
        }
      }
    ]
  },
#
  "tools": {
    "exec": {
      "ask": "on-miss"
    }
  }
}

Résumé :

  • "defaults" ✅ dans "agents"
  • "list" ✅ dans "agents"
  • "tools": { "exec": ... } ✅ en dehors de "agents"

AprĂšs sauvegarde :

#
openclaw doctor
openclaw gateway restart
sullen bluff
#

Failed to read config at /root/.openclaw/openclaw.json SyntaxError: JSON5: invalid character '"' at 46:3
at syntaxError (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1110:17)
at invalidChar (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1055:12)
at Object.end (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:704:15)
at Object.default (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:168:37)
at lex (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js💯42)
at Object.parse (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:25:17)
at Object.loadConfig (file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19023:24)
at file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19571:56
at loadPinnedRuntimeConfig (file:///usr/lib/node_modules/openclaw/dist/runtime-snapshot-C5PRsFS9.js:67:17)
at loadConfig (file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19571:9) {
lineNumber: 46,
columnNumber: 3

boreal escarpBOT
#

L’erreur dit : ligne 46, colonne 3 → tu as sĂ»rement fermĂ© } trop tĂŽt, puis "tools" arrive hors du JSON.

Fais afficher les lignes autour :

nl -ba /root/.openclaw/openclaw.json | sed -n '38,52p'

À corriger : avant "tools", tu dois avoir :

  }
},
"tools": {

et pas :

#
  }
}
"tools": {

En gros il faut une virgule entre la fin de agents et tools :

{
  "agents": {
    ...
  },

  "tools": {
    "exec": {
#
      "ask": "on-miss"
    }
  }
}

Ouvre direct Ă  la ligne 46 :

nano +46 /root/.openclaw/openclaw.json

Puis reteste :

#
openclaw doctor
sullen bluff
#

Failed to read config at /root/.openclaw/openclaw.json SyntaxError: JSON5: invalid character ',' at 40:4
at syntaxError (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1110:17)
at invalidChar (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1055:12)
at Object.end (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:704:15)
at Object.default (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:168:37)
at lex (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js💯42)
at Object.parse (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:25:17)
at Object.loadConfig (file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19023:24)
at file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19571:56
at loadPinnedRuntimeConfig (file:///usr/lib/node_modules/openclaw/dist/runtime-snapshot-C5PRsFS9.js:67:17)
at loadConfig (file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19571:9) {
lineNumber: 40,
columnNumber: 4
}

boreal escarpBOT
#

La virgule est au mauvais endroit : tu as probablement fermĂ© le JSON complet avant d’ajouter la virgule.

Fais ça pour qu’on voie exactement :

nl -ba /root/.openclaw/openclaw.json | sed -n '34,46p'

Mais la forme doit ĂȘtre exactement :

{
  "agents": {
    "defaults": {
      ...
    },
#
    "list": [
      ...
    ]
  },

  "tools": {
    "exec": {
      "ask": "on-miss"
    }
  }
}

Important :

  • aprĂšs "defaults": { ... } → virgule, car "list" suit
  • aprĂšs "list": [ ... ] → pas forcĂ©ment de virgule si c’est le dernier dans agents
#
  • aprĂšs le bloc "agents" → virgule, car "tools" suit
  • aprĂšs le dernier } du fichier → pas de virgule

Envoie les lignes 34–46 si tu veux, je te dis exactement quelle virgule enlever/dĂ©placer.

sullen bluff
#

34 }
35 }
36 }
37 }
38 ]
39 }
40 },
41 "tools": {
42 "exec": {
43 "ask": "on-miss"
44 }
45 }
46 }

boreal escarpBOT
#

Tu es tout proche. LĂ , ligne 40 est en trop.

Remplace :

38      ]
39  }
40    },
41    "tools": {

par :

38      ]
39    },
#
40    "tools": {

Donc concrĂštement :

  • supprime l’ancien ligne 40
  • mets la virgule directement aprĂšs le } de la ligne 39

La fin doit ressembler à ça :

      ]
    },

    "tools": {
      "exec": {
#
        "ask": "on-miss"
      }
    }
  }

Puis teste :

openclaw doctor

Si ça passe, fais :

#
openclaw gateway restart
sullen bluff
#

1 {
2 "agents": {
3 "defaults": {
4 "workspace": "/root/.openclaw/workspace",
5 "models": {
6 "claude-cli/claude-opus-4-7": {},
7 "claude-cli/claude-sonnet-4-6": {},
8 "claude-cli/claude-opus-4-6": {},
9 "claude-cli/claude-opus-4-5": {},
10 "claude-cli/claude-sonnet-4-5": {},
11 "claude-cli/claude-haiku-4-5": {}
12 },
13 "model": {
14 "primary": "claude-cli/claude-opus-4-7",
15 "fallbacks": [
16 "claude-cli/claude-sonnet-4-6",
17 "claude-cli/claude-opus-4-6",
18 "claude-cli/claude-opus-4-5",
19 "claude-cli/claude-sonnet-4-5",
20 "claude-cli/claude-haiku-4-5"
21 ]
22 }
23 },
24 "list": [
25 {
26 "id": "main",
27 "tools": {
28 "elevated": {
29 "enabled": true,
30 "allowFrom": {
31 "telegram": [
32 "ID"
33 ]
34 }
35 }
36 }
37 }
38 ]
39 },
40 "tools": {
41 "exec": {
42 "ask": "on-miss"
43 }
44 }
45 },
46 "gateway": {

boreal escarpBOT
#

Là c’est clair : ligne 45 ferme le fichier trop tît.

Comme tu as encore "gateway" aprĂšs, il faut remplacer la ligne 45 :

  },

par juste :

  },

Mais attention au niveau : la ligne 45 doit ĂȘtre une virgule aprĂšs le bloc tools, pas la fermeture finale du fichier.

La zone doit ĂȘtre :

#
  "tools": {
    "exec": {
      "ask": "on-miss"
    }
  },

  "gateway": {

Donc concrùtement lignes 40–46 :

  "tools": {
    "exec": {
      "ask": "on-miss"
#
    }
  },

  "gateway": {

Pas de } supplémentaire entre tools et gateway.

AprÚs ça, reteste :

openclaw doctor
sullen bluff
#

"tools": {
"exec": {
"ask": "on-miss"
}
},

boreal escarpBOT
#

Oui, ça c’est bon si "gateway" vient juste aprùs :

"tools": {
  "exec": {
    "ask": "on-miss"
  }
},

"gateway": {
  ...
}

Ensuite lance :

#
openclaw doctor

S’il ne se plaint plus de JSON, fais :

openclaw gateway restart

Petit dĂ©tail : si gateway est le dernier gros bloc du fichier, lui n’aura probablement pas de virgule aprĂšs sa fermeture finale.

sullen bluff
#

10:17:09+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=claude-cli model=opus promptChars=570
10:17:09+00:00 warn model-fallback/decision {"subsystem":"model-fallback/decision"} {"event":"model_fallback_decision","tags":["error_handling","model_fallback","candidate_failed"],"runId":"97d012d4-dd4f-4cb8-898d-b96f9efd1017","decision":"candidate_failed","requestedProvider":"claude-cli","requestedModel":"claude-sonnet-4-6","candidateProvider":"claude-cli","candidateModel":"claude-opus-4-7","attempt":6,"total":6,"reason":"unknown","errorPreview":"--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons","errorHash":"sha256:6619d78f7672","isPrimary":false,"requestedModelMatched":false,"fallbackConfigured":true} model fallback decision
10:17:09+00:00 error Embedded agent failed before reply: All models failed (6): claude-cli/claude-sonnet-4-6: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-opus-4-6: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-opus-4-5: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-sonnet-4-5: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-haiku-4-5: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-opus-4-7: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons
10:17:10+00:00 info gateway/channels/telegram {"subsystem":"gateway/channels/telegram"} telegram sendMessage ok chat=6484485569 message=3149
root@ubuntu-32gb-hel1-2-ai:~#

boreal escarpBOT
#

Ta config est maintenant lue, donc le JSON est mieux 👍
Mais OpenClaw lance encore Claude en mode bypass. Fais ça avec openclaw config set plutÎt que modifier à la main :

openclaw config set tools.exec.ask on-miss
openclaw config set agents.list[0].tools.exec.ask on-miss
openclaw config validate
openclaw gateway restart

Puis teste.

Si ça Ă©choue encore, vĂ©rifie s’il reste le vieux flag quelque part :

grep -R "dangerously-skip-permissions" -n /root/.openclaw ~/.claude 2>/dev/null
#
openclaw --version

Envoie le rĂ©sultat de ces deux commandes si ça bloque encore. LĂ , soit un override agent garde ask: off, soit ta version OpenClaw utilise encore l’ancien flag.

sullen bluff
#

/root/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-4eca5026e977/dist/extensions/anthropic/cli-shared.js:44:const CLAUDE_LEGACY_SKIP_PERMISSIONS_ARG = "--dangerously-skip-permissions";
/root/.claude/cache/changelog.md:1618:- Fixed MCP servers from .mcp.json not loading when using --dangerously-skip-permissions
/root/.claude/cache/changelog.md:1890:- Fixed hooks and plugins not executing when using --dangerously-skip-permissions flag
/root/.claude/cache/changelog.md:2529:- Fixed a bug where --dangerously-skip-permissions sometimes didn't work in --print mode
root@ubuntu-32gb-hel1-2-ai:~#

boreal escarpBOT
#

Ces rĂ©sultats grep sont normaux — ce n’est pas ta config qui contient le flag. LĂ  il faut forcer Claude CLI Ă  ne pas utiliser le mode bypass.

Lance ces commandes, ça évite de modifier le JSON à la main :

openclaw config set tools.exec.ask on-miss
openclaw config set agents.list[0].tools.exec.ask on-miss

openclaw config set agents.defaults.cliBackends.claude-cli.args '["-p","--output-format","stream-json","--include-partial-messages","--verbose","--setting-sources","user","--allowedTools","mcp__openclaw__*","--permission-mode","acceptEdits"]' --strict-json

openclaw config set agents.defaults.cliBackends.claude-cli.resumeArgs '["-p","--output-format","stream-json","--include-partial-messages","--verbose","--setting-sources","user","--allowedTools","mcp__openclaw__*","--permission-mode","acceptEdits","--resume","{sessionId}"]' --strict-json

openclaw config validate
openclaw gateway restart

Ça force acceptEdits au lieu de bypassPermissions, donc Claude ne devrait plus bloquer à cause de root.

#

Si ça bloque encore aprÚs restart, envoie openclaw --version + la nouvelle erreur.

sullen bluff
#

Error: Config validation failed: agents.defaults.cliBackends.claude-cli.command: Invalid input: expected string, received undefined

boreal escarpBOT
#

Yep, parce qu’en crĂ©ant agents.defaults.cliBackends.claude-cli.*, OpenClaw veut aussi command.

Ajoute juste :

openclaw config set agents.defaults.cliBackends.claude-cli.command claude

Puis relance :

openclaw config validate
openclaw gateway restart

Si claude n’est pas dans le PATH du gateway, mets le chemin complet :

#
which claude

puis par exemple :

openclaw config set agents.defaults.cliBackends.claude-cli.command /usr/local/bin/claude
sullen bluff
#

10:23:30+00:00 info - pid 2610580 root: openclaw-gateway (127.0.0.1:18789)
10:23:30+00:00 info - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
10:23:30+00:00 error Gateway restart timed out after 60s waiting for health checks.
10:23:30+00:00 info Tip: openclaw gateway status --deep
10:23:30+00:00 info Tip: openclaw doctor
10:23:56+00:00 warn plugins {"subsystem":"plugins"} bonjour: watchdog detected non-announced service; attempting re-advertise (gateway fqdn=ubuntu-32gb-hel1-2-ai (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=probing)
10:23:56+00:00 warn gateway/ws {"subsystem":"gateway/ws"} {"handshake":"pending","durationMs":2,"host":"127.0.0.1:18789","remoteAddr":"127.0.0.1","remotePort":36140,"localAddr":"127.0.0.1","localPort":18789,"endpoint":"127.0.0.1:36140->127.0.0.1:18789"} closed before connect conn=0c6e8762-510f-4afe-ba7a-c6a9d05da8fa peer=127.0.0.1:36140->127.0.0.1:18789 remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1006 reason=n/a
10:23:56+00:00 info plugins {"subsystem":"plugins"} embedded acpx runtime backend ready

boreal escarpBOT
#

C’est OK — lĂ  le souci n’est plus JSON/Claude, c’est juste que le gateway existant tourne encore, donc restart n’a pas rĂ©ussi Ă  le remplacer.

Fais dans cet ordre :

openclaw config validate
openclaw gateway stop
openclaw gateway status
openclaw gateway start
openclaw gateway status --deep

Si openclaw gateway status dit encore qu’un process tourne aprùs stop, ne force pas au hasard tout de suite — envoie la sortie de :

openclaw gateway status --deep
#

Ensuite, quand le gateway est bien redĂ©marrĂ©, reteste ton message Telegram/Claude. La config acceptEdits ne sera prise en compte qu’aprĂšs un vrai stop/start.

sullen bluff
#

Il répond plus ...

10:23:56+00:00 warn plugins {"subsystem":"plugins"} bonjour: watchdog detected non-announced service; attempting re-advertise (gateway fqdn=ubuntu-32gb-hel1-2-ai (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=probing)
10:23:56+00:00 warn gateway/ws {"subsystem":"gateway/ws"} {"handshake":"pending","durationMs":2,"host":"127.0.0.1:18789","remoteAddr":"127.0.0.1","remotePort":36140,"localAddr":"127.0.0.1","localPort":18789,"endpoint":"127.0.0.1:36140->127.0.0.1:18789"} closed before connect conn=0c6e8762-510f-4afe-ba7a-c6a9d05da8fa peer=127.0.0.1:36140->127.0.0.1:18789 remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1006 reason=n/a
10:23:56+00:00 info plugins {"subsystem":"plugins"} embedded acpx runtime backend ready
10:23:57+00:00 info plugins {"subsystem":"plugins"} bonjour: advertised gateway fqdn=ubuntu-32gb-hel1-2-ai (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=announcing

boreal escarpBOT
#

OK — les logs bonjour/ws closed before connect ne sont pas forcĂ©ment graves. LĂ  il faut isoler Telegram vs Claude CLI.

Lance ça :

openclaw --version
openclaw status --all
openclaw channels status --probe

Puis teste Claude sans Telegram :

openclaw agent --message "Réponds juste OK" --model claude-cli/claude-sonnet-4-6

Si cette commande sort encore --dangerously-skip-permissions, l’override n’est pas appliquĂ©. Envoie alors :

#
openclaw config get tools.exec.ask
openclaw config get agents.list[0].tools.exec.ask
openclaw config get agents.defaults.cliBackends.claude-cli.args --json

Si la commande répond OK, alors Claude marche et le souci est cÎté Telegram/allowFrom. Dans ce cas :

openclaw channels logs --channel telegram

puis envoie un message au bot et regarde si OpenClaw voit l’inbound.

sullen bluff
#

error: unknown option '--model'

boreal escarpBOT
#

Oui, ma faute — ta version de openclaw agent n’a pas --model.

Teste plutÎt avec le modÚle déjà configuré :

openclaw agent --agent main --message "Réponds juste OK"

Si ça ressort encore l’erreur Claude/root, envoie :

openclaw config get tools.exec.ask
openclaw config get agents.list[0].tools.exec.ask
openclaw config get agents.defaults.cliBackends.claude-cli.command
openclaw config get agents.defaults.cliBackends.claude-cli.args --json
#

Si ça répond OK, alors Claude remarche et le souci est cÎté Telegram. Dans ce cas :

openclaw channels status --probe
openclaw channels logs --channel telegram
sullen bluff
#

🩞 OpenClaw 2026.4.24 (cbcfdf6) — Self-hosted, self-updating, self-aware (just kidding... unless?).

10:29:05 [plugins] telegram failed during register from /usr/lib/node_modules/openclaw/dist/extensions/telegram/index.js: Error: ENOTEMPTY: directory not empty, rmdir '/root/.openclaw/plugin-runtime-deps/openclaw-unknown-a44f41aef101/dist/extensions/node_modules/openclaw/plugin-sdk'
[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: telegram: Error: ENOTEMPTY: directory not empty, rmdir '/root/.openclaw/plugin-runtime-deps/openclaw-unknown-a44f41aef101/dist/extensions/node_modules/openclaw/plugin-sdk'
at maybeThrowOnPluginLoadError (file:///usr/lib/node_modules/openclaw/dist/loader-NucjcOgv.js:2712:8)
at loadOpenClawPlugins (file:///usr/lib/node_modules/openclaw/dist/loader-NucjcOgv.js:3588:3)
at resolveRuntimePluginRegistry (file:///usr/lib/node_modules/openclaw/dist/loader-NucjcOgv.js:2443:9)
at resolveOrLoadRuntimePluginRegistry (file:///usr/lib/node_modules/openclaw/dist/runtime-registry-loader-CO1cck7F.js:37:7)
at ensurePluginRegistryLoaded (file:///usr/lib/node_modules/openclaw/dist/runtime-registry-loader-CO1cck7F.js:68:2)
at ensureCliPluginRegistryLoaded (file:///usr/lib/node_modules/openclaw/dist/command-execution-startup-Ch01qcCp.js:20:3)
at async ensureCliCommandBootstrap (file:///usr/lib/node_modules/openclaw/dist/command-execution-startup-Ch01qcCp.js:47:2)
at async ensureCliExecutionBootstrap (file:///usr/lib/node_modules/openclaw/dist/command-execution-startup-Ch01qcCp.js:295:2)
at async Object.callback (file:///usr/lib/node_modules/openclaw/dist/program-C2pnmt5C.js:85:3)
at async Command.parseAsync (/usr/lib/node_modules/openclaw/node_modules/commander/lib/command.js:1122:5)
root@ubuntu-32gb-hel1-2-ai:~#

boreal escarpBOT
#

Ah, là c’est un autre bug : OpenClaw 2026.4.24 a un souci connu autour des plugin-runtime-deps / dossiers openclaw-unknown-*.

Fais le plus safe : stop + déplacer le cache, pas supprimer.

openclaw gateway stop

mv /root/.openclaw/plugin-runtime-deps /root/.openclaw/plugin-runtime-deps.bak.$(date +%s)

openclaw doctor
openclaw gateway start

Si doctor ou start retĂ©lĂ©charge/rĂ©pare les deps, c’est normal.

Si ça recommence avec ENOTEMPTY, le mieux est de mettre à jour OpenClaw ou temporairement revenir à 2026.4.23 :

#
npm install -g openclaw@latest
# ou workaround temporaire :
npm install -g openclaw@2026.4.23

Puis :

openclaw gateway restart

Ce n’est plus ton problùme Claude/root pour l’instant — le gateway/CLI plante avant, sur le chargement du plugin Telegram.

sullen bluff
#

Gateway agent failed; falling back to embedded: GatewayClientRequestError: Error: Requested agent harness "claude-cli" is not registered and PI fallback is disabled.

boreal escarpBOT
#

LĂ  ça confirme que le plugin/runtime Claude CLI n’est pas enregistrĂ© aprĂšs le souci plugin-runtime-deps.

Fais la rĂ©paration plugin d’abord :

openclaw gateway stop
openclaw doctor --fix
openclaw config validate
openclaw gateway start

Puis teste :

openclaw agent --agent main --message "Réponds juste OK"
#

Si tu as encore claude-cli is not registered, avec 2026.4.24 je te conseille franchement de rollback temporaire :

openclaw gateway stop
npm install -g openclaw@2026.4.23
openclaw doctor --fix
openclaw gateway start

2026.4.24 a l’air de toucher exactement le bug plugin-runtime-deps/openclaw-unknown-* que tu as vu. Une fois stable, on pourra revenir à latest.

sullen bluff
#

10:34:27+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=claude-cli model=opus promptChars=352
10:34:27+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} claude live session reuse: provider=claude-cli model=claude-opus-4-7
10:34:29+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} claude live session turn: provider=claude-cli model=claude-opus-4-7 durationMs=1956 rawLines=13
10:36:52+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=claude-cli model=opus promptChars=387
10:36:52+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} claude live session reuse: provider=claude-cli model=claude-opus-4-7
10:38:52+00:00 info typing TTL reached (2m); stopping typing indicator
10:38:57+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:
5569 state=processing age=125s queueDepth=1
10:39:27+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:
5569 state=processing age=155s queueDepth=1
Log tail truncated (increase --max-bytes).
root@ubuntu-32gb-hel1-2-ai:~#

boreal escarpBOT
#

Bonne nouvelle : le --dangerously-skip-permissions est rĂ©glĂ©. LĂ  c’est maintenant une session Claude CLI rĂ©utilisĂ©e qui reste bloquĂ©e :

claude live session reuse ...
stuck session ... processing

Fais un reset propre de la session live :

openclaw gateway stop
ps -ef | grep '[c]laude'
openclaw gateway start

Si tu vois encore un vieux process claude -p --output-format stream-json aprÚs gateway stop, tue juste celui-là, puis redémarre :

#
pkill -f 'claude.*--output-format.*stream-json'
openclaw gateway start

Ensuite, dans Telegram, envoie comme message seul :

/reset soft

Ça drop les ids de session CLI rĂ©utilisĂ©s sans tout effacer. Docs : https://docs.openclaw.ai/tools/slash-commands

Si ça se rebloque souvent : honnĂȘtement, c’est le root workaround qui montre ses limites. Le fix stable reste de lancer OpenClaw sous un user non-root.

sullen bluff
#

10:58:57+00:00 warn model-fallback/decision {"subsystem":"model-fallback/decision"} {"event":"model_fallback_decision","tags":["error_handling","model_fallback","candidate_failed"],"runId":"5476e5c3-3f84-433c-a90f-3f303c0807bb","decision":"candidate_failed","requestedProvider":"anthropic","requestedModel":"claude-opus-4-7","candidateProvider":"anthropic","candidateModel":"claude-opus-4-7","attempt":1,"total":6,"reason":"timeout","status":408,"errorPreview":"CLI produced no output for 180s and was terminated.","errorHash":"sha256:8349e7990402","nextCandidateProvider":"anthropic","nextCandidateModel":"claude-sonnet-4-6","isPrimary":true,"requestedModelMatched":true,"fallbackConfigured":true} model fallback decision
10:58:57+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=claude-cli model=sonnet promptChars=350
10:58:57+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} claude live session start: provider=claude-cli model=claude-sonnet-4-6 activeSessions=1
10:59:00+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:
5569 state=processing age=192s queueDepth=1
10:59:30+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:
5569 state=processing age=222s queueDepth=1
11:00:00+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:
5569 state=processing age=252s queueDepth=1
11:00:30+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:
5569 state=processing age=282s queueDepth=1
11:01:00+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:
5569 state=processing age=312s queueDepth=1

boreal escarpBOT
#

LĂ  on a atteint la limite du workaround root : Claude CLI dĂ©marre, mais comme on a dĂ©sactivĂ© bypassPermissions, il attend probablement une validation interactive → OpenClaw ne reçoit rien → timeout 180s.

Le fix stable : passer OpenClaw sur un user non-root. Tu peux migrer sans tout refaire :

# en root
openclaw gateway stop
adduser openclaw

rsync -a /root/.openclaw/ /home/openclaw/.openclaw/
chown -R openclaw:openclaw /home/openclaw/.openclaw

su - openclaw

Puis dans le user openclaw :

#
claude auth login
claude auth status --text
openclaw doctor --fix
openclaw gateway start

Et remets le mode normal/Yolo si tu veux :

openclaw config set tools.exec.ask off
openclaw config set agents.list[0].tools.exec.ask off

Alternative si tu veux absolument rester root : utilise une clĂ© API Anthropic au lieu de Claude CLI. Mais Claude CLI + root + non-interactif, ça va continuer Ă  ĂȘtre fragile.

sullen bluff
#

oui mais flemme de tout reinstaller 🙁

boreal escarpBOT
#

Je te comprends 😭 Mais bonne nouvelle : pas besoin de tout rĂ©installer. Tu peux juste migrer l’état root vers un user normal.

Version “moins reloue” :

# en root
openclaw gateway stop
adduser openclaw

rsync -a --exclude plugin-runtime-deps /root/.openclaw/ /home/openclaw/.openclaw/
rsync -a /root/.claude/ /home/openclaw/.claude/ 2>/dev/null || true

chown -R openclaw:openclaw /home/openclaw/.openclaw /home/openclaw/.claude
loginctl enable-linger openclaw

su - openclaw
#

Puis dans le user openclaw :

openclaw config set agents.defaults.workspace /home/openclaw/.openclaw/workspace
openclaw config set tools.exec.ask off
openclaw config set agents.list[0].tools.exec.ask off

claude auth status --text
openclaw doctor --fix
openclaw gateway install --force
openclaw gateway start

Si claude auth status dit que t’es pas connectĂ© :

#
claude auth login

C’est pas une rĂ©install complĂšte : tu gardes ta config Telegram/OpenClaw, on change juste l’utilisateur qui exĂ©cute le gateway. C’est vraiment le chemin le moins douloureux pour que Claude CLI marche normalement.

sullen bluff
#

✔ Claude Code successfully installed!

Version: 2.1.119

Location: ~/.local/bin/claude

Next: Run claude --help to get started

⚠ Setup notes:
● Native installation exists but ~/.local/bin is not in your PATH. Run:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

✅ Installation complete!

openclaw@ubuntu-32gb-hel1-2-ai:~$
openclaw@ubuntu-32gb-hel1-2-ai:~$ claude
claude: command not found
openclaw@ubuntu-32gb-hel1-2-ai:~$ claude --help
claude: command not found
openclaw@ubuntu-32gb-hel1-2-ai:~$ claude auth login
claude: command not found
openclaw@ubuntu-32gb-hel1-2-ai:~$

boreal escarpBOT
#

T’es juste Ă  l’étape PATH — Claude est installĂ©, mais le shell ne le trouve pas.

Fais dans le user openclaw :

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
export PATH="$HOME/.local/bin:$PATH"
hash -r

claude --help

Si ça marche, login :

claude auth login
#
claude auth status --text

Et pour que le gateway systemd trouve Claude mĂȘme sans .bashrc, force le chemin absolu :

openclaw config set agents.defaults.cliBackends.claude-cli.command /home/openclaw/.local/bin/claude

Important : enlĂšve aussi le workaround acceptEdits qu’on avait mis quand tu Ă©tais root :

openclaw config unset agents.defaults.cliBackends.claude-cli.args
openclaw config unset agents.defaults.cliBackends.claude-cli.resumeArgs
openclaw config set tools.exec.ask off