anthropics / anthropics/claude-agent-sdk-python

Expose the ability to configure bash environment

オープン
#167 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
8.1k
フォーク
1.3k
平均マージ
2日 31分
マージ済み PR(30日)
1

説明

I'm trying to configure a bash alias for use by CC as wrapped by the python sdk. specifically, I'd like to alias `curl` to `curl -s`, as progress bar output is useless to Claude and only pollutes context.

I've thought of a few approaches, none of which seem to work:
- using a PreToolUse hook instead to modify the command invocation. this doesn't seem possible, as these hooks can't modify, only allow/deny.
- passing it as explicit configuration to the Bash tool or CC. doesn't seem like this is exposed.
- seeding the alias in the .bashrc in the matching $HOME of the user Claude is run under.

unfortunately none of these seem feasible - Claude only ever reports having the following set:

`alias rg='/usr/lib/node_modules/\\@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg'`

I haven't found reference to this `rg` alias anywhere in this SDK, which leads me to believe it's being configured upstream in CC itself, but I can't confirm that.

the odd thing is that when I run Claude locally, it captures my aliases fine. this leads me to believe there might be some interaction with the SDK, since I can't get this behavior to match what happens with a direct invocation.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。