captain-hook
Getting Started
Guide
Examples
Reference
Development
Changelog
API
/
File.contains()
API Index
Registration
hook()
on()
register()
Primitives
audit()
gate()
nudge()
lint()
diff_lint()
block_command()
warn_command()
llm_gate()
llm_nudge()
llm_evaluate()
prompt_check()
style.styleguide()
style.matchers
style.StyleRule
style.StyleDiffRule
style.Violation
GateVerdict
NudgeVerdict
PromptCheckVerdict
Conditions
Tool
FilePath
TouchedFile
TestFile
ReadFile
RanCommand
UsedSkill
InPlanMode
Waiting
Signal
Signals
CustomCondition
Events & Results
Event
BaseHookEvent
ToolHookEvent
PreToolUseEvent
PostToolUseEvent
PostToolUseFailureEvent
UserPromptSubmitEvent
StopEvent
SubagentStartEvent
SubagentStopEvent
PreCompactEvent
NotificationEvent
HookContext
HookResult
Action
Agent
Content
BaseHookEvent Methods
BaseHookEvent.event
BaseHookEvent.is_subagent
BaseHookEvent.session_id
BaseHookEvent.tasks
BaseHookEvent.user_prompt
BaseHookEvent.stop_hook_active
BaseHookEvent.transcript_path
BaseHookEvent.permission_mode
BaseHookEvent.parent_agent_type
BaseHookEvent.tool_name
BaseHookEvent.input
BaseHookEvent.command
BaseHookEvent.command_line
BaseHookEvent.file
BaseHookEvent.content
BaseHookEvent.old
BaseHookEvent.agent_type
BaseHookEvent.command_matches()
BaseHookEvent.file_matches()
BaseHookEvent.content_matches()
BaseHookEvent.allow()
BaseHookEvent.warn()
BaseHookEvent.block()
ToolHookEvent Methods
ToolHookEvent.tool_name
ToolHookEvent.command_line
ToolHookEvent.content
ToolHookEvent.old
ToolHookEvent.agent_type
ToolHookEvent.command_matches()
ToolHookEvent.file_matches()
ToolHookEvent.content_matches()
HookContext Methods
HookContext.t
HookContext.s
HookContext.state
HookContext.conf
HookContext.c
HookContext.turn
HookContext.prior
HookContext.call_cli()
HookContext.git()
HookContext.changed_paths
HookContext.repo_root
HookContext.current_branch
HookContext.call_llm()
HookContext.resolve_schema_path()
Files & Commands
File
file.PathMatcher
file.categorize_files()
utils.read_json()
Command
CommandLine
Redirect
EditOp
WriteOp
TaskOp
File Methods
File.__getattr__()
File.__str__()
File.__fspath__()
File.__eq__()
File.__hash__()
File.is_test
File.matches()
File.under()
File.exists()
File.read_text()
File.contains()
Command Methods
Command.parse()
Command.empty()
Command.argv
Command.program
Command.env_dict
Command.matches()
Command.has_arg()
Command.__str__()
Command.__contains__()
Command.__bool__()
CommandLine Methods
CommandLine.parse()
CommandLine.commands
CommandLine.primary
CommandLine.head
CommandLine.__iter__()
CommandLine.__len__()
CommandLine.__str__()
CommandLine.__contains__()
CommandLine.__bool__()
CommandLine.q
CommandLine.node_text()
CommandLine.word_text()
CommandLine.extract_redirect()
CommandLine.extract_command()
CommandLine.collect_parts()
CommandLine.walk_redirected()
CommandLine.walk_node()
CommandLine.fallback()
Transcript
Transcript
TranscriptMessage
TranscriptSlice
ToolUse
ToolUseQuery
ToolUseSequence
Turn
Task
Tasks
Transcript Methods
Transcript.is_user_message()
Transcript.__len__()
Transcript.__bool__()
Transcript.__getitem__()
Transcript.__str__()
Transcript.from_path()
Transcript.from_simple_messages()
Transcript.from_messages()
Transcript.from_parsed()
Transcript.tool_uses
Transcript.count_tools()
Transcript.has_tool()
Transcript.commands
Transcript.has_command()
Transcript.has_edit_to()
Transcript.user_said()
Transcript.all_edits_under()
Transcript.first_user_message()
Transcript.after()
Transcript.before()
Transcript.prior()
Transcript.recent()
Transcript.full_text
Transcript.assistant_text()
Transcript.extract_files()
Transcript.has_read()
Transcript.has_skill()
Transcript.subagents
Transcript.count_failures()
Transcript.has_override()
Transcript.edit_ops()
Transcript.write_ops()
Transcript.task_ops()
Transcript.turn_start
Transcript.current_turn
Transcript.since_last_user()
TranscriptMessage Methods
TranscriptMessage.from_raw()
TranscriptMessage.is_async_tool_use()
TranscriptMessage.notification
TranscriptMessage.tool_uses
TranscriptMessage.tool_results
TranscriptMessage.text
ToolUse Methods
ToolUse.is_error
ToolUse.input
ToolUse.file
ToolUse.command
ToolUse.command_line
ToolUse.agent_type
ToolUseQuery Methods
ToolUseQuery.where()
ToolUseQuery.count()
ToolUseQuery.any()
ToolUseQuery.list()
ToolUseQuery.first()
ToolUseQuery.last()
ToolUseQuery.files()
ToolUseQuery.__iter__()
ToolUseQuery.__len__()
ToolUseQuery.__bool__()
ToolUseSequence Methods
ToolUseSequence.where()
ToolUseSequence.__getitem__()
ToolUseSequence.__iter__()
ToolUseSequence.__len__()
ToolUseSequence.__bool__()
ToolUseSequence.with_errors
Tasks Methods
Tasks.resolve_root()
Tasks.for_session()
Tasks.__getitem__()
Tasks.__len__()
Tasks.get()
Tasks.with_status()
Tasks.pending
Tasks.in_progress
Tasks.completed
Tasks.open
Tasks.all_completed
Tool Inputs
InputBase
FileInputBase
AgentInput
BashInput
EditInput
GenericInput
GlobInput
GrepInput
ReadInput
SkillInput
TaskCreateInput
TaskUpdateInput
WriteInput
ToolResult
Signals
Clause
NlpSignal
Phrase
State & Sessions
HookState
PrimitiveState
SourceEdits
workflow_state()
SessionSlot
SessionStore
session_state()
Workflow
Step
Artifact
text_matches()
workflow()
SessionStore Methods
SessionStore.__getitem__()
SessionStore.load()
SessionStore.track()
SessionStore.untrack()
SessionStore.tracked_models()
SessionStore.tracked_paths()
Testing
Input
Allow
Block
Warn
TranscriptFixture
Configuration & Prompts
HooksSettings
build_settings()
Prompt
Prompt Methods
Prompt.system()
Prompt.context()
Prompt.ask()
Prompt.from_template()
Prompt.load()
Prompt.__str__()
File.contains()
Usage
Source
File
.
contains
(
pattern
)