Writing self-contained epitaph needs time (6)
I believe the answer is:
script
'writing' is the definition.
(script is a kind of writing)
'self-contained epitaph needs time' is the wordplay.
'self contained' becomes 'sc' (abbreviation).
'epitaph' becomes 'RIP' (rest in peace).
'needs' is a charade indicator (letters next to each other).
'time' becomes 't' (abbreviation).
'sc'+'rip'+'t'='SCRIPT'
(Other definitions for script that I've seen before include "Written characters" , "Person preparing text for film actors" , "Written text of play or film" , "Written copy of words to be spoken" , "Hand" .)