MCPcopy Create free account
hub / github.com/anthropics/claude-code / Condition

Class Condition

plugins/hookify/core/config_loader.py:16–29  ·  view source on GitHub ↗

A single condition for matching.

Source from the content-addressed store, hash-verified

14
15@dataclass
16class Condition:
17 """A single condition for matching."""
18 field: str # "command", "new_text", "old_text", "file_path", etc.
19 operator: str # "regex_match", "contains", "equals", etc.
20 pattern: str # Pattern to match
21
22 @classmethod
23 def from_dict(cls, data: Dict[str, Any]) -> 'Condition':
24 """Create Condition from dict."""
25 return cls(
26 field=data.get('field', ''),
27 operator=data.get('operator', 'regex_match'),
28 pattern=data.get('pattern', '')
29 )
30
31
32@dataclass

Callers 2

rule_engine.pyFile · 0.90
from_dictMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected