Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
124fc6f
add logout reason tracking and improve cleanup handling (#6657)
tseglevskiy Oct 6, 2025
77395a3
adding send as a top level command (#6661)
0xToshii Oct 6, 2025
541b51c
Add watch build script (#6655)
celestial-vault Oct 6, 2025
529bb3a
refactor: Support Multiple Telemetry providers (#6582)
NightTrek Oct 6, 2025
63a3896
Multiroot mentions support (#6627)
canvrno Oct 6, 2025
2917cd2
Provider scripts (#6668)
canvrno Oct 6, 2025
e25fbc1
adding checkpoint restore to cli (#6669)
0xToshii Oct 7, 2025
a33a3d9
removing the duplicate error print value (#6670)
0xToshii Oct 7, 2025
c119574
implemented GetHostVersionResponse rpc in the cli (#6663)
pashpashpash Oct 7, 2025
29139a6
remove global --config flag for cli (#6673)
Garoth Oct 7, 2025
816c7ed
feat: Adding Oca mode for internal and external (#6599)
nihar-oracle Oct 7, 2025
9f25f8a
Auth refactor (#6674)
canvrno Oct 7, 2025
1eaeb18
Add Bedrock global and jp inference profile support. (#6666)
ajjuaire Oct 7, 2025
a85acf8
feat(logging): replace HostProvider with node-machine-id for machine …
arafatkatze Oct 7, 2025
5572096
add settings flag and settings parsing (#6682)
celestial-vault Oct 7, 2025
c3e24e5
add yolo flag (#6690)
celestial-vault Oct 8, 2025
d14d055
fixed ispartial handling for all cases, and cleaned up output to not …
pashpashpash Oct 8, 2025
e80e0eb
add oneshot command (#6695)
celestial-vault Oct 8, 2025
5b406ec
Add zod schema for the remote config settings (#6675)
sjf Oct 8, 2025
09933e7
Add warning message to remote config schema file (#6701)
sjf Oct 8, 2025
feee75b
Added multiroot docs (#6597)
canvrno Oct 8, 2025
4469a4f
Remove setting Supports Browser Use (#6700)
sjf Oct 8, 2025
8be46f9
Move MCP marketplace catalog from global state to disk cache (#5835)
celestial-vault Oct 8, 2025
0ea263c
refactor: use different secret keys for each auth provider (#6630)
BarreiroT Oct 8, 2025
8d2ee1d
do_nothing feature flag (#6712)
tseglevskiy Oct 8, 2025
0c63eaa
cli - markdown streaming ux (#6703)
pashpashpash Oct 8, 2025
c9550bf
now showing historical messages for cline task view (#6711)
0xToshii Oct 8, 2025
2292caf
v3.32.7 Release Notes (#6616)
github-actions[bot] Oct 8, 2025
beb7ada
add codeowner for storage folder (#6717)
celestial-vault Oct 8, 2025
6476f72
markdown streaming support for plan mode respond tool (#6719)
pashpashpash Oct 9, 2025
554e4d1
reorganize protos and add secrets proto message (#6720)
celestial-vault Oct 9, 2025
261fc7f
Make changes to the remote config schema (#6725)
sjf Oct 9, 2025
bb4211f
added missing cli host stubs (#6716)
pashpashpash Oct 9, 2025
835204c
Added updateApiConfigurationPartial with FieldMask to allow for parti…
canvrno Oct 9, 2025
2d58c5e
add temp rpc for updating the settings in cli (#6733)
celestial-vault Oct 9, 2025
a92f9d4
adding config command line arg (#6735)
0xToshii Oct 9, 2025
522d004
remove dynamic state key cline:clineAccountId (#6718)
celestial-vault Oct 9, 2025
724c7c7
add config set command (#6736)
celestial-vault Oct 9, 2025
7f05e06
Update plan mode response with latest content and `partial = false` i…
saoudrizwan Oct 9, 2025
a43d375
fixed plan mode respond reading from memory in cli (#6738)
pashpashpash Oct 9, 2025
e65590c
parse secret fields and set along with config set command (#6739)
celestial-vault Oct 10, 2025
1704df1
adding config list command with renderer (#6741)
0xToshii Oct 10, 2025
2d496ed
reusing ensureConfigManager inside of setCommand (#6743)
0xToshii Oct 10, 2025
b1ae417
ci: add workflow to auto-label JetBrains plugin issues (#6664)
arafatkatze Oct 10, 2025
b7a5e32
Add hooks feature flag (#6734)
candieduniverse Oct 10, 2025
79fd3a9
webfetch listdefinitions search and more tools added to cli rendering…
pashpashpash Oct 10, 2025
3b636e1
Add auto-retry with exponential backof for failed API requests (#6727)
saoudrizwan Oct 10, 2025
518733d
implement `cline config get` and update listing to use kebab case (#6…
0xToshii Oct 10, 2025
33b3dde
Remove out of date comment (#6757)
sjf Oct 10, 2025
787cd30
making instance list aesthetic (#6750)
pashpashpash Oct 10, 2025
4247f7f
removing streaming markdown in favor of stable output (#6747)
pashpashpash Oct 10, 2025
a09f700
remove emojis (#6746)
0xToshii Oct 10, 2025
078f33a
Add missing remote config setting for AWS use global inference (#6758)
sjf Oct 10, 2025
a670c1e
CLI Auth Wizard πŸ§™ (#6742)
canvrno Oct 10, 2025
3472e60
Standalone CLI Installation (#6689)
arafatkatze Oct 11, 2025
0858ff5
Fix CLI installation script (#6760)
arafatkatze Oct 11, 2025
77e3e1e
CLI config list changes (#6765)
canvrno Oct 11, 2025
f212ba2
Hooks: Initial implementation of hooks foundation logic [ENG-1011, EN…
candieduniverse Oct 11, 2025
67ed86a
function to fetch remote config (#6756)
celestial-vault Oct 12, 2025
8c05a99
help wanted (#6751)
pashpashpash Oct 12, 2025
5c7bb7c
Added getCwdHash proto (#6773)
canvrno Oct 12, 2025
42bad19
remote config state setting (#6776)
celestial-vault Oct 12, 2025
e7dc04f
Add subscribeToCheckpoints proto (#6770)
canvrno Oct 12, 2025
24b5bfd
auto-cleanup stale default instance config (#6693)
canvrno Oct 12, 2025
b5ae93d
Pashpashpash/UI enhancements cli (#6775)
pashpashpash Oct 12, 2025
128b721
initial (#6779)
canvrno Oct 12, 2025
844ecde
normie friendly root command (#6778)
pashpashpash Oct 12, 2025
cc0c956
add setting deleted range to taskState in checkpoint object (#6788)
0xToshii Oct 13, 2025
d0da0b2
logging and cleanup (#6790)
pashpashpash Oct 13, 2025
b50c2db
add instructions for using summarize task in plan and act modes (#6793)
0xToshii Oct 13, 2025
2fce6ef
Baseten provider Kimi K2 0711, Llama 4 Maverick and Llama 4 Scout Mod…
AlexKer Oct 13, 2025
e564901
Pashpashpash/error handling cli (#6797)
pashpashpash Oct 13, 2025
c7712e6
org selection in auth wizard in cli (#6798)
pashpashpash Oct 13, 2025
0957e86
remote config disable ui (#6794)
celestial-vault Oct 13, 2025
1241a2f
some chill cleanup (#6799)
pashpashpash Oct 13, 2025
7135fe4
feat: Add version information injection to CLI build script (#6780)
NightTrek Oct 13, 2025
b5fde0a
added instance list support for jetbrains and kill all (#6800)
pashpashpash Oct 13, 2025
d19c043
environment override (#6784)
tseglevskiy Oct 13, 2025
aeab0d2
onboarding cli + log verbosity cleanup + fixing bug with default inst…
pashpashpash Oct 13, 2025
fc32061
packaging ripgrep cli (#6805)
pashpashpash Oct 13, 2025
64bd618
version v alias (#6801)
pashpashpash Oct 13, 2025
1553611
added ripgrep download to github action workflow (#6806)
pashpashpash Oct 13, 2025
c5d1535
fixing terminalapp rendering of input forms (#6807)
pashpashpash Oct 13, 2025
663e752
feat: add environment-based visual indicators to UI (#6777)
tseglevskiy Oct 13, 2025
3846e3f
Remove MULTI_ROOT_WORKSPACE feature flag (#6808)
NightTrek Oct 13, 2025
c04e218
Fixing: Ripgrep download for integration tests (#6810)
arafatkatze Oct 13, 2025
3dc09d6
adding to CheckSendEnabled a check for if there is a curren task (#6812)
0xToshii Oct 13, 2025
cdffc00
feat(telemetry): add OpenTelemetry integration (#6605)
abeatrix Oct 13, 2025
98c84cd
add interval to fetch and set remote config (#6813)
celestial-vault Oct 13, 2025
c2f98b6
fetch remote config when switching accounts and when starting a task …
celestial-vault Oct 13, 2025
fc8517b
Update flakey test for getOpenTabs (#6816)
sjf Oct 13, 2025
c166d36
Fix deprecation warning (#6820)
sjf Oct 14, 2025
5e768ac
using a ephemeral instance for `cline auth` rather than default (#6819)
0xToshii Oct 14, 2025
85bf520
Add Bedrock defaultUserAgentProvider for Cline version identification…
ajjuaire Oct 14, 2025
600bcab
updating the task list to read from disk and not use an instance (#6817)
0xToshii Oct 14, 2025
a7ec392
Requesty base URL cannot be unchecked (#6804)
requesty-JohnCosta27 Oct 14, 2025
bb94a57
lock down org switching if remote config is detected (#6818)
celestial-vault Oct 14, 2025
9cd2729
Include gpt-5 in reasoning models in openai.ts (#6450)
Remy495 Oct 14, 2025
d252c84
fix: reasoning_details not consolidated for how openrouter expects in…
saoudrizwan Oct 14, 2025
08286a8
docs(multiroot-workspace): enhance documentation with limitations and…
Oct 14, 2025
7b7a006
feat(cli): Fixes CLI authentication redirect error (#6835)
arafatkatze Oct 14, 2025
814988c
feat(cli): add local installation script with improved build process …
arafatkatze Oct 14, 2025
9be95f2
updating cline task cancel to pause (#6837)
0xToshii Oct 14, 2025
467838a
adding to `cline task send` separate `--approve` and `--deny` flags (…
0xToshii Oct 14, 2025
b52edae
updated cline task open to include settings, yolo, and mode flags (#6…
0xToshii Oct 14, 2025
e399a70
terminal-line-wrapping (#6842)
pashpashpash Oct 14, 2025
ec6dacc
Hooks: Improving tests (step 1) [ENG-989, ENG-990] (#6831)
candieduniverse Oct 14, 2025
3288def
finalize `cline task send` according to spec - adds yolo flag and ins…
0xToshii Oct 14, 2025
0440898
rename `task follow` to `task chat`, remove top level `cline send` (#…
0xToshii Oct 14, 2025
2b5d6e5
add instance check to cline task new and full yolo flags (#6844)
0xToshii Oct 14, 2025
a8c62dd
feat: Add OpenTelemetry settings schema and state infrastructure (1/5…
NightTrek Oct 14, 2025
ffabde6
rename `instance use` to `instance default` and add the --default fla…
0xToshii Oct 14, 2025
e34c62a
add -o to top level cline command, and remove oneshot command (#6860)
0xToshii Oct 15, 2025
664ec1e
Folder, Task, and Checkpoints locking in cline-core (#6823)
canvrno Oct 15, 2025
e8b8ec4
bypass auto-approval count for yolo mode (#6859)
celestial-vault Oct 15, 2025
e76d952
finalizing the `cline task view` commands based on spec (#6864)
0xToshii Oct 15, 2025
9be3fa5
NPM install for cline (#6861)
Garoth Oct 15, 2025
d85fea1
fix telemetry toggle not displaying properly (#6832)
celestial-vault Oct 15, 2025
5832ca4
add task settings rpc (#6866)
celestial-vault Oct 15, 2025
4d525e0
Adding Terminal background process (#6598)
arafatkatze Oct 15, 2025
8e3ee11
Man page for cline command, and build system to do it (#6870)
Garoth Oct 15, 2025
3c31880
Fix: cline provider auth should print url in case it doesn't auto-ope…
Garoth Oct 15, 2025
689e7f0
fix piping stdin into cline (#6874)
Garoth Oct 15, 2025
aa2cbc3
bubbles (#6871)
pashpashpash Oct 15, 2025
65d46a3
setting input width to 46 to minimize resize issues (#6879)
pashpashpash Oct 15, 2025
153e24b
fix ctrl-c in task view. should just disconnect the view (#6876)
Garoth Oct 15, 2025
4368344
cli polish round 3 (#6880)
pashpashpash Oct 15, 2025
7be84fd
cli banner (#6882)
pashpashpash Oct 15, 2025
b2e3e9b
Allow package secrets when publishing the nightly release (#6884)
BarreiroT Oct 15, 2025
65e5f0f
fixing control c cancel task reliably (#6885)
pashpashpash Oct 15, 2025
f47d077
clean exits (#6886)
pashpashpash Oct 15, 2025
7c51236
approval hints in task view (#6887)
pashpashpash Oct 15, 2025
b09751b
feat(hooks): Implement test fixtures (#6862)
candieduniverse Oct 15, 2025
c7143a6
Initial global clinerules dir implementation (#6846)
candieduniverse Oct 15, 2025
9a7c6ed
CLI Subagents - settings & telemetry framework (#6888)
canvrno Oct 15, 2025
66a4eb0
hotfix: Add Claude Haiku 4.5 support (#6889)
saoudrizwan Oct 15, 2025
6b963c2
Update remote config schema (#6867)
sjf Oct 15, 2025
385ac33
fix: add excluded standalone file needed for terminal runs (#6892)
arafatkatze Oct 15, 2025
e42f0a9
remote url type from vscode text field (#6890)
celestial-vault Oct 15, 2025
6f59480
Remove duplicated log (#6869)
sjf Oct 15, 2025
91c5434
reference man page in cline --help (#6897)
Garoth Oct 16, 2025
0a25484
ensure t v / t v -f / t c output an error if no task is active (#6894)
Garoth Oct 16, 2025
947996b
πŸͺHooks: `UserPromptSubmit` hook [ENG-1000] (#6893)
candieduniverse Oct 16, 2025
5152b97
fix version output with cli ver + core ver (#6899)
Garoth Oct 16, 2025
958801e
fix 10s wait when using cline instance kill -a (#6901)
Garoth Oct 16, 2025
fadc961
Remove --workdir / -w flag (wasnt completed) (#6903)
Garoth Oct 16, 2025
546e700
improve auth docs to say it configures models too, from influencer fe…
Garoth Oct 16, 2025
e9eb7ae
fix(cli): Add telemetry settings support to Go host bridge (#6906)
NightTrek Oct 16, 2025
7162b26
Fix Claude Sonnet 4 support on Vertex (#6904)
saoudrizwan Oct 16, 2025
86c526b
fetch all remote configs and lock user to remote config org (#6902)
celestial-vault Oct 16, 2025
43fabaa
approval with feedback fix (#6911)
pashpashpash Oct 16, 2025
ec543a2
make cli version built in rather than reading the package.json at run…
Garoth Oct 16, 2025
78c3664
cliversion in hostbridge env implementation (#6912)
pashpashpash Oct 16, 2025
b351a8b
feat: add banner to install Cline for CLI and experimental subagents …
saoudrizwan Oct 16, 2025
7dceaea
fix: show auth command suggestion in subagents setting
saoudrizwan Oct 16, 2025
2ed5ce9
fix: new terminal design showing incorrect states when running in bac…
saoudrizwan Oct 16, 2025
9e3c398
v3.33.0 Release Notes (#6732)
github-actions[bot] Oct 16, 2025
16e1c02
add cli docs (#6836)
csells Oct 16, 2025
738e959
fix: Copy link for CLI installation (#6919)
arafatkatze Oct 16, 2025
e4e07fc
v3.33.1 Release Notes
saoudrizwan Oct 16, 2025
46ef8b1
πŸͺHooks: `TaskStart` hook [ENG-1001] (#6895)
candieduniverse Oct 16, 2025
915259c
Oops. Putting back a small detail that I accidentally removed. (#6920)
candieduniverse Oct 16, 2025
45d751b
auto update for cli root command (#6914)
pashpashpash Oct 16, 2025
8f8c456
Docs upgrade (#6907)
Oct 16, 2025
03d6561
show cli version in banner instead of core version (#6915)
pashpashpash Oct 16, 2025
513c518
Add the cline provider to the remote config schema (#6908)
sjf Oct 16, 2025
0c0ba93
feat(config): add runtime environment switching support (#6621)
abeatrix Oct 16, 2025
c0b4081
Enhance documentation: Add supported model providers and installation…
Oct 16, 2025
0d9909c
partially update autoApprovalSettings (#6929)
celestial-vault Oct 16, 2025
ae0f255
Remove unneeded test that's slowing down the test suite (#6932)
candieduniverse Oct 17, 2025
63276ab
fixing bug where yolo mode didnt output body in plan mode (#6940)
pashpashpash Oct 17, 2025
176cced
Updated banner to add that Linux is supported in Cline CLI (#6922)
canvrno Oct 17, 2025
bddbea0
fix: Disable subagents for jetbrains (#6933)
arafatkatze Oct 17, 2025
e70d60d
fixing duplicate ask headers for tool approvals, and fixing ask state…
pashpashpash Oct 17, 2025
2b25ef6
chore: remove unnecessary debug logs for cline env (#6960)
abeatrix Oct 17, 2025
2860ffe
add auto approve option to interactive (#6937)
celestial-vault Oct 17, 2025
b21ff1e
remove unused ApiConfiguration proto message (#6941)
celestial-vault Oct 17, 2025
c5f12b8
Fixing banner to not show CLI release for windows users (#6942)
arafatkatze Oct 17, 2025
3191e23
fix(dev): deauth user on env changed (#6969)
abeatrix Oct 17, 2025
4336471
feat(hooks): Implement TaskResume hook (#6928)
candieduniverse Oct 18, 2025
d6f736e
feat(hooks): Implement TaskCancel hook (#6962)
candieduniverse Oct 18, 2025
ca87c21
use setglobalstatebatch for refresh models instead of setapiconfigura…
celestial-vault Oct 18, 2025
0707df2
add cline provider (#6927)
celestial-vault Oct 20, 2025
7c7962c
fix: Solve the issue where the notch on the terminal doesn't have ful…
arafatkatze Oct 20, 2025
eb13256
separate core and rpc wrappers for refresh models (#6981)
celestial-vault Oct 20, 2025
afe01df
Added new AWS SE regions (#6990)
canvrno Oct 20, 2025
89bf81f
Package updates (#6991)
canvrno Oct 20, 2025
9679917
`cline doctor` command: terminal shift enter support + auto updates (…
pashpashpash Oct 20, 2025
46d3b2a
auto compact updates (#6909)
0xToshii Oct 21, 2025
f116a63
refactor: simplify BedrockProvider UI code (#7015)
abeatrix Oct 21, 2025
cfc6b0d
added ZAI GLM4.6 to static models list and set as default (#6989)
AlexKer Oct 21, 2025
b636018
fixing no-tty / stdin + standardizing color codes in plain mode (#6992)
pashpashpash Oct 21, 2025
0c8e02c
Fetch the complete user info when the user logs in using WorkOS (#7026)
BarreiroT Oct 22, 2025
65a0c35
Add Qwen 3 Coder models to Amazon Bedrock models (#7022)
ajjuaire Oct 22, 2025
ba6a72c
Update the remote config when the user logs in (#7025)
sjf Oct 22, 2025
737452b
wire open command with -s flag to use tasksettings (#7016)
celestial-vault Oct 22, 2025
c729e8c
feat: expandable long task header (#6966)
abeatrix Oct 22, 2025
929d13a
Fix(task): use background terminal for subagent command execution (#7…
arafatkatze Oct 22, 2025
29d1b05
Update stored WorkOS Auth Data after refreshing it (#7029)
BarreiroT Oct 22, 2025
a820026
Multiple CLI auth wizard changes (#7005)
canvrno Oct 22, 2025
3ef4aea
added opinionated preferences for open source model providers (#7020)
pashpashpash Oct 22, 2025
dcf519d
GLM 4.6 prompt changes (#7046)
canvrno Oct 22, 2025
e3f4ce6
Changeset version bump (#7037)
github-actions[bot] Oct 23, 2025
a98faf5
fix: Removing Eslint from package lock json (#7047)
arafatkatze Oct 23, 2025
7692ada
Claude docs update and fixing missing images (#7041)
Oct 23, 2025
f91769b
Fixed proto name issue (#7054)
canvrno Oct 23, 2025
6f69ffb
Remove apiConfiguration conversion function from updateApiConfigurati…
celestial-vault Oct 23, 2025
ee1bb2f
Support Feature Flags default values (#7027)
BarreiroT Oct 23, 2025
65dbd85
Updating trending model list (#7018)
canvrno Oct 23, 2025
0cd462a
Add linter check for proto files and add autoformatting (#7066)
sjf Oct 23, 2025
978a8a0
update e2e evals to use cline cli (#6977)
0xToshii Oct 24, 2025
a8027dc
feat: Adding oracle code assist to the cli (#7004)
nihar-oracle Oct 24, 2025
535b29f
Support OpenRouter presets entry (#7083)
canvrno Oct 25, 2025
062a32f
fix(scripts): fix proto-lint script execution on Windows (#7089)
abeatrix Oct 25, 2025
585027f
Merge branch 'codeagent' into kaenova/cline-merge-20251026
kaenova Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/fruity-crabs-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---

Fixed proto naming issue - RPC >>> Rpc
5 changes: 0 additions & 5 deletions .changeset/legal-shirts-drop.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/short-carrots-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---

Support Feature Flags default values
5 changes: 0 additions & 5 deletions .changeset/slick-seas-love.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/smooth-items-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"claude-dev": minor
---

Adding oca as a provider to cline cli
5 changes: 5 additions & 0 deletions .changeset/wet-islands-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---

Changes to allow users to manually enter model names (eg. presets) when using OpenRouter
54 changes: 54 additions & 0 deletions .clinerules/hooks/PostToolUse.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
# PostToolUse Hook Example
#
# This hook runs AFTER a tool is executed. It can:
# 1. Observe tool results and outcomes
# 2. Add context for FUTURE tool uses via contextModification
# 3. Log or track tool usage patterns
#
# IMPORTANT: Context injection affects FUTURE AI decisions, not the current tool execution.
# The tool has already completed when this hook runs.

# Read the hook input (JSON via stdin)
input=$(cat)

# Extract tool information
tool_name=$(echo "$input" | jq -r '.postToolUse.toolName // "unknown"')
parameters=$(echo "$input" | jq -r '.postToolUse.parameters // {}')
result=$(echo "$input" | jq -r '.postToolUse.result // ""')
success=$(echo "$input" | jq -r '.postToolUse.success // false')
execution_time=$(echo "$input" | jq -r '.postToolUse.executionTimeMs // 0')

# Example 1: Learning from file operations
# Track successful file creations to build context about project structure
# if [[ "$tool_name" == "write_to_file" && "$success" == "true" ]]; then
# path=$(echo "$parameters" | jq -r '.path // ""')
# cat <<EOF
# {
# "shouldContinue": true,
# "contextModification": "FILE_OPERATIONS: Successfully created '$path'. Future operations should maintain consistency with this file's patterns and structure."
# }
# EOF
# exit 0
# fi

# Example 2: Performance monitoring
# Warn about slow operations
# if [[ "$execution_time" -gt 5000 ]]; then
# cat <<EOF
# {
# "shouldContinue": true,
# "contextModification": "PERFORMANCE: Tool '$tool_name' took ${execution_time}ms to complete. Consider optimizing future similar operations or breaking them into smaller steps."
# }
# EOF
# exit 0
# fi

# Example 3: Context injection for future tool uses
# The context will be available in the NEXT API request
cat <<EOF
{
"shouldContinue": true,
"contextModification": "TOOL_RESULT: The tool '$tool_name' completed with success=$success. Consider validating the results before proceeding to the next step."
}
EOF
42 changes: 42 additions & 0 deletions .clinerules/hooks/PreToolUse.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# PreToolUse Hook Example
#
# This hook runs BEFORE a tool is executed. It can:
# 1. Block execution by returning {"shouldContinue": false}
# 2. Add context for FUTURE tool uses via contextModification
# 3. Validate tool parameters
#
# IMPORTANT: Context injection affects FUTURE AI decisions, not the current tool execution.
# The tool parameters are already determined when this hook runs.

# Read the hook input (JSON via stdin)
input=$(cat)

# Extract tool information
tool_name=$(echo "$input" | jq -r '.preToolUse.toolName // "unknown"')
parameters=$(echo "$input" | jq -r '.preToolUse.parameters // {}')

# Example 1: Validation - Block invalid operations
# Uncomment to prevent creating .js files in a TypeScript project
# if [[ "$tool_name" == "write_to_file" ]]; then
# path=$(echo "$parameters" | jq -r '.path // ""')
# if [[ "$path" == *.js ]]; then
# cat <<EOF
# {
# "shouldContinue": false,
# "errorMessage": "VALIDATION FAILED: Cannot create .js files in TypeScript project. Please use .ts extension instead.",
# "contextModification": "WORKSPACE_RULES: This is a strict TypeScript project. All new files must use .ts or .tsx extensions."
# }
# EOF
# exit 0
# fi
# fi

# Example 2: Context injection for future tool uses
# The context will be available in the NEXT API request after this tool completes
cat <<EOF
{
"shouldContinue": true,
"contextModification": "WORKSPACE_RULES: [For future tool uses] This is a TypeScript React project. When creating files, use .ts/.tsx extensions and include detailed comments explaining the purpose and usage of each function."
}
EOF
Loading
Loading